title: Printer "Filter failed" errors -- 2 bizarre workarounds

text: These workarounds may help people deal with this fairly common problem -- and also maybe help an expert find a proper fix for it. I'm running Linux Mint 16 Mate edition, with an HP Deskjet 1000 (an inexpensive printer with wired connection only, no wireless connection). All the Mint updates are current as of today. Workaround #1: I get the "Filter failed" error ONLY when printing a text file from the gedit text editor. The printer's test file prints fine -- and so do jpg and (importantly) pdf files. So to print a text file from gedit, print it first to a pdf file -- then print that file on the printer. Or simply copy and paste the text into LibreOffice writer, and print it from there instead of from gedit. Interesting, though the failed jobs keep sitting in the print queue and the printer's status is shown as "Filter failed," the printer still works fine for other files. No need to restart or reset anything nor even clear the garbage from the print queue, though I do that from time to time to clean out my forgetful attempts to print from gedit. Workaround #2: The above problem happens ONLY when I choose to print with the printer named "HP-Deskjet-1000-J110-series" (which of course may be a different name for your printer). But there is another print option more simply named "Deskjet_1000_J110" (even though my system has only one actual printer). This icon with the simpler name prints all kinds of files on that printer, including from gedit. It's 2014, and this Filter Failed time-sucking vampire has been active for years. I haven't seen a fix that works for everybody. Lets get the gedit(?) or CUPS(?) or HP(?) problem fixed and done with, so more people don't need to waste time figuring out workarounds for themselves.


title: Troubleshooting kernel panic -- next steps after analyzing `crash` dump

text: I'm running an Ubuntu 12.04 machine with an Intel i7 CPU. Every now and then, it freezes up completely -- the machine and display stay on for a minute or so, the audio that was playing (if any happened to be playing) starts looping and then it reboots. While this typically happens under moderate to high load, it also happens occasionally when nothing is running. The crash occurs regardless of whether the Intel XMP 1333 MHz boosted to 1600 MHz memory setting is turned on in the BIOS. I haven't touched any of the other overclocking settings either. Here are the obvious things I've done so far: **Observed CPU temperature** Following the guide here, I setup temperature instrumentation on the machine and then ran `watch sensors` so I could get a continuous reading of the CPU's temperature. The machine freezes despite all cores operating at reasonable temperatures (~60-65 degrees). **Observed RAM usage** The machine has 16 GB of RAM. It freezes despite only ~ 3 GB of that being in use. **Observed CPU Utilization** As said prior, the freeze up occurs more often under load, but has also occurred at "idle". None of these obvious things pointed to the problem, so I followed the guide here to get up and running with the `crash` command to help me diagnose the problem. Here is the output of running `crash` on the crash dump:               crash /usr/lib/debug/boot/vmlinux-3.2.0-58-generic ~/temp/crash2/VmCore          crash 6.1.6     Copyright (C) 2002-2013  Red Hat, Inc.     Copyright (C) 2004, 2005, 2006, 2010  IBM Corporation     Copyright (C) 1999-2006  Hewlett-Packard Co     Copyright (C) 2005, 2006, 2011, 2012  Fujitsu Limited     Copyright (C) 2006, 2007  VA Linux Systems Japan K.K.     Copyright (C) 2005, 2011  NEC Corporation     Copyright (C) 1999, 2002, 2007  Silicon Graphics, Inc.     Copyright (C) 1999, 2000, 2001, 2002  Mission Critical Linux, Inc.     This program is free software, covered by the GNU General Public License,     and you are welcome to change it and/or distribute copies of it under     certain conditions.  Enter "help copying" to see the conditions.     This program has absolutely no warranty.  Enter "help warranty" for details.          GNU gdb (GDB) 7.3.1     Copyright (C) 2011 Free Software Foundation, Inc.     License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>     This is free software: you are free to change and redistribute it.     There is NO WARRANTY, to the extent permitted by law.  Type "show copying"     and "show warranty" for details.     This GDB was configured as "x86_64-unknown-linux-gnu"...                KERNEL: /usr/lib/debug/boot/vmlinux-3.2.0-58-generic         DUMPFILE: /home/bryce/temp/crash2/VmCore             CPUS: 8             DATE: Mon Jan 20 19:29:26 2014           UPTIME: 02:33:18     LOAD AVERAGE: 1.40, 0.93, 0.50            TASKS: 579         NODENAME: <node_name>          RELEASE: 3.2.0-58-generic          VERSION: #88-Ubuntu SMP Tue Dec 3 17:37:58 UTC 2013          MACHINE: x86_64  (3499 Mhz)           MEMORY: 16 GB            PANIC: "[ 9180.518213] Kernel panic - not syncing: Fatal Machine check"              PID: 0          COMMAND: "swapper/1"             TASK: ffff8804045e9700  (1 of 8)  [THREAD_INFO: ffff8804045e4000]              CPU: 1            STATE: TASK_RUNNING (PANIC)      And the result of running `bt` at the `crash` prompt:               crash> bt     PID: 0      TASK: ffff8804045e9700  CPU: 1   COMMAND: "swapper/1"      #0 [ffff88041ec4aba0] machine_kexec at ffffffff8103943a      #1 [ffff88041ec4ac10] crash_kexec at ffffffff810b58d8      #2 [ffff88041ec4ace0] panic at ffffffff8164928c      #3 [ffff88041ec4ad60] mce_panic at ffffffff8102ab0b      #4 [ffff88041ec4adb0] mce_panic at ffffffff8102aba0      #5 [ffff88041ec4ade0] mce_reign at ffffffff8102ade4      #6 [ffff88041ec4ae40] mce_end at ffffffff8102b095      #7 [ffff88041ec4ae70] do_machine_check at ffffffff8102b84c      #8 [ffff88041ec4af50] machine_check at ffffffff8166254c         [exception RIP: mwait_idle_with_hints+93]         RIP: ffffffff8103109d  RSP: ffff8804045e5e38  RFLAGS: 00000046         RAX: 0000000000000033  RBX: ffff88040009ba60  RCX: 0000000000000001         RDX: 0000000000000000  RSI: 0000000000000001  RDI: 0000000000000033         RBP: ffff8804045e5e38   R8: ffff8804045e5fd8   R9: 0000000000000f85         R10: 000000000000198f  R11: 0000000000000000  R12: 0000000000000002         R13: ffff88040009b800  R14: ffff88040009b820  R15: 134b04c7ed0ea230         ORIG_RAX: ffffffffffffffff  CS: 0010  SS: 0018     --- <MCE exception stack> ---      #9 [ffff8804045e5e38] mwait_idle_with_hints at ffffffff8103109d     #10 [ffff8804045e5e40] acpi_processor_ffh_cstate_enter at ffffffff810310e2     #11 [ffff8804045e5e50] acpi_idle_do_entry at ffffffff81399182     #12 [ffff8804045e5e60] acpi_idle_enter_simple at ffffffff813992d8     #13 [ffff8804045e5ea0] cpuidle_idle_call at ffffffff8150bd61     #14 [ffff8804045e5f00] cpu_idle at ffffffff8101322a      And the result of running `log` at the `crash` prompt (I've only shown the tail of the file, with the first displayed line at time 4232.799 as earlier context - error details start on the following line):               crash>log     [ 4232.799853] ath: Could not kill baseband RX     [ 9180.518188] [Hardware Error]: CPU 5: Machine Check Exception: 5 Bank 1: bf80000000000124     [ 9180.518191] [Hardware Error]: RIP !INEXACT! 10:<ffffffff8111fc4f> {__rmqueue+0x1f/0x4b0}     [ 9180.518196] [Hardware Error]: TSC 1d5211c92f0e ADDR 419801540 MISC 86      [ 9180.518199] [Hardware Error]: PROCESSOR 0:306c3 TIME 1390210166 SOCKET 0 APIC 3 microcode 9     [ 9180.518200] [Hardware Error]: Run the above through 'mcelog --ascii'     [ 9180.518202] [Hardware Error]: CPU 1: Machine Check Exception: 5 Bank 1: bf80000000000124     [ 9180.518204] [Hardware Error]: RIP !INEXACT! 10:<ffffffff8103109d> {mwait_idle_with_hints+0x5d/0x70}     [ 9180.518207] [Hardware Error]: TSC 1d5211c92ee8 ADDR 419801540 MISC 86      [ 9180.518209] [Hardware Error]: PROCESSOR 0:306c3 TIME 1390210166 SOCKET 0 APIC 2 microcode 9     [ 9180.518210] [Hardware Error]: Run the above through 'mcelog --ascii'     [ 9180.518211] [Hardware Error]: Machine check: Processor context corrupt     [ 9180.518213] Kernel panic - not syncing: Fatal Machine check     [ 9180.518215] Pid: 0, comm: swapper/1 Tainted: P   M       O 3.2.0-58-generic #88-Ubuntu     [ 9180.518216] Call Trace:     [ 9180.518217]  <#MC>  [<ffffffff81649285>] panic+0x91/0x1a4     [ 9180.518224]  [<ffffffff8102ab0b>] mce_panic.part.14+0x18b/0x1c0     [ 9180.518226]  [<ffffffff8102aba0>] mce_panic+0x60/0xb0     [ 9180.518228]  [<ffffffff8102ade4>] mce_reign+0x1f4/0x200     [ 9180.518230]  [<ffffffff8102b095>] mce_end+0xf5/0x100     [ 9180.518232]  [<ffffffff8102b84c>] do_machine_check+0x3fc/0x600     [ 9180.518234]  [<ffffffff8103109d>] ? mwait_idle_with_hints+0x5d/0x70     [ 9180.518237]  [<ffffffff8166254c>] machine_check+0x1c/0x30     [ 9180.518239]  [<ffffffff8103109d>] ? mwait_idle_with_hints+0x5d/0x70     [ 9180.518240]  <<EOE>>  [<ffffffff810310e2>] acpi_processor_ffh_cstate_enter+0x32/0x40     [ 9180.518244]  [<ffffffff81399182>] acpi_idle_do_entry+0x10/0x2b     [ 9180.518246]  [<ffffffff813992d8>] acpi_idle_enter_simple+0xaa/0x115     [ 9180.518249]  [<ffffffff8150bd61>] cpuidle_idle_call+0xc1/0x290     [ 9180.518252]  [<ffffffff8101322a>] cpu_idle+0xca/0x120     [ 9180.518255]  [<ffffffff8163fa12>] start_secondary+0xd9/0xdb      So given this information, what is the next step in diagnosing this problem?


title: rsync file copy including files that change

text: I have to copy files between 2 servers using rsync (the network is slow). Can mirroring/ FXP with lftp be used here? Also there will be a continuous flow of files in the source directory & the delta files also need to be copied to the destination directory. Source hostname: ftprepo.armt.com.my, port 23,path: /, user id & password   Destination hostname: 192.168.12.240, port: NA, path: /tmp, user id & password


title: How do you preserve a space in a literal expression in an array value in bash and how to trim down results from a sort command?

text: In the context of searching for expressions in log files, I was wondering generally if there was a way to quantify and qualify the contents of the logs in `/var/log` in some way. In particular, does the lexicon used to describe _error conditions_ correspond to general expectations and does how does the terminology vary across logs. To investigate this further and validate those expectations, I made this little script which checks, counts and sorts a few things:               #!/bin/bash     # Meh - In /var/log, (1) for each file count lines which     # contain matches for expressions in the set; then,      # (2), iterate files again and sort (all) words in a file       # by descending frequency.          FILES="/var/log/* /var/log/**/* /var/log/**/**/*"     WORDS=(error fail.* wrong bad break panic abort.* disaster problem issue 'couldn'\''t' 'didn'\''t' 'wasn'\''t' 'shouldn'\''t' 'isn'\''t' 'don'\''t' "is'\ 'not" 'did\ not' die.* crash.* dump.* seg.* bug.* report.* status)          # Header section 1     printf '%*s\n' "${COLUMNS:-$(tput cols)}" '' | tr ' ' -     printf 'Matches for expressions in set\n'      printf '%*s\n' "${COLUMNS:-$(tput cols)}" '' | tr ' ' -          # (1)     for f in $FILES     do         for w in ${WORDS[@]}          do              echo -n "$f [$w]:"             grep -aci $w $f 2>/dev/null         done     printf '%*s\n' "${COLUMNS:-$(tput cols)}" '' | tr ' ' -     done          # Header section 2     printf 'Sorted occurences for all words in a file\n'      printf '%*s\n' "${COLUMNS:-$(tput cols)}" '' | tr ' ' -          # (2)     for f in $FILES     do         echo "[total number of lines: $(wc -l $f 2>/dev/null)]"         cat $f 2>/dev/null | tr -c '[:alnum:]' '[\n*]' | tr -d '[:digit:]' | sort -f | uniq -ci | sort -fnr         printf '%*s\n' "${COLUMNS:-$(tput cols)}" '' | tr ' ' -     done          exit      However rough and flawed, it achieves the purpose of giving me a glimpse into frequency and validating the set to some extent. For instance here's some sample output for `dmesg`on my system:               /var/log/dmesg [error]:27     /var/log/dmesg [fail.*]:7     /var/log/dmesg [wrong]:0     /var/log/dmesg [bad]:0     /var/log/dmesg [break]:0     /var/log/dmesg [panic]:1     /var/log/dmesg [abort.*]:0     /var/log/dmesg [disaster]:0     /var/log/dmesg [problem]:0     /var/log/dmesg [issue]:0     /var/log/dmesg [couldn't]:2     /var/log/dmesg [didn't]:0     /var/log/dmesg [wasn't]:0     /var/log/dmesg [shouldn't]:0     /var/log/dmesg [isn't]:0     /var/log/dmesg [don't]:0     /var/log/dmesg [is'\]:/var/log/dmesg ['not]:0     <------     /var/log/dmesg [did\]:/var/log/dmesg [not]:14     <------     /var/log/dmesg [die.*]:0     /var/log/dmesg [crash.*]:0     /var/log/dmesg [dump.*]:0     /var/log/dmesg [seg.*]:0     /var/log/dmesg [bug.*]:3     /var/log/dmesg [report.*]:1     /var/log/dmesg [status]:28              [total number of lines: 1059 /var/log/dmesg]           14784              306 usb             220 pci             133 x             128 hub             116 acpi             113 d             109 mem              95 a              94 uhci              76 hcd              76 device              73 bus              56 io              55 to              54 port              54 e              54 ata              53 c              51 power              48 interface              47 registered              46 ehci              40 system              40 for              38 new              37 sda              37 bridge              36 on              36 irq              34 type              34 reset              34 probe              34 nouveau              33 v              33 sd              31 reserved              30 memory              29 f              27 ports              27 found              27 error              27 and              26 resource              26 reg              26 input              26 driver              25 id              25 i              23 window              23 disabled              22 xc              22 status              22 from              22 drm              22 bit              ...      It doesn't come as a big surprise that "error" is the top "problem word" on my setup or that lots of hardware related entries appear in `dmesg`. **Questions**   * How do you preserve the space in the value of the literal expressions made out of two words("is not", "did not") in the array value list? Tried 'did'\040'not' or "did'\ 'not" and many variations. Uncertain as to how to apply the info from this Q&A.   * As the second loop(2) ends up outputting every unique occurrences of a word in a log, how can its scope be restricted or how should I discard:      * the output consisting of single chars?     * the output consisting of single occurrences?   * Are there any recommendations for visually presenting the output, or is there a tool which provides further functionality for either searching or formatting count and word data?


title: How to upgrade Fedora OpenVZ container over SSH?

text: what is the standard procedure for upgrading Fedora (18 to 19) that runs as an OpenVZ container on my VPS via SSH? Can I simply use `fedup` or does the admin have to perform the upgrade from outside of the container via some OpenVZ utils?


title: How to convert from one date format to other format?

text: I have one problem with my date format. I want to change from one format to the other and vice versa. My date formats are Format 1               YYYY-MM-DD      Format 2               MM/DD/YYYY      I want to change format 1 to format 2 and format 2 to format 1 .


title: How to Print certain Fields if a condition is met

text: I have a big Input file as shown below. If "PRIMER_LEFT_NUM_RETURNED" is not equal to 0 then print the corresponding SEQUENCE_ID, SEQUENCE_TEMPLATE,PRIMER_LEFT_NUM_RETURNED, PRIMER_RIGHT_NUM_RETURNED, PRIMER_INTERNAL_NUM_RETURNED, PRIMER_PAIR_NUM_RETURNED, PRIMER_PAIR_0_PENALTY and all the fields which has "_0" in them. Input File:               SEQUENCE_ID=Contig1     SEQUENCE_TEMPLATE=AAGTCGCCCCTCCAT     PRIMER_LEFT_NUM_RETURNED=2     PRIMER_RIGHT_NUM_RETURNED=2     PRIMER_INTERNAL_NUM_RETURNED=0     PRIMER_PAIR_NUM_RETURNED=5     PRIMER_PAIR_0_PENALTY=7.398828     PRIMER_LEFT_0_SEQ=AAGTCGCCCC     PRIMER_RIGHT_0_SEQ=aaaagaca     PRIMER_LEFT_0=0,20     PRIMER_RIGHT_0=69,20     PRIMER_LEFT_0_END_STABILITY=2     PRIMER_RIGHT_0_END_STABILITY=3     PRIMER_PAIR_0_PRODUCT_SIZE=70     PRIMER_PAIR_1_PENALTY=7.78     PRIMER_LEFT_1_PENALTY=1     PRIMER_RIGHT_1_PENALTY=6.7     PRIMER_LEFT_1_SEQ=AAGTCGCCCCTCCA     PRIMER_RIGHT_1_SEQ=aaaagacagagaG     PRIMER_LEFT_1=0,19     PRIMER_RIGHT_1=69,25     PRIMER_LEFT_1_END_STABILITY=3     PRIMER_RIGHT_1_END_STABILITY=3     PRIMER_PAIR_1_PRODUCT_SIZE=70     =     SEQUENCE_ID=Contig31     SEQUENCE_TEMPLATE=ACCCCTTTTT     PRIMER_LEFT_NUM_RETURNED=0     PRIMER_RIGHT_NUM_RETURNED=0     =     SEQUENCE_ID=Contig22     SEQUENCE_TEMPLATE=CCGTCGCCCC     PRIMER_LEFT_NUM_RETURNED=3     PRIMER_RIGHT_NUM_RETURNED=3     PRIMER_INTERNAL_NUM_RETURNED=0     PRIMER_PAIR_NUM_RETURNED=5     PRIMER_PAIR_0_PENALTY=7     PRIMER_LEFT_0_SEQ=AAGTCGCC     PRIMER_RIGHT_0_SEQ=agaGAGTA     PRIMER_LEFT_0=0,20     PRIMER_RIGHT_0=69,20     PRIMER_LEFT_0_END_STABILITY=2     PRIMER_RIGHT_0_END_STABILITY=3     PRIMER_PAIR_0_PRODUCT_SIZE=70     PRIMER_PAIR_1_PENALTY=7     PRIMER_LEFT_1_PENALTY=1     PRIMER_RIGHT_1_PENALTY=6     PRIMER_LEFT_1_SEQ=AAGTCGC     PRIMER_RIGHT_1_SEQ=aaaag     PRIMER_LEFT_1=0,19     PRIMER_RIGHT_1=69,25     PRIMER_LEFT_1_END_STABILITY=3     PRIMER_RIGHT_1_END_STABILITY=3     PRIMER_PAIR_1_PRODUCT_SIZE=73     PRIMER_PAIR_2_PENALTY=7     PRIMER_LEFT_2_PENALTY=1     PRIMER_RIGHT_2_PENALTY=6     PRIMER_LEFT_2_SEQ=AAGTCGC     PRIMER_RIGHT_2_SEQ=aaaag     PRIMER_LEFT_2=0,19     PRIMER_RIGHT_2=69,25     PRIMER_LEFT_2_END_STABILITY=3     PRIMER_RIGHT_2_END_STABILITY=3     PRIMER_PAIR_2_PRODUCT_SIZE=75     =      Expected Output:               SEQUENCE_ID=Contig1     SEQUENCE_TEMPLATE=AAGTCGCCCCTCCAT     PRIMER_LEFT_NUM_RETURNED=2     PRIMER_RIGHT_NUM_RETURNED=2     PRIMER_INTERNAL_NUM_RETURNED=0     PRIMER_PAIR_NUM_RETURNED=5     PRIMER_PAIR_0_PENALTY=7.398828     PRIMER_LEFT_0_SEQ=AAGTCGCCCC     PRIMER_RIGHT_0_SEQ=aaaagaca     PRIMER_LEFT_0=0,20     PRIMER_RIGHT_0=69,20     PRIMER_LEFT_0_END_STABILITY=2     PRIMER_RIGHT_0_END_STABILITY=3     PRIMER_PAIR_0_PRODUCT_SIZE=70     =     SEQUENCE_ID=Contig22     SEQUENCE_TEMPLATE=CCGTCGCCCC     PRIMER_LEFT_NUM_RETURNED=3     PRIMER_RIGHT_NUM_RETURNED=3     PRIMER_INTERNAL_NUM_RETURNED=0     PRIMER_PAIR_NUM_RETURNED=5     PRIMER_PAIR_0_PENALTY=7     PRIMER_LEFT_0_SEQ=AAGTCGCC     PRIMER_RIGHT_0_SEQ=agaGAGTA     PRIMER_LEFT_0=0,20     PRIMER_RIGHT_0=69,20     PRIMER_LEFT_0_END_STABILITY=2     PRIMER_RIGHT_0_END_STABILITY=3     PRIMER_PAIR_0_PRODUCT_SIZE=70     =      I tried to solve it using awk but unable to do it as it is not in the form of Rows and Columns. I would appreciate your help in solving this. Thanks.


title: Only show the lines that are in all textfiles at least once

text: a.txt               cat a.txt     a     b     x     c      b.txt               cat b.txt     d     e     a     f      the q:               SOMEMAGICK *.txt     a      **Q:** how can I show only the lines that are in all *.txt files?


title: How does "groupinstall" work ? ( How to convert a group-install to a regular multi yum install <package> -y ? )

text: I would like data on how to replicate the same exact outcome for               yum groupinstall "Printing client"      without running that command but rather run               yum install <package> -y      perhaps multiple times. i understand i can get the name of each package via yum groupinfo "Printing client" but which ones are suppose to be installed given that it lists 3 different categories : Mandatory, Default, and Optional Packages. how can one know how to install them in a "orderly fashion" using                yum install      so that it replicates the same exact outcome as the original                yum groupinstall "Printing client" ?


title: Repartitioning harddisk

text: Saturday I have to repartition my HDD. On my server I have 72GB HDD space which is not very much. Currently my system is partitioned as follows: **Partition size:**               Filesystem            Size  Used Avail Use% Mounted on     /dev/mapper/vg_web-lv_root                            50G  5.8G   41G  13% /     tmpfs                 1.9G   16K  1.9G   1% /dev/shm     /dev/cciss/c0d0p1     485M   93M  367M  21% /boot     /dev/mapper/vg_web-lv_home                            14G  8.7G  4.1G  68% /home      **Inodes:**               Filesystem            Inodes   IUsed   IFree IUse% Mounted on     /dev/mapper/vg_web-lv_root                             3.2M    125K    3.1M    4% /     tmpfs                   179K       5    179K    1% /dev/shm     /dev/cciss/c0d0p1       126K      50    125K    1% /boot     /dev/mapper/vg_web-lv_home                             869K    559K    311K   65% /home      I want to increase the /home directory with ± 20 - 30 GB and I want to decrease the root directory (/). My server did already ran out of Inodes before I wiped a directory with 340.000 files. I get ± 15.000 small 1kb files a day. Now I want to be sure that I don't get any issues saturday. Should I reinstall/format my harddisc and reinstall the system? Or should I repartition the harddisc and or how to do this?


title: RAID resyncing automatically?

text: I rather randomly checked the status of my RAID arrays with `cat/proc/mdstat` and realized, that one of my arrays seems to be resyncing:               md1 : active raid1 sdb7[1] sdc7[0]           238340224 blocks [2/2] [UU]           [==========>..........]  resync = 52.2% (124602368/238340224) finish=75.0min speed=25258K/sec      Why is this and what does it mean? I seemingly can access the mount point just fine with `r/w` permissions. **EDIT 1** (in response to **SLM's ANSWER** ) I can't really see anything if I `grep` through `dmesg` and the `\--detail` switch doesn't tell me much either, i.e. it displays that the resync is in progress... but no hint for the reason or why it might have gotten out of sync... - I guess I might just need to keep an eye on it before I start swapping out my hardware.


title: Email file attachment from command line

text: I want to email the file returned by the following command as an attachment (on RHEL/CentOS):               ls -1 $(hostname -s)*.xml | tail -n 1      For example, the command above returns `server-20140430080511.xml` and I want to then email that file to a recipient from the command line, all done in the one command (on one line) so that we can script/automate this process. Can anyone suggest how to do this on a single line?


title: How do I `yum localinstall` from my `yum search` result?

text: I'm trying to install some dependencies for `thrift` using `yum`. I've found, for example boost via `yum search boost` which gives me (after a load of fails as the PC not on the web, but has a local repository somewhere...on the network...I think): `boost.x86_64 : The free peer-reviewed portable C++ source libraries` But when I go to try `yum localinstall boost*` I get nothing ' _file does not end with RPM, skipping_ ', likewise `find boost*` gives nothing. Should my yum command work, and this is a sign that it's not on the network? Or is it on there and I'm not using the right command to find the path to the rpm for it? _Bottom line:_ How can I use yum to install a local file I found using `search`? ### Edit: I should mention, running `yum install boost*` fails as I cannot get on the web. This still leaves me wondering: The `yum search` result is not local (as per Ignacio's comment), and it's not installed (`whereis` and `which` are drawing up blanks, as is `locate`) nor can I even reach a repo. So what is `yum search` finding, and how do I install it?


title: How to create auto vote script using `expect`?

text: I'd like to test auto-vote protection on my site (not published yet). I've found Expect program, but I can't get it working with telnet http.


title: Execute a command before shutdown

text: I want to execute a simple command just before the computer shuts down (timing is not essential). For startup I can use /etc/rc.local - is there something similar for shutdown? Note that I would still like to use the integrated shutdown button from menu; i.e. I don't want to use a custom script everytime I shutdown via terminal - it needs to be automatical.


title: Changing host file in Ubuntu

text: I tried to change `/etc/hosts` to change a local DNS entry, so I can map any website name to any IP, but it isn't working. How can I debug it?


title: in which units does tar --checkpoint measure?

text: GNU `tar` offers the option `\--checkpoint` where a message should be printed each `checkpoint`reached. **Question:** : In what does `\--checkpoint` measure? My best guess is Bytes. I wasn't able to find a hint in the `man` nor the `info` nor in GNU's documentation on `tar`. The OS is Linux, I use Bash and I use `tar (GNU tar) 1.26`


title: login prompt not displayed after boot

text: On my Arch linux (x86-64) I use default login prompt (agetty + login), then after login X is automatically started by bash profile. After an update this weekend the login prompt from both agetty and login is not displayed. I tried   1. putting `\--noreset --noissue` to /etc/inittab: `c1:2345:respawn:/sbin/agetty --noclear --noissue -8 -s 38400 tty1 linux`   2. putting `read` to /etc/rc.local actually I put `echo "Press enter"` before `read`, but it is not displayed as well   3. disabling all modules and daemons in `rc.conf`   4. disabling `vga=...` argument in `/boot/grub/menu.lst` but nothing helped. Just after the `processing UDev events` messages are printed, something resets the screen and nothing is visible. Looking into `/etc/rc.sysinit` I found out that after udev, LOCALE is set and then `systemd-vconsole-setup` is called. When I insert my login and password (nothing visible), X starts normally. Ctrl+Alt+F1 works after X is started, not before. My graphic card is Intel X3100. I have `intel-dri`, `xf86-video-i740`, `xf86-video-intel` and `lib32-intel-dri` installed.


title: Problem with NFS after changing the IP address to static

text: I have a `NFS server` from which I mount the `/home` directories to the remaining `NFS clients` in the lab. The `NFS server` is `xxx3` which has all the home directories for the remaining machines. The contents of `/etc/exports` file in the `xxx3` machine is as below.               /home           xxx*(rw,sync)      The contents of the `/etc/fstab` file in the `xxx3` machine is as below.               xxx-server1:/mounts/xxx-server1       /mounts/xxx-server1    nfs     soft,rw 0       0     xxx-server2:/mounts/xxx-server2       /mounts/xxx-server2    nfs     soft,rw 0       0     xxx-server3:/mounts/xxx-server3       /mounts/xxx-server3    nfs     soft,rw 0       0      The remaining machines are named `xxx-server1`, `xxx-server2`, `xxx-server3`. Normally, if I do `mount -all` command, the `/home` directories from the `xxx3` machine will be mounted on the respective servers. I believe after changing the IP address to static I have problems in mounting the home directories. I suspect the IP address change has only triggered the problem. Now, if I do `mount -all`, I get `nfs.internal` error. **EDIT** I see there are no entries for _portmap, lockd, mountd, rquotad and statd_ in the `/etc/hosts.allow` file and `/etc/hosts.deny` file. I am sure that if I add these entries the mount will happen again (currently, I am not able to test it since I do not have access to these boxes). But my question is, when it was `dhcp` how did the NFS work?


title: Make disk/disk copy slower

text: Is there a method of slowing down the copy process on Linux? I have a big file, say 10GB, and I'd like to copy it to another directory, but I don't want to copy it with full speed. Let's say I'd like to copy it with the speed of 1mb/s, not faster. I'd like to use a standard Linux `cp` command. Is this possible? (If yes, how?) **Edit** : so, I'll add more context to what I'm trying to achieve. I have a problem on the ArchLinux system when copying large files over USB (to a pendrive, usb disk, etc). After filling up the usb buffer cache, my system stops responding (even the mouse stops; it moves only sporadically). The copy operation is still ongoing, but it takes 100% resources of the box. When the copy operation finishes, everything goes back to normal -- everything is perfectly responsive again. Maybe it's a hardware error, I don't know, but I do know I have two machines with this problem (both are on ArchLinux, one is a desktop box, second is a laptop). Easiest and fastest "solution" to this (I agree it's not the 'real' solution, just an ugly 'hack') would be to prevent this buffer from filling up by copying the file with an average write speed of the USB drive, for me that would be enough.


title: HDD no longer able to mount after editing /etc/fstab

text: I have an SSD which holds / and my home directory, but I also have a 1TB HDD with most of my music on. I tried to edit /etc/fstab to automatically mount the HDD to save me time. I am running Kubuntu. I opened KDE Partition Manager to check the type of the filesystem and it read ext3 The line I added read:               /dev/sda /media/HDD ext3 defaults 0 2      On rebooting, an error appeared under 'Kubuntu' on the boot screen saying that the filesystem couldn't mount so I hit S to skip attempting to mount. Running `sudo blkid` shows:               /dev/sda1: LABEL="HDD" UUID="00000000-dba3-409e-a185-345c60459125" TYPE="ext2"      /dev/sdb1: UUID="44cdc69c-0746-4a99-9c48-ccf7fca69768" TYPE="ext4"      /dev/sdb5: UUID="478bf04c-8bf6-46c4-86e8-e844380cf8e7" TYPE="swap"       I can remember when I created the partition originally, I didn't set it to ext2 (even though this was ~2 years ago) I attempted a couple more times with different options (changing defaults to other commands rw,async,auto...). The HDD will no longer mount. When opening in dolphin, the message reads: > An error occurred while accessing 'Home', the system responded: The > requested operation has failed: Error mounting /dev/sda1 at > /media/myname/HDD: Command-line `mount -t "ext2" -o > "uhelper=udisks2,nodev,nosuid" "/dev/sda1" "/media/myname/HDD"' exited with > non-zero exit status 32: mount: wrong fs type, bad option, bad superblock on > /dev/sda1, missing codepage or helper program, or other error In some cases > useful info is found in syslog - try dmesg | tail or so KDE Partition Manager says the type is unknown. Clicking 'properties' shows it as unformatted `fdisk -l` gives the following:                   Disk /dev/sda: 1000.2 GB, 1000204886016 bytes         255 heads, 63 sectors/track, 121601 cylinders, total 1953525168 sectors         Units = sectors of 1 * 512 = 512 bytes         Sector size (logical/physical): 512 bytes / 4096 bytes     I/O size (minimum/optimal): 4096 bytes / 4096 bytes     Disk identifier: 0x000819ae          Device Boot      Start         End      Blocks   Id  System     /dev/sda1              63  1953520064   976760001   83  Linux     Partition 1 does not start on physical sector boundary.          Disk /dev/sdb: 128.0 GB, 128035676160 bytes     255 heads, 63 sectors/track, 15566 cylinders, total 250069680 sectors     Units = sectors of 1 * 512 = 512 bytes                         Sector size (logical/physical): 512 bytes / 512 bytes          I/O size (minimum/optimal): 512 bytes / 512 bytes     Disk identifier: 0x0001a3c6                                              Device Boot      Start         End      Blocks   Id  System     /dev/sdb1   *        2048   233330687   116664320   83  Linux     /dev/sdb2       233332734   250068991     8368129    5  Extended     /dev/sdb5       233332736   250068991     8368128   82  Linux swap / Solaris      Attempting to mount gives the error               ~ $ sudo mount /dev/sda /media/HDD     [sudo] password for myname:      mount: wrong fs type, bad option, bad superblock on /dev/sda,        missing codepage or helper program, or other error        In some cases useful info is found in syslog - try        dmesg | tail  or so      `dmesg | tail` says:               [ 5632.049404] EXT2-fs (sda): error: ext2_check_descriptors: Block bitmap for group 880 not in group (block 0)!     [ 5632.049411] EXT2-fs (sda): group descriptors corrupted     [ 5669.867629] EXT2-fs (sda): error: ext2_check_descriptors: Block bitmap for group 880 not in group (block 0)!     [ 5669.867632] EXT2-fs (sda): group descriptors corrupted     [ 6894.395961] EXT2-fs (sda1): error: can't find an ext2 filesystem on dev sda1.     [ 7040.625599] EXT3-fs (sda1): error: fragsize 1024 != blocksize 4096 (unsupported)     [ 7045.462213] EXT2-fs (sda1): error: can't find an ext2 filesystem on dev sda1.     [ 7048.975278] EXT4-fs (sda1): VFS: Can't find ext4 filesystem     [ 7421.551590] EXT2-fs (sda1): error: can't find an ext2 filesystem on dev sda1.     [ 7451.874417] EXT2-fs (sda1): error: can't find an ext2 filesystem on dev sda1.      strace:               $ strace -s 2000 -o mount.log blkid          /dev/sda1: LABEL="HDD" UUID="00000000-dba3-409e-a185-345c60459125" TYPE="ext2"      /dev/sdb1: UUID="44cdc69c-0746-4a99-9c48-ccf7fca69768" TYPE="ext4"      /dev/sdb5: UUID="478bf04c-8bf6-46c4-86e8-e844380cf8e7" TYPE="swap"       /proc/filesystems:               $ cat /proc/filesystems     nodev   sysfs     nodev   rootfs     nodev   bdev     nodev   proc     nodev   cgroup     nodev   cpuset     nodev   tmpfs     nodev   devtmpfs     nodev   debugfs     nodev   securityfs     nodev   sockfs     nodev   pipefs     nodev   anon_inodefs     nodev   devpts             ext3             ext4     nodev   ramfs     nodev   hugetlbfs             vfat     nodev   ecryptfs             fuseblk     nodev   fuse     nodev   fusectl     nodev   pstore     nodev   mqueue     nodev   binfmt_misc             ext2             udf


title: Questions about behaviour of running LiveCD Linux after unmounting a CD-ROM

text: Could anyone explain what happens in system after unplugging CD-ROM during working with LiveCD session? Suppose that I'm using Ubuntu LiveCD and suddenly by accident the CD-ROM disconnect for a matter of second because of for example power outage in the case of external devices or just opening the CD tray if the OS allows to do it. Assume that after a while the CD-ROM is pluged in again. Can anyone explain what exactly happens then, why the OS stops or rather is working but not as before it and how, if it's possible, the stability and usefullness can be brought back and user can continue working with? According to my observations based on Ubuntu LiveCDs (versions under 12, the kernel version is probably 2.6.XX) the system reaction is like following:   * all applications in X desktop disappear (I think it's due to automatic sending a kill signal to all processes as if the OS wanted to shut down but actually it seems to wait for something) and it looks like only the background image with the cursor which can be moved all the time   * all TTYs are avaible and can be displayed but there are only error messages there like `INFO: task <process name>:<pid> blocked for more than 120 seconds` and `SquashFS error: unable to read [...]`   * all the time I can see blinking '_' and I can type something but pressing enter just make it skipped to the new line and obviously the OS doesn't execute it   * terminal's shortcuts for canceling and quit current process also don't work   * magic SysRq combinations are generally working and I can see the actual output but I don't know which of them would be useful in this case Can anyone explain this reaction and tell what exactly these errors mean? And what can one do then to fix it - is there any way for that and why not, if so? Here: What does "INFO: task XXX blocked for more than 120 seconds" exactly mean on Linux? I've just read that "if a task is blocked, it waits for resources to become available again". So if I got it correctly it's waiting for resources - is it true or just wrong interpretation and it will wait endlessly - CD-ROM is surely pluged in again as fast as possible. How to understand it? I know that processes are gone (or "blocked" as error messages are suggesting?), but how about files in the ramdisk, are they still there untill reboot? Is this possible to access them somehow? Or for example just extract text strings and so on? **There is a magic SysRq shourtcut which remount filesystems - are there any chances that it would help in such situations or should be tried eventually at the end after other trials? If the CD is working as a virtual fs, what effects can bring remountig filesystems in that case?** * * * @bersch: It's surely a real situation - rare but possible. It happened to me so it happens and I just consider what should or actually what can I do next time - I like to understand things happen around me. It can happen when you're using for example a server machine with UPS and no optical drive or just laptop or netbook with battery power supply and with no CD-ROM built in and in both cases you have to use external CD-ROM connected to wall power supply to run LiveCD. I know that it's possible to boot through network or just use USB stick instead of CD but somethimes using LiveCD is necessary and irreplaceable. So just imagine what happen when in such circumstances there is a power outage and what's the effect of that: the computer - I mean all harware except CD-ROM is still powered on and working well due to UPS or battery but CD-ROM is already not so. It's rare because it's obviously impossible when you're using a standard laptop with CD-ROM inside which would be all the time powered as well as the rest of hardware from battery in such situation or standard pc which would shut down when the power is off the same as CD-ROM because of sharing a source of power supply and it can happen accidentally only in mentioned above cases. I really don't know why developers didn't predict it and did not include any solution for such eventualities. It's untypical but still possible and questions are not about only a hypothetical situation. I would really like to know what then exactly happen in the system and how it's woring in this state: what's working and what's not, what can be done, if filesystem with files still exsists on ramdisk, if it can be restored, if processes are blocked or killed and so on - generally speaking how it works. Where can I find out some more about it?


title: How to limit number off ssh login attempts per time interval

text: I am trying to limit number of ssh login attempts per time period. How might I do that? I have something like (in shorewall's rules)               #ACTION         SOURCE          DEST            PROTO   DEST    SOURCE     MARK     #                                                       PORT    PORT(S)          ...     Limit:info:SSHA,3,180   net     all     tcp     22      But it doesn't seem to work


title: Desktop freezes, how to troubleshoot.

text: I am running Linux Mint Debian Edition (Cinamon desktop). Since a recent upgrade it crashes quite a lot. Well the desktop sort of stops responding. The mouse still moves a pointer on screen, but nothing else seems to update. I can go to a virtual terminal, and kill of various programs, (firefox for example), but switching back to the desktop, the firefox icons remain in the panel. The rest of the display seems frozen to whatever it was when the "crash" occurred. How do I go about troubleshooting this? There are various log files. Which ones should I be looking at? What sort of thing should I be looking for?


title: udisks2: permission denied

text: When I mount blank btrfs partition in Dolphin, I get "Permission denied" on write. You can see that it's mounted on /run/media/%username% dir which is correct, but owner is root.               [doctor@doctoror doctor]$ pwd     /run/media/doctor     [doctor@doctoror doctor]$ ls -l     total 4     dr-xr-xr-x 1 root root 0 січ  1  1970 Home     [doctor@doctoror doctor]$ mkdir Home/tmp     mkdir: cannot create directory ‘Home/tmp’: Permission denied


title: Skype error in ubuntu 10.10

text: I am using Ubuntu 10.10 version. Recently i am finding this error. When i used to close the skype client then it used to go up to the desktop. ( The above panel where time and date are generally displayed.) Now when i am closing it get's closed and i don't know where it's located. Then when i try to sign in again it says Another Skype version is running. Any ideas on how to rectify this.


title: Emacs text-scale-adjust causes line numbers column to incrementally shrink and disappear

text: I've set up _emacs_ to display line numbers `(global-linum-mode 1)`, and it works until I start enlarging the text via `text-scale-adjust` The line numbers column starts to shrink, and disappears entirely after a few increments.   When it has fully disappeared, further increments have no more effect on the left edge. Is this a know issue? Is there a workaround? Using GNU Emacs 23.1.1 in Ubuntu 10.04 (and I'm an _emacs_ newb).


title: NFS permissions and slow copy

text: I have an NFS share on an OpenBsd server. When I assess the share from my Ubuntu box I don't seem to have all permission eg write. Also copying a file from the NFS share to the Ubuntu machine can take > 1 hour for a 44mb file. Any suggestions? I exported the share through `/etc/exports`:               /home/some_user/downloads -alldirs -maproot=some_user -network=192.168.5.0 -mask=255.255.255.0      And mounted the share the following.               sudo mount 192.168.5.60:/home/some_user/downloads ~/test


title: How to stop regular users from Switching Users

text: I want to stop the normal users from using following commands   1. /bin/bash   2. /usr/bin/sudo   3. /bin/su I added them in sudoers file but normal user can still use the following command This is how i add the entry in Sudoers File Cmnd_Alias NOTALLOWED = /bin/sh,/bin/bash,/usr/bin/sudo,/bin/su Only /bin/bash is working otherthan this sudo and su are not working and users are able to switch


title: Fastest RDP client on linux

text: I currently use KRDC on CentOS, but mouse pointer is a little slow and I'm sure that this is not caused by my internet line speed, because the windows RDP client works and everything is fine. Which RDP client is the fastest on CentOS (or any other Linux OS)?


title: When Adding IPs with ifconfig eth:xx, how do I in one line find the highest eth:xx

text: This will be in a Perl script I need to grab that number and increment it by one for the new IPs. Any one have a one liner for me? Can be Bash/Perl. _edit_ Given the following input.               inet xx.182.137.90/29 brd xxx.182.137.95 scope global eth0     inet xxx.182.137.91/24 brd xxx.182.137.255 scope global eth0:1     inet xxx.182.137.92/24 brd xxx.182.137.255 scope global secondary eth0:2     inet xxx.182.137.93/24 brd xxx.182.137.255 scope global secondary eth0:3     inet xxx.182.137.94/24 brd xxx.182.137.255 scope global secondary eth0:4      It should spit out 4. Given what you gave me below               $ ip addr | grep -e 'eth[0-9]:[0-9]' | cut -d: -f2      If you change your answer to this I will accept it because it helped me get this.


title: What is the difference between OUTPUT and FORWARD chains in iptables?

text: CentOS 6.0 I'm studying iptables and am getting confused on the difference between FORWARD and OUTPUT chains. In my training documentation, it states: > If you're appending to (-A) or deleting from (-D) a chain, you'll want to > apply it to network data traveling in one of three directions: > >   * INPUT - All incoming packets are checked against the rules in this > chain. >   * OUTPUT - All outgoing packets are checked against the rules in this > chain. >   * FORWARD - All packets being sent to another computer are checked against > the rules in this chain. > This confuses me because, in my mind, packets leaving for a host WOULD be outgoing. So are there scenarios where a packet would be going to another computer but NOT be "outgoing"? How would iptables distinguish between the two?


title: Sinhala Unicode (Wijesekara keyboard) in iBus on Ubuntu 14.04 not working

text: I tried to install Wijesekara keyboard layout on my Ubuntu 14.04. I used this method to install it, but it threw this error: > Package ttf-sinhala-lklug is not available, but is referred to by another > package. This may mean that the package is missing, has been obsoleted, or > is only available from another source However the following packages replace > it: fonts-lklug-sinhala E: Package 'ttf-sinhala-lklug' has no installation > candidate


title: User created without a password behaves as if he had one

text: Inside one of my scripts, I created an user based on a directory arrangement on another machine. The thing is that this user, created without a password, behaves just as he had one : he has sudo rights but I simply can't sudo because it asks for a password that **doesn't exist**. I know I could simply passwd him as root, but the devised system has to work without intervention from local root privileged users. I also cannot passwd as the user in question since passwd asks me for the **same inexistant password.** I suppose that it is intended behavior, but then what is the eventual default password and what can I do to circumvent this ? EDIT : Here is what the script does : 1: it rsyncs the home directories of the users who should be created or updated in /opt/sshgw/home (sshgw means ssh gateway) from our ssh gateway machine 2: it removes all authorized keys for every user of the machine running the script 3: it removes every user from the wheel group and **performs usermod -L** (I am not the author of the script and I do not really know why he locks the account, but whatever.) Though keep in mind that at this point only **existing** users are modified. 4: It creates users if they have been retrieved from the sshgw and they are not present on the local machine, then, if specified, they are added the wheel group. It then adds their public keys to their proper home directories **and finally performs usermod -U**. The user's entry in /etc/passwd is normal. Upon calling passwd, the users gets asked his current password (which can not exist for a user who has just been created without a password, mind you) in this fashion :               [splatpope@monitor sshgw]$ passwd     Changing password for user splatpope.     Changing password for splatpope.     (current) UNIX password:      I guess the culprit is usermod -U.


title: While connecting to hidden SSID, Supplicant PAE state=HELD

text: ### Here details of my Wireless network   1. hidden SSID (non-broadcast)   2. The authentication protocol used is PEAP, which is a username and password protocol.   3. The username and password are passed between the client and authentication server (RADIUS) over an SSL encrypted session.   4. 3-tier CA environment. Root (offline), intermediate (offline), and 2 issuing CA certificates (online The actual SSL certificates on the authentication servers (RADIUS) will come from on of the 2 issuing CAs. That enables a trusted SSL session to be established to pass the username and password. But I haven't had the need to add those certificates to wpa_config.   5. MS-CHAPv2 Support ### My wpa_supplicant.conf **NOTE:** this used to work for 6 months, but doesn't anymore since a couple of days ago.               /etc/wpa_supplicant.conf          ctrl_interface=/var/run/wpa_supplicant     ctrl_interface_group=wheel     ap_scan=1     update_config=1     fast_reauth=0          network={       priority=1       mode=0       ssid="hidden-ssid"       scan_ssid=1       proto=RSN       key_mgmt=WPA-EAP       eap=PEAP       identity="user"       password="[FILTERED]"     }      ### When it worked I use to have this status:               [root@machine ~]# wpa_cli status     Selected interface 'wlan0'     bssid=00:48:00:12:0a:9d     ssid=hidden-ssid     id=0     pairwise_cipher=CCMP     group_cipher=TKIP     key_mgmt=WPA2/IEEE 802.1X/EAP     wpa_state=COMPLETED     <==============     ip_address=10.75.9.32     Supplicant PAE state=AUTHENTICATED <===     suppPortStatus=Authorized     EAP state=SUCCESS     selectedMethod=25 (EAP-PEAP)     EAP TLS cipher=AES128-SHA     EAP-PEAPv0 Phase2 method=MSCHAPV2      ### But now, for yet an undiscovered reason, the authentication doesn't complete. > wpa_state goes : ... => ASSOCIATED => SCANNING ==> ASSOCIATING => ASSOCIATED > => SCANNING => etc ...                # wpa_cli status      Selected interface 'wlan0'      bssid=34:a8:4e:1f:ad:2d      ssid=pmwproc      id=0      pairwise_cipher=CCMP      group_cipher=TKIP      key_mgmt=WPA2/IEEE 802.1X/EAP      wpa_state=ASSOCIATED         <==== Associated with Access point but ....      ip_address=0.0.0.0      Supplicant PAE state=HELD    <==== PAE state is HELD instead of AUTHENTICATING or AUTHENTICATED      suppPortStatus=Unauthorized      EAP state=FAILURE            <==== Failure      selectedMethod=25 (EAP-PEAP)      EAP TLS cipher=(NONE)      **MY QUESTION:** What is the PAE state and why once ASSOCIATED does the PAE state is become HELD?


title: Ubuntu Software Raid5 - /dev devices changed, will mdadm raid break

text: I had a major server failure. The OS is fine and back up and running. Before I plug my raid drives back in and try and mount it I need to ask this simple question. The drives that originally mapped /dev/sda(b/c) are unknown to me. I have no idea of knowing which drive in the raid was /dev/sda to the OS. If I connect them in the wrong order will mdadm figure this out or will I break the raid?


title: How to add a read only group permission to a folder that already has a default group, and have it inherited for all newly created files & folders?

text: In Windows this is easy. I never fully figured out Linux permissions, I have a directory such as this: **/Photos** The current ACL permissions are as follows:               owner: root - full access     group: photos -full access     everyone: no access      the **photos** group currently has full access. But I would like to add an additional group that have read only access, called **readOnlyPhotos** , without enabling read access to "everyone". That is, I want that folder to be inaccessible to anyone except for people who are either in **photos** group (who get full access) or **readOnlyPhotos** group (who get read only access). Also any new files and folders that get created in the **/Photos** folder should inherit these default permissions. How can I configure the permissions on the **/Photos** folder to achieve this effect?


title: Copying all files from one directory to all directories under same parent directory

text: I have one parent directory /home/test and under that directory I have multiple directories. The names are server{1..10} and one of them server3 has few files which I have copied from remote server. I tried to use cp but it's not working for me. Is there a way to copy all files or one file from server3 directory to rest of the server directories under /home/test.


title: Relation between "Block Size"and "Upper Limits" in ext2

text: A similar looking question asks for the reason why the upper file limit could be 2 TB in `ext2`. I am trying to understand but the Documentation on `ext2` but find this hard. Please correct me if I'm wrong:   * Blocks can be 1 - 4 KB in size   * available amount of blocks is based upon a 32-Bit value: 232 = 4.294.967.296 blocks In the documentation I found: 231-1 = 2.147.483.647 addressable Blocks. I miss 2.147.483.649 Blocks. My **guess** is that this is »reserved« for the _Superblock_ , the _Block Group Descriptors_ , their backups etc. (correct?) ## Question **How exactly are the file size limits calculated in`ext2`** And, just in advance: Is - and if so - how far can this be translated to `ext3` and `ext4` (or other file systems… please?) - I'm still far from them and not lazy to look this up myself; just confused about where the basics come from.


title: CentOS Strange Adobe Flash Problem

text: I have a CentOS release 6.5 (Final) Kernel 3.10.40-1.el6.elrepo.x86_64 with Adobe Flash problem. "Firefox ESR 24.6.0 "and "Chromium 31.0.1650.63 Built from source is CentOS release 6.5 (Final)" presents this: When I open the YoutTube, the flash works only once, both in firefox and in Chomium, and the second time I try to view a video, it does not work. My version of the Adobe Flash Player - Version: 11.9.900.170 The error message that appears in both browsers is that just do not have flash installed. It makes no sense, because it worked once. After reboot CentOS, I can see a single video again, and the error repeats ... Anyone have any idea how to solve? I searched forums, and like my problem, no solution. Thanks.


title: How can I reverse the effect of apt-get build-dep <package>?

text: When I run:               apt-get build-dep <package>      privileged it installs the build dependencies for `<package>`. Now, I know that I can use `apt-cache depends <package>` to see _binary_ dependencies. I haven't found any way to show the same information for _build dependencies_ in a single command invocation, which I could then use to achieve what I want. So, how can I reverse the effect of a `apt-get build-dep <package>`, i.e. remove the packages previously installed by an invocation of that command? * * * Braiam's answer below yields for the packages that are build dependencies:               autotools-dev     debhelper     dpkg-dev     libexpat-dev     libgd2-noxpm-dev     libgeoip-dev     liblua5.1-dev     libmhash-dev     libpam0g-dev     libpcre3-dev     libperl-dev     libssl-dev     libxslt1-dev     zlib1g-dev      The packages the complete `apt-get autoremove` wants to remove are:               build-essential debhelper dpkg-dev libpcre3-dev libpcrecpp0 libssl-dev zlib1g-dev      Especially `build-essential` isn't desirable here, but I can fix that on my own. The actual list of packages that got installed were:               debhelper     dh-apparmor     gettext     html2text     intltool-debian     libcroco3     libgettextpo0     libpcre3-dev     libpcrecpp0     libssl-dev     libunistring0     po-debconf     zlib1g-dev


title: Sound crackles and echos to the point of being unusable

text: I recently got a new desktop, installed debian 64 bit, and found out that the sound doesn't work at all. I'm not entirely sure what information I should give to help identify the problem but I'll do my best... The motherboard provides the sound, an Asus Z97 A, which has a Realtek ALC892 chip for sound. I tried editting /etc/pulse/default.pa to add tsched=0. I also tried adding default-sampling-rate = 48000 to /etc/pulse/daemon.pa. And I also tried running as admin and adding myself to the audio group. None of that helped. I also tried upgrading my kernel using wheezy backports from 3.2 to 3.14. It changed what weird sound I heard instead of the correct sound, but didn't actually help. I also tried adding the line `snd-hda-intel vid=8086 pid=8ca0 snoop=0` to /etc/modules and /etc/modprobe.d/fix-audio.pref (alternately, not both together). Right now I'm running kernel version 3.12, because my video card driver doesn't support 3.14, and 3.2 spat out errors about the hda-codec on bootup. 3.12 got rid of the errors, but sound still doesn't play properly. In BIOS I changed the frontport audio from hd audio to AC97. This made it so that I can actually hear the sound I'm playing, not just garbled junk, but it still crackles and echos. The sound is much better in chrome than in the default player for .mp3 files, which seems to simply be called movie player.


title: Make minimal linux disk live

text: I was wondering if anyone had a minimal Linux system with nothing but the bare minimum to boot. Is there any tutorials on the web, I couldn't seem to find any.


title: Can't change keyboard settings on Fedora 16

text: I want to swap the `Ctrl` and `Caps Lock` keys on my keyboard. I go to `System Settings -> Keyboard -> Layout Settings -> Options` and check `Swap Ctrl and Caps Lock` under `Ctrl Key Position`. I check that my keyboard ( English US) has the new key bindings. However, when I exit settings, the keybindings switch back to default. How can I make my custom settings stay? I don't see a "Save" button anywhere.


title: "[unixODBC][Driver Manager]Data source name not found, and no default driver specified" when connecting to OracleDB using ODBC

text: I am trying to make an odbc connection to an oracle db from linux. When I login as root, it works. My root profile is as below:               more ~/.profile     export ODBCINI=/etc/unixODBC/odbc.ini     export ODBCSYSINI=/etc/unixODBC      However, when I login as a regular user, I cannot do an odbc connections. I get this error:               [RODBC] ERROR: state IM002, code 0, message [unixODBC][Driver Manager]Data source name not found, and no default driver specified      I am not sure what is the problem here but I thought maybe I make root profile available to other users it may solve my problem. How do you present root profile to all of the other users? Any ideas what might be happening here? Additional info: this is my tnsnames.ora file looks like:               Data =       (DESCRIPTION =         (ADDRESS_LIST =           (LOAD_BALANCE = off)           (FAILOVER = ON)           (ADDRESS = (PROTOCOL = TCP)(HOST = server1.example.com )(PORT = 1521))         )         (CONNECT_DATA =           (service_name = Data)         )       )      this is what odbc.ini:               [Data]     Driver=Oracle     Description=Test     Trace=Yes     ServerName=//server1.example.com:1521/     Database=test      and this is ondbcinst.ini               [Oracle]     Description = Oracle ODBC Connection     Driver = /opt/oclient/instantclient_12_1/libsqora.so.12.1     Setup =     FileUsage =


title: Mounting external drive does not work anymore

text: ~$ dmesg | tail     [  479.558062] usb 1-1: SerialNumber: S07F1601A00000090095     [  479.559231] scsi7 : usb-storage 1-1:1.0     [  480.557093] scsi 7:0:0:0: Direct-Access     Ext Hard  Disk                 PQ: 0 ANSI: 4     [  480.558308] sd 7:0:0:0: Attached scsi generic sg1 type 0     [  480.559916] sd 7:0:0:0: [sdb] 3907029168 512-byte logical blocks: (2.00 TB/1.81 TiB)     [  480.560421] sd 7:0:0:0: [sdb] Write Protect is off     [  480.560426] sd 7:0:0:0: [sdb] Mode Sense: 10 00 00 00     [  480.560793] sd 7:0:0:0: [sdb] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA     [  480.573472]  sdb: sdb1     [  480.575421] sd 7:0:0:0: [sdb] Attached SCSI disk      If i click on the HDD in nautilus I get this error:               Error mounting: mount exited with exit code 1: helper failed with:     Unprivileged user can not mount NTFS block devices using the external FUSE     library. Either mount the volume as root, or rebuild NTFS-3G with integrated     FUSE support and make it setuid root. Please see more information at     http://tuxera.com/community/ntfs-3g-faq/#unprivileged      Any help?


title: How do I configure my graphics drivers?

text: I'm running Linux Mint 9 gnome on a Toshiba Satellite A105-S4211 With this, inxi -G Graphics: Card Intel Mobile 945GM/GMS 943/940GML Express Integrated Graphics Controller X.Org 1.7.6 Res: 1280x800@60.0hz GLX Renderer Mesa DRI Intel 945GM GEM 20091221 2009Q4 x86/MMX/SSE2 GLX Version 1.4 Mesa 7.7. And I want to know how to configure the monitor/graphic/video/driver/gamma settings. What I really want to do is change the gamma settings on my computer. I was told that I can do this using the video card driver. I want to know how to do that.


title: What is the difference between root and superuser?

text: Do they refer to the same thing or is root just a location in filesystem (its ultimate base) and superuser a privileged user (sort of equivalent of windows administrator account) ? Do they need the same password ? Is superuser the kernel itself?


title: LUKS storing keyfile in encrypted usb drive

text: I already asked once about LUKS unlocking of multiple HDDs in Linux: LUKS and multiple hard drives. Now I would like to know how to secure store the keyfile used for the automatic unlock of the associated partitions. My plan is (if possible):   * Encrypt a small USB drive with LUKS that requires a passphrase   * Unlock it at boot as the first drive by using the passphrase   * Mount it to a given mount point, for instance /test (is this possible ?)   * Now the keyfile can be safely read: /test/keyfile   * Use the keyfile to unlock other drives without needing to ask password for them   * LuksClose the USB drive in order to assure a certain degree of safety as soon as other drives have been unlocked   * Automount /, /usr, /var and other mount-points as usual Can this work? Basically I store the LUKS keyfile on a password-encrypted LUKS USB drive that only asks for passphrase once, while all other drives can be unlocked without further action. I'm not sure if there is some way to make the USB drive be unlocked first, then be mounted and only then the other drives try to access the keyfile. Furthermore in what concerns automation I suppose /etc/fstab and /etc/crypttab should be accessible BEFORE the other drives can be mounted, but this is not possible if the whole / file system is LUKS encrypted. Unless there is the possibility of **fully manually configure how LUKS works** :   * LuksOpen /dev/sdc1 usb_keyfile   * mount /dev/mapper/usb_keyfile /keyfile (is this possible ?)   * LuksOpen --keyfile /keyfile/key /dev/sda1 disk1   * LuksOpen --keyfile /keyfile/key /dev/sdb1 disk2   * LuksClose /dev/sdc1 Basically being able to run a shell script just after the required modules have been loaded and disable automatic LUKS password prompt. **Additionnal details**   * Distribution used: Gentoo GNU/Linux (amd64) or Debian GNU/Linux (amd64) because I'd like to apply this procedure to multiple installations


title: Running Apache server causing machine to run out of space

text: I was running my Apache server on RHEL 5.5, and noticed when I typed: `df -h`, that I was getting:               [root@localhost log]# df -h     Filesystem            Size      Used   Avail  Use%   Mounted on     /dev/mapper/VolGroup00-LogVol00                           11G       11G    0      100%   /     /dev/sda1             99M       13M    82M    14%    /boot     tmpfs                 1006M     0      1006M  0%     /dev/shm      Any idea where the space would be going to? I have cleaned out the log files in `/usr/local/apache2/logs/`, but that hasn't cleaned up the space. It has got to be a log file somewhere, but I can't find it. Is there a command I can use to search `/` for the large files? I have tried:               # du -a /var | sort -n -r | head -n 10      No luck.


title: find first line beginning with <keyword> following <other-keyword>

text: let's present my problem to explain better. I'm using cygwin, the installation is based on a setup.ini with the following format:                   @ package-name         sdesc: "short description, on one line"         ldesc: "long description of arbitrary length, commonly multiple lines"         category: categories in which the packege belonges, one line         requires: packages (libs etc) required by this package, one line      then comes the following package, & so forth. what I need is, given a package name output all packages required by this package (without the 'requires' prefix, if possible). I'm sure it's basic grep, but I'm new there. thanks.


title: How do I access a digital camera drive via usb after safely removing it?

text: In Ubuntu 11.04, I unwisely right clicked and "safely unmounted the drive" of my Sony HDR-XR150 connected via USB. Now, when I plug my digital camera into my computer via USB, Ubuntu either doesn't register the new drive, or flashes the "recognition and choice of what to do with the USB drive" screen briefly. Please help. FYI, I ran `dmesg` with the following results:                   scsi 4:0:0:0: Direct-Access     Sony     Camcorder        1.00 PQ: 0 ANSI: 0     [   53.099590] sd 4:0:0:0: Attached scsi generic sg2 type 0     [   53.101210] sd 4:0:0:0: [sdb] 234413857 512-byte logical blocks: (120 GB/111 GiB)     [   53.102473] sd 4:0:0:0: [sdb] Write Protect is off     [   53.102477] sd 4:0:0:0: [sdb] Mode Sense: 03 00 00 00     [   53.103471] sd 4:0:0:0: [sdb] No Caching mode page present     [   53.103474] sd 4:0:0:0: [sdb] Assuming drive cache: write through     [   53.107097] sd 4:0:0:0: [sdb] No Caching mode page present     [   53.107101] sd 4:0:0:0: [sdb] Assuming drive cache: write through     [   53.452787]  sdb: sdb1     [   53.455391] sd 4:0:0:0: [sdb] No Caching mode page present     [   53.455393] sd 4:0:0:0: [sdb] Assuming drive cache: write through     [   53.455395] sd 4:0:0:0: [sdb] Attached SCSI removable disk     [   55.341231] usb 2-1: USB disconnect, address 5     [   55.590219] hub 2-0:1.0: unable to enumerate USB device on port 1     [   55.870017] usb 2-1: new high speed USB device using ehci_hcd and address 7     [   56.021458] scsi5 : usb-storage 2-1:1.0     [   56.186651] usb 2-1: USB disconnect, address 7     [   56.500014] usb 2-1: new high speed USB device using ehci_hcd and address 8     [   56.651324] scsi6 : usb-storage 2-1:1.0     [   58.604859] usb 2-1: USB disconnect, address 8     [   58.920011] usb 2-1: new high speed USB device using ehci_hcd and address 9     [   59.270009] usb 6-1: new full speed USB device using uhci_hcd and address 2     [   59.400008] usb 6-1: device descriptor read/64, error -71     [   59.640013] usb 6-1: device descriptor read/64, error -71     [   59.870008] usb 6-1: new full speed USB device using uhci_hcd and address 3     [   60.000008] usb 6-1: device descriptor read/64, error -71     [   60.240014] usb 6-1: device descriptor read/64, error -71     [   60.470014] usb 6-1: new full speed USB device using uhci_hcd and address 4     [   60.890007] usb 6-1: device not accepting address 4, error -71     [   61.010009] usb 6-1: new full speed USB device using uhci_hcd and address 5     [   61.430007] usb 6-1: device not accepting address 5, error -71     [   61.430016] hub 6-0:1.0: unable to enumerate USB device on port 1     [  180.320011] usb 6-1: new full speed USB device using uhci_hcd and address 6     [  180.450016] usb 6-1: device descriptor read/64, error -71     [  180.690012] usb 6-1: device descriptor read/64, error -71     [  180.920010] usb 6-1: new full speed USB device using uhci_hcd and address 7     [  181.050010] usb 6-1: device descriptor read/64, error -71     [  181.290035] usb 6-1: device descriptor read/64, error -71     [  181.520009] usb 6-1: new full speed USB device using uhci_hcd and address 8     [  181.940007] usb 6-1: device not accepting address 8, error -71     [  182.060015] usb 6-1: new full speed USB device using uhci_hcd and address 9     [  182.480008] usb 6-1: device not accepting address 9, error -71     [  182.480019] hub 6-0:1.0: unable to enumerate USB device on port 1     [  555.580012] usb 6-1: new full speed USB device using uhci_hcd and address 10     [  555.710012] usb 6-1: device descriptor read/64, error -71     [  555.950010] usb 6-1: device descriptor read/64, error -71     [  556.180012] usb 6-1: new full speed USB device using uhci_hcd and address 11     [  556.310009] usb 6-1: device descriptor read/64, error -71     [  556.550009] usb 6-1: device descriptor read/64, error -71     [  556.780009] usb 6-1: new full speed USB device using uhci_hcd and address 12     [  557.200008] usb 6-1: device not accepting address 12, error -71     [  557.320012] usb 6-1: new full speed USB device using uhci_hcd and address 13     [  557.740006] usb 6-1: device not accepting address 13, error -71     [  557.740016] hub 6-0:1.0: unable to enumerate USB device on port 1


title: How do I open a .bak file on Linux?

text: I have received a file of .bak format, let it be `foo.bak`. I don't know if it is a MS-DOS file or Linux/Unix file. What I know is that I can't open it because my Linux (Ubuntu) does not give any hint how to open it. So, how I open this file? Just to omit warnings about not knowing what I am doing: _Disclaimer: I received my file from a known place, it is not a virus. It is a soft copy of one system I should next work on. I just do not happen to know how to open it._


title: Bad built-in chain name with iptables-restore

text: I saved my iptable settings on a Ubuntu 11.4 system using               iptables-save >filename      I then replaced the Ubuntu system with CentOS 6.5 and tried to restore iptables using               iptables-restore <filename      This resulted in               iptables-restore v1.4.7: Can't set policy 'INPUT' on 'ACCEPT' line 4: Bad bilt-in chain name      Line 4 is as follows.               :INPUT ACCEPT [199972:10416012]      In the past I have been able to restore iptables fron Ubuntu systems onto Debian systems but Debian is more closely related to Ubuntu than is CentOS. With CentOS, would I just need to add the rules manually?


title: Using .. and . to copy files from dirctories

text: I'm trying to copy a file from the home directory to the current directory( which is a subdirectory of a directory in home) using .. and . instead of path names or ~ This is what I tried, but it didn't work: > cd .. > > cd .. > > cp file . Any help would be appreciated.


title: `echo -e 'Q\ns\nV' | sort` doesn't sort

text: Why do :               $ echo -e 'Q\ns\nV'  | sort       outputs               Q     s     V      without changing the order of my list (taking in account the lower/uppercase ?)


title: Why was '.' chosen to represent the current directory and '..' for parent directory?

text: After reading this question Design question: Why was '~' chosen to represent the home directory?, next obvious question on my mind was why '.' and '..' was used to represent current directory and parent directory. It seems so intuitive now, but any particular reason?


title: /home is Read Only after coming out of screensaver (intermittent)

text: I am using Linux Mint 13 (Maya) and I have my "/home" partition formatted as ext4 and mounted at "dev/sdc1". Occasionally I have a strange problem coming up that looks a lot like this bug that I found here. Well, at least the part that refers to the "/home" partition becoming "read only" when it wakes up from the screen saver. I will be working around the problem by issuing the following command:               mount -t ext4 -o rw,remount /dev/sdc1 /home      However, what I would like to know is how to really troubleshoot this issue (a system log?) to narrow down what might be causing the problem. Pertinent Points:   * I just did a fresh Mint installation last week.    * I just bought a new Western Digital terabyte drive to use as /home    * Three or four days before the problem arose. I installed the kernel with PAE support.   * This entire system (minus the new WD drive) was working great with Ubuntu. Thanks, ................................. ~ After Two Weeks ~ ................................. Ok so it's been two weeks since I posted this and I am still trying to resolve this issue, and it's "holding me up" on some other things that I want to do however I am a happy father of two toddlers that give me good reason not to poor all of my time and effort in resolving this. In the meantime I just booted into Puppy Linux which resolves my noncritical computer use needs. I have a couple of ideas that I am considering and I'll give you my reasons for these ideas as well. 1) I wonder if my fstab has anything to do with this since I installed Mint using my 1 Terabyte drive as my entire "/home" and later resized it so that only half of it was used as home. However my fstab looks correct as far as I can tell. 2) When I was copying my old backup (of /home) to my new /home, I had a problem with the permissions (I was copying as root) so I did a "chown -R" for the entire /home. ... That was a few weeks ago at this point so I am trying to remember the exact command that I used and whether I did that before or after the resize of the partition. And just in case it is of any value, I've also included a copy of my mtab and my "proc/mounts". ............................................... ~ Question Improvement I ~ ............................................... My short (and to the point) question would be, "Would that [errors=remount,ro] entry have stayed there after a re-installation?; 'and' would that entry being there affect what the OS does currently?" ... When I first installed Mint a few weeks ago I used an old 80Gig IDE drive as the "/" and that drive turned out to be bad. Ok so, with the idea that this might help you (to help me), here is a little history. When I first installed Mint a few weeks ago my drive layout looked like this:   * "/" installed on sdb1 --> 80Gig IDE (single partition)   * "swap" installed on sda1 --> 40GB IDE (single partition)   * "/home" installed on sdc1 --> 1TB SATA (single partition) I had two IDE drives and one SATA. At that time sdb1 belonged to the 80Gig IDE drive (where "/" was installed) that had turned out to be a bad drive which I replaced with a 80Gig SATA drive and then reinstalled Mint. During the reinstallation I resized sda1 so the SWAP was now only 10GB. And 'after' the Mint reinstallation I resized sdc1 so that "/home" was half a Terabyte. So my new (current) layout looks like this:   * "/" installed on sdb1 --> 80Gig SATA (single partition)   * "swap" installed on sda1 --> 10GB Partition on IDE drive   * "/home" installed on sdc1 --> 1/2TB on SATA drive ............................................... ~ Other Notes to Consider ~ ............................................... I used "HD Tune" on UBCD (Ultimate Boot CD) to diagnose all of the drives that I am currently using. "HD Tune" is what I had used to verify (after it started failing) that the original 80GB IDE had twelve bad sectors. ... So after that experience I tested all the drives that I was using including the brand new (less than six weeks old) Western Digital terabyte drive that I am currently using as my "/home" assignment.


title: Upgrading the kernel in Redhat Linux 6.0

text: How do you upgrade the kernel in Redhat Linux 6.0? And how can I confirm whether it is updated or not?


title: Changing color of tabs titles in vim color files

text: In my custom `color.vim` file there are multiples entries like these ones:               :hi VertSplit gui=none cterm=reverse     :hi Folded ctermfg=grey ctermbg=darkgrey     :hi FoldColumn ctermfg=4 ctermbg=7     :hi IncSearch cterm=none ctermfg=black ctermbg=darkgreen      However I can't seem to find the two responsible for the colors of name of files in the tabs, and in the selected tab. What are those two entries ? If no idea, where to find a list of all entries with what they correspond to ?


title: Error when trying to install valgrind on Ubuntu 10.04

text: Having trouble tracking down a solution to the following problem. I am running Ubuntu 10.04.               ~$ apt-get install valgrind        Reading package lists... Done        Reading state information... Done        Some packages could not be installed. This may mean.... etc        The following packages have unmet dependencies:          valgrind: Depends: libc6-dbg but it is not going to be installed        E: Broken packages     ~$ apt-get install libc6-dbg        ...stuff...        lic6-dbg: Depends libc6 (= 2.11.1-0ubuntu7.8) but 2.11.1-0ubuntu7.10 is to be installed        E: Broken packages     ~$      Any suggestions are appreciated...!


title: explain the command `printf -- "#!${opt_E}"`

text: I am not able to understand this command and getting confused : here are things i executed on linux trying to undertand its working               [root@testgfs2 final_scripts]# printf -- "#!${opt_E}"     printf -- "#reset{opt_E}"     #reset{opt_E}[root@testgfs2 final_scripts]# printf -- "#!${opt_E}"     printf -- "#"#reset{opt_E}"{opt_E}"     ##reset{opt_E}{opt_E}[root@testgfs2 final_scripts]# echo !$     echo "#"#reset{opt_E}"{opt_E}"     ##reset{opt_E}{opt_E}      how does this work and i don't know under what topic it comes so i am unable to find it on google also. also what does `\--` doing after printf


title: Select characters by holding down a key in Linux (like in OSX)

text: I've been wondering if there's any add on available that does something like Mac OS X. My mother tongue is Spanish, and now I live in a Francophone environment, I also do English a lot, so I'm in need of different accents, specially in French, I have been using linux for two years now and eventually been using Mac OS X for testing purposes. I find really useful the functionality available on Mac OS X, where you keep pressing the key and it displays a list of available options on the same character, different accents, or punctuation. Can I do this on Linux?


title: How to use fail2ban to ban all php and cgi-bin requests

text: On daily basis I see Apache log full of requests initiated by different vulnerability scanner apps. Those hundreds of requests from usually same IP addresses not only makes the log dirty but also uses some server resources. As I do not have any PHP nor CGI-BIN scripts on my Apache, I would like to use fail2ban to ban all those IP addresses on a first request, for a certain amount of time. Does any one have such ready-to-go fail2ban configuration?


title: The Iptables don´t allow update the system

text: These rules don´t allow update the system (Debian wheezy on raspberry pi). Don´t allow ping: ping: sendmsg: Operation not permitted. I am trying to install a home web server and this rules don´t work properly. I want that the server allow my CMS (joomla) to update and allow the update of the system itself. **What I need to change in this file to allow update joomla and debian?**                 *mangle         :PREROUTING ACCEPT [12:624]         :INPUT ACCEPT [12:624]         :FORWARD ACCEPT [0:0]         :OUTPUT ACCEPT [28:9440]         :POSTROUTING ACCEPT [12:2128]         COMMIT              *nat         :PREROUTING ACCEPT [0:0]         :INPUT ACCEPT [0:0]         :OUTPUT ACCEPT [0:0]         :POSTROUTING ACCEPT [0:0]         COMMIT              *filter         :INPUT DROP [0:0]         :FORWARD DROP [0:0]         :OUTPUT DROP [0:0]         :spooflist - [0:0]         -A INPUT -i eth0 -p tcp -m tcp --dport 22 -m state --state NEW -m recent --update --seconds 90 --hitcount 4 --name DEFAULT --rsource -j DROP         -A INPUT -i eth0 -p tcp -m tcp --dport 22 -m state --state NEW -m recent --set --name DEFAULT --rsource         -A INPUT -j spooflist         -A INPUT -i lo -j ACCEPT         -A INPUT -i eth0 -p tcp -m tcp ! --tcp-flags FIN,SYN,RST,ACK SYN -m state --state NEW -j DROP         -A INPUT -i eth0 -f -j DROP         -A INPUT -i eth0 -p tcp -m tcp --tcp-flags FIN,SYN,RST,PSH,ACK,URG FIN,PSH,URG -j DROP         -A INPUT -i eth0 -p tcp -m tcp --tcp-flags FIN,SYN,RST,PSH,ACK,URG FIN,SYN,RST,PSH,ACK,URG -j DROP         -A INPUT -i eth0 -p tcp -m tcp --tcp-flags FIN,SYN,RST,PSH,ACK,URG NONE -m limit --limit 5/min --limit-burst 7 -j LOG --log-prefix " NULL Packets "         -A INPUT -i eth0 -p tcp -m tcp --tcp-flags FIN,SYN,RST,PSH,ACK,URG NONE -j DROP         -A INPUT -i eth0 -p tcp -m tcp --tcp-flags SYN,RST SYN,RST -j DROP         -A INPUT -i eth0 -p tcp -m tcp --tcp-flags FIN,SYN FIN,SYN -m limit --limit 5/min --limit-burst 7 -j LOG --log-prefix " XMAS Packets "         -A INPUT -i eth0 -p tcp -m tcp --tcp-flags FIN,SYN FIN,SYN -j DROP         -A INPUT -i eth0 -p tcp -m tcp --tcp-flags FIN,ACK FIN -m limit --limit 5/min --limit-burst 7 -j LOG --log-prefix " Fin Packets Scan "         -A INPUT -i eth0 -p tcp -m tcp --tcp-flags FIN,ACK FIN -j DROP         -A INPUT -i eth0 -p tcp -m tcp --tcp-flags FIN,SYN,RST,PSH,ACK,URG FIN,SYN,RST,ACK,URG -j DROP         -A INPUT -i eth0 -m pkttype --pkt-type broadcast -j LOG --log-prefix " Broadcast "         -A INPUT -i eth0 -m pkttype --pkt-type broadcast -j DROP         -A INPUT -i eth0 -m pkttype --pkt-type multicast -j LOG --log-prefix " Multicast "         -A INPUT -i eth0 -m pkttype --pkt-type multicast -j DROP         -A INPUT -i eth0 -m state --state INVALID -j LOG --log-prefix " Invalid "         -A INPUT -i eth0 -m state --state INVALID -j DROP         -A INPUT -d 192.168.0.17/32 -i eth0 -p tcp -m tcp --dport 22 -j ACCEPT         -A INPUT -i eth0 -p tcp -m tcp --dport 80 -m state --state NEW,ESTABLISHED -j ACCEPT         # ACEPTAR SALIDAS POR EL 80 Y POR EL 443         #-A INPUT -i eth0 -p tcp -m tcp --sport 80 -m state --state NEW,ESTABLISHED -j ACCEPT          #-A INPUT -i eth0 -p tcp -m tcp --sport 443 -m state --state ESTABLISHED -j ACCEPT              -A INPUT -i eth0 -p tcp -m tcp --dport 443 -m state --state NEW,ESTABLISHED -j ACCEPT         -A INPUT -i eth0 -p icmp -m icmp --icmp-type 8 -m state --state NEW,RELATED,ESTABLISHED -m limit --limit 30/sec -j ACCEPT         -A INPUT -i eth0 -p udp -m udp --sport 53 -m state --state ESTABLISHED -j ACCEPT         -A INPUT -i eth0 -p udp -m udp --sport 123 -m state --state ESTABLISHED -j ACCEPT         -A INPUT -i eth0 -p tcp -m tcp --sport 25 -m state --state ESTABLISHED -j ACCEPT         -A INPUT -m limit --limit 5/min --limit-burst 7 -j LOG --log-prefix " DEFAULT DROP "         -A INPUT -j DROP         -A FORWARD -j spooflist         -A OUTPUT -j spooflist         -A OUTPUT -o lo -j ACCEPT         -A OUTPUT -s 192.168.0.17/32 -o eth0 -p tcp -m tcp --sport 22 -j ACCEPT         #-A OUTPUT -o eth0 -p tcp -m tcp --dport 53 -m state --state NEW -j ACCEPT          -A OUTPUT -o eth0 -p tcp -m tcp --dport 21 -m state --state NEW,ESTABLISHED -j ACCEPT         -A OUTPUT -o eth0 -p tcp -m tcp --dport 20 -m state --state ESTABLISHED -j ACCEPT         -A OUTPUT -o eth0 -p tcp -m tcp --sport 80 -m state --state ESTABLISHED -j ACCEPT         # ACEPTAR SALIDAS POR EL 80 Y POR EL 443         #-A OUTPUT -o eth0 -p tcp -m tcp --dport 80 -m state --state NEW,ESTABLISHED -j ACCEPT          #-A OUTPUT -o eth0 -p tcp -m tcp --dport 443 -m state --state NEW,ESTABLISHED -j ACCEPT              -A OUTPUT -o eth0 -p tcp -m tcp --sport 443 -m state --state ESTABLISHED -j ACCEPT         -A OUTPUT -o eth0 -p icmp -m icmp --icmp-type 0 -m state --state RELATED,ESTABLISHED -j ACCEPT         -A OUTPUT -o eth0 -p udp -m udp --dport 53 -m state --state NEW,ESTABLISHED -j ACCEPT         -A OUTPUT -o eth0 -p udp -m udp --dport 123 -m state --state NEW,ESTABLISHED -j ACCEPT         -A OUTPUT -o eth0 -p tcp -m tcp --dport 25 -m state --state NEW,ESTABLISHED -j ACCEPT         COMMIT      The iptables -L -n output:               Chain INPUT (policy DROP)     target     prot opt source               destination     DROP       tcp  --  0.0.0.0/0            0.0.0.0/0            tcp dpt:22 state NEW recent: UPDATE seconds: 90 hit_count: 4 name: DEFAULT side: source                tcp  --  0.0.0.0/0            0.0.0.0/0            tcp dpt:22 state NEW recent: SET name: DEFAULT side: source     spooflist  all  --  0.0.0.0/0            0.0.0.0/0     ACCEPT     all  --  0.0.0.0/0            0.0.0.0/0     DROP       tcp  --  0.0.0.0/0            0.0.0.0/0            tcpflags:! 0x17/0x02 state NEW     DROP       all  -f  0.0.0.0/0            0.0.0.0/0     DROP       tcp  --  0.0.0.0/0            0.0.0.0/0            tcpflags: 0x3F/0x29     DROP       tcp  --  0.0.0.0/0            0.0.0.0/0            tcpflags: 0x3F/0x3F     LOG        tcp  --  0.0.0.0/0            0.0.0.0/0            tcpflags: 0x3F/0x00 limit: avg 5/min burst 7 LOG flags 0 level 4 prefix " NULL Packets "     DROP       tcp  --  0.0.0.0/0            0.0.0.0/0            tcpflags: 0x3F/0x00     DROP       tcp  --  0.0.0.0/0            0.0.0.0/0            tcpflags: 0x06/0x06     LOG        tcp  --  0.0.0.0/0            0.0.0.0/0            tcpflags: 0x03/0x03 limit: avg 5/min burst 7 LOG flags 0 level 4 prefix " XMAS Packets "     DROP       tcp  --  0.0.0.0/0            0.0.0.0/0            tcpflags: 0x03/0x03     LOG        tcp  --  0.0.0.0/0            0.0.0.0/0            tcpflags: 0x11/0x01 limit: avg 5/min burst 7 LOG flags 0 level 4 prefix " Fin Packets Scan "     DROP       tcp  --  0.0.0.0/0            0.0.0.0/0            tcpflags: 0x11/0x01     DROP       tcp  --  0.0.0.0/0            0.0.0.0/0            tcpflags: 0x3F/0x37     LOG        all  --  0.0.0.0/0            0.0.0.0/0            PKTTYPE = broadcast LOG flags 0 level 4 prefix " Broadcast "     DROP       all  --  0.0.0.0/0            0.0.0.0/0            PKTTYPE = broadcast     LOG        all  --  0.0.0.0/0            0.0.0.0/0            PKTTYPE = multicast LOG flags 0 level 4 prefix " Multicast "     DROP       all  --  0.0.0.0/0            0.0.0.0/0            PKTTYPE = multicast     LOG        all  --  0.0.0.0/0            0.0.0.0/0            state INVALID LOG flags 0 level 4 prefix " Invalid "     DROP       all  --  0.0.0.0/0            0.0.0.0/0            state INVALID     ACCEPT     tcp  --  0.0.0.0/0            192.168.0.17         tcp dpt:22     ACCEPT     tcp  --  0.0.0.0/0            0.0.0.0/0            tcp dpt:80 state NEW,ESTABLISHED     ACCEPT     tcp  --  0.0.0.0/0            0.0.0.0/0            tcp dpt:443 state NEW,ESTABLISHED     ACCEPT     icmp --  0.0.0.0/0            0.0.0.0/0            icmptype 8 state NEW,RELATED,ESTABLISHED limit: avg 30/sec burst 5     ACCEPT     udp  --  0.0.0.0/0            0.0.0.0/0            udp spt:53 state ESTABLISHED     ACCEPT     udp  --  0.0.0.0/0            0.0.0.0/0            udp spt:123 state ESTABLISHED     ACCEPT     tcp  --  0.0.0.0/0            0.0.0.0/0            tcp spt:25 state ESTABLISHED     LOG        all  --  0.0.0.0/0            0.0.0.0/0            limit: avg 5/min burst 7 LOG flags 0 level 4 prefix " DEFAULT DROP "     DROP       all  --  0.0.0.0/0            0.0.0.0/0          Chain FORWARD (policy DROP)     target     prot opt source               destination     spooflist  all  --  0.0.0.0/0            0.0.0.0/0          Chain OUTPUT (policy DROP)     target     prot opt source               destination     spooflist  all  --  0.0.0.0/0            0.0.0.0/0     ACCEPT     all  --  0.0.0.0/0            0.0.0.0/0     ACCEPT     tcp  --  192.168.0.17         0.0.0.0/0            tcp spt:22     ACCEPT     tcp  --  0.0.0.0/0            0.0.0.0/0            tcp dpt:21 state NEW,ESTABLISHED     ACCEPT     tcp  --  0.0.0.0/0            0.0.0.0/0            tcp dpt:20 state ESTABLISHED     ACCEPT     tcp  --  0.0.0.0/0            0.0.0.0/0            tcp spt:80 state ESTABLISHED     ACCEPT     tcp  --  0.0.0.0/0            0.0.0.0/0            tcp spt:443 state ESTABLISHED     ACCEPT     icmp --  0.0.0.0/0            0.0.0.0/0            icmptype 0 state RELATED,ESTABLISHED     ACCEPT     udp  --  0.0.0.0/0            0.0.0.0/0            udp dpt:53 state NEW,ESTABLISHED     ACCEPT     udp  --  0.0.0.0/0            0.0.0.0/0            udp dpt:123 state NEW,ESTABLISHED     ACCEPT     tcp  --  0.0.0.0/0            0.0.0.0/0            tcp dpt:25 state NEW,ESTABLISHED          Chain spooflist (3 references)     target     prot opt source               destination


title: Screen: Current directory in caption bar (not as title)

text: How can I show the current directory of the currently active session in a screen status bar (not as title of the session!)? I have tried with various combinations n,m={0,1} of               backtick 102 n m pwd     caption string '%102`'      (Shell is zsh with oh-my-zsh)


title: Replace a line with the line that I have in the buffer in vi

text: I `cc` or `dd` to copy a line into my paste buffer. Then I go to a new location. I want to replace a line that I see. So I type `p` `Down` `dd`. Is there an easier way (fewer keystrokes)?


title: Kali Linux USB Live Boot Not Working

text: I downloaded the Kali Linux ISO 64-bit off of this page:   * http://www.kali.org/downloads Then, I used the Kali Linux Live USB Install Procedure on this page for Windows. I boot my computer from my USB drive, and I get the following screen:     ![ss#1](http://imgur.com/tDpEfkM.jpg) I click Live (amd64), the first option. Sorry it's not the best picture. Boots well and lo and behold I get to the main screen, and for a second it appears to work:      ![ss#2](http://imgur.com/jJKgKjP.jpg) All is going well, but after a second my computer just reboots, and I'm back to the first picture. I do not understand what is going on! So, how do I fix this issue? I'm sure that the answer is trivial, but this has been a persistent issue for me.


title: NixOS on MacBook: how to enable sudden motion sensor?

text: How to make sure in NixOS on a MacBook that the sudden motion sensor and the relevant disk protections are enabled? It seems that I need the **applesmc** module for this, but I couldn't find how to install it in NixOS.


title: Where to start creating CLI applications?

text: After using linux for a month or two, I know what I'm doing now. When creating programs, using whatever language, I've obviously been using code like this:               $ python test.py      And so if I wanted `test.py` to read a given file, I would have to use:               $ python test.py something.file      What I'd like to do now, it try and create a command line application, so I can use               $ myapp something.file      A program like the `python` in `$ python test.py`, or the `nano` in `$ nano program.pl` **But where on earth do I start building applications like these?** A bit of web trawling has got me nowhere. If you can tell me yourself that would be great, but I'll readily accept a bunch of links. I'm totally open if there's more than one way, I don't really mind what language (an excuse to learn another!) or whatever.


title: Default mark for packets using iptables

text: I am trying to set up a QOS script on my Tomato-enabled WRT54G router. The script does the basics of what I need (make sure that a particular machine on my network has lower priority than anything else), but I am not satisfied with the fact that I had to define a specific rule for the outgoing traffic from all other machines instead of using some 'default' behavior. Specifically, I would like to get rid of the two lines that mark packets with marks 11 and 12.               iptables -t mangle -A PREROUTING -s 192.168.1.70 -j MARK --set-mark 10      iptables -t mangle -A PREROUTING -s 192.168.1.70 -j RETURN     iptables -t mangle -A PREROUTING -m iprange --src-range 192.168.1.2-192.168.1.69 -j MARK --set-mark 11      iptables -t mangle -A PREROUTING -m iprange --src-range 192.168.1.71-192.168.1.254 -j MARK --set-mark 12      iptables -t mangle -A PREROUTING -j IMQ --todev 0       I tried to just remove them (adding a 'default 12') at the creation of the qdisk, but throughput dropped down dramatically. I also tried to mark all packets with either               iptables -t mangle -A PREROUTING -j MARK --set-mark 12      or               iptables -t mangle -A PREROUTING -m mark --mark 0 -j MARK --set-mark 12      as the first or last filtering rules, but this did not work either. Here is the complete script...               TCA="tc class add dev br0"      TFA="tc filter add dev br0"      TQA="tc qdisc add dev br0"      SFQ="sfq perturb 10"      tc qdisc del dev br0 root      tc qdisc add dev br0 root handle 1: htb default 10      tc class add dev br0 parent 1: classid 1:1 htb rate 2400kbit      $TCA parent 1:1 classid 1:10 htb rate 2300kbit ceil 2400kbit prio 0      $TCA parent 1:1 classid 1:11 htb rate   10kbit ceil 2400kbit prio 1      $TCA parent 1:1 classid 1:12 htb rate   10kbit ceil 2400kbit prio 2      $TCA parent 1:1 classid 1:13 htb rate   10kbit ceil 2000kbit prio 4      $TQA parent 1:10 handle 10: $SFQ      $TQA parent 1:11 handle 11: $SFQ      $TQA parent 1:12 handle 12: $SFQ      $TQA parent 1:13 handle 13: $SFQ      $TFA parent 1:0 prio 0 protocol ip handle 10 fw flowid 1:10      $TFA parent 1:0 prio 1 protocol ip handle 11 fw flowid 1:11      $TFA parent 1:0 prio 2 protocol ip handle 12 fw flowid 1:12      $TFA parent 1:0 prio 4 protocol ip handle 13 fw flowid 1:13      iptables -t mangle -A POSTROUTING -p tcp --sport    80 -j MARK --set-mark 10      iptables -t mangle -A POSTROUTING -p tcp --sport   443 -j MARK --set-mark 11      iptables -t mangle -A POSTROUTING -p tcp --sport   995 -j MARK --set-mark 12      iptables -t mangle -A POSTROUTING -d 192.168.1.70 -j MARK --set-mark 13                TCAU="tc class add dev imq0"      TFAU="tc filter add dev imq0"      TQAU="tc qdisc add dev imq0"      modprobe imq      modprobe ipt_IMQ      ip link set imq0 up      tc qdisc del dev imq0 root      tc qdisc add dev imq0 root handle 1: htb     tc class add dev imq0 parent 1: classid 1:1 htb rate 700kbit      $TCAU parent 1:1 classid 1:10 htb rate 7kbit ceil 500kbit prio 4      $TCAU parent 1:1 classid 1:11 htb rate 30kbit ceil 700kbit prio 2      $TCAU parent 1:1 classid 1:12 htb rate 663kbit ceil 700kbit prio 2      $TQAU parent 1:10 handle 10: $SFQ      $TQAU parent 1:11 handle 11: $SFQ      $TQAU parent 1:12 handle 12: $SFQ      $TFAU parent 1:0 prio 4 protocol ip handle 10 fw flowid 1:10      $TFAU parent 1:0 prio 2 protocol ip handle 11 fw flowid 1:11      $TFAU parent 1:0 prio 2 protocol ip handle 12 fw flowid 1:12           iptables -t mangle -A PREROUTING -s 192.168.1.70 -j MARK --set-mark 10           #     # What should I do to avoid these two lines and mark everything else as '12'?     #     iptables -t mangle -A PREROUTING -m iprange --src-range 192.168.1.2-192.168.1.69 -j MARK --set-mark 11      iptables -t mangle -A PREROUTING -m iprange --src-range 192.168.1.71-192.168.1.254 -j MARK --set-mark 12      iptables -t mangle -A PREROUTING -j IMQ --todev 0


title: Capturing OS/hardware communication / reverse engineering drivers

text: This may be too broad of a question, but I'm not really sure what exactly I'm looking for. My main question is how the open source community reverse engineers windows drivers (for say, video cards) to re-write them under linux. I'm an EE graduate, so I've taken courses in microprocessor design and such, assembly, C for embedded systems, and I've worked on embedded linux. But I feel like I'm missing something when trying to understand how drivers are written for linux without an API from the hardware manufacturer. What leads to my question is that on some new laptops, they come with dual video cards. Both an integrated one and a discrete one. There's driver software that allows switching between the 2 in windows, but as far as I know, there's no either open source or proprietary drivers. Obviously I'm not asking something stupid like "omg how do I write that msyelf". But it did make me realize that I've always wondered the _process_ of getting hardware support on linux. Links to resources are fine, I don't expect a tutorial on driver development in an answer. But at least I need to be pointed in the right direction.


title: Is there a simple way to preview the files that rm will remove?

text: Is there a simple way to evaluate what a given `rm` command will do when you do not understand it (such as not recognizing how the flags, variables, etc. interact)? While `ls` helps catch problems in your `rm` parameters, `ls -abc XYZ` does not list the same files that would be affected by `rm -abc XYZ`. Ideally, I would like to type something like `previewrm -abc XYZ` and see what would be removed without actually removing anything, including using the `-f` flag. I essentially want to run `rm` in test batch mode. That is, I want to see what actions it would take if it was run for real, preferably without touching it at all. Thus, `testout 'rm -abc XYZ'` might be the true ideal.


title: RHEL 5 complex port bonding

text: The RHEL 5 documentation is good about bonding pairs of ports in various ways. The Oracle team where I work want to get more complex than that. They want an active bonded pair, with a _third_ interface ready as a passive backup. Has anyone tried bonding at this level of complexity? I thought about trying to layer bonding configurations. Could I configure bondeth0 as an active pair combining eth0 and eth2, and then create a bondeth1 with bondeth0 as active and eth1 as passive? So,   * eth0 + eth2 = bondeth0, configured as an active pair.   * bondeth0 + eth1 = bondeth1, configured for active/passive. Has anyone ever tried that? EDIT: Here's a more comprehensive description. These are two hosts in an Oracle 11g RAC/RDBMS cluster. eth0 is the unrouted management connection between the two hosts. eth1 and eth3 go from each host to its corresponding switch. eth2 goes from the host to the opposite host's switch. This way, no single networking failure takes down a host. Here's a rough drawing:                __________ eth1           ____________      | Host 1 |================| Switch 1 |      |________| eth3           |__________|     eth2 |   |                      |          |   |                      |          |    \-eth0--------eth0-   |          |                       \  |          |                       |  | eth2      ____________         eth3 __|_______      | Switch 2 |==============| Host 2 |      |__________|         eth1 |________|      I don't need to worry about eth0; it's working just fine. The RHEL Documentation covers the basics of bonding well. Many examples of bonding are available. I've even found a great description of the six bonding modes. What I need to know is how to combine two modes across three ports. Thanks! dafydd