title: How should I install Fedora or any other Linux in USB hard disk and configure booting?

text: I want to install Fedora or any other Linux in USB hard disk. I have Windows XP installed in internal HDD. > When USB HDD is attached to my PC, it should ask me to boot from Win XP or > Linux. In any case of boot, I should be able to use both HDDs. > If USB HDD is not attached to my PC, it should boot from Win XP.


title: Tmux is not able to distinguish between insert and shift-insert

text: `Insert` when in xterm, gives `^[[2~` and, `Shift`+`Insert` gives `^[[2;1~` All this is good until I start tmux. Note that the `$TERM` variable remains the same, so this issue should not be related to terminfo. Tmux when in xterm is not able to distinguish between `Insert` and `Shift`+`Insert` and both are read as `^[[2~`. Not only xterm, but tmux when started in a virtual console, exhibits the same behaviour. I tried with and without `set -g xterm-keys on` in the tmux conf file, but to no avail. FWIW I am running tmux 1.8 on XTerm(296) and these are the overrides in my `.Xresources`               XTerm*VT100.Translations: #override \     Shift<Key>Insert: string("\033[2;1~") \n\     <Key>Insert: string("\033[2~")      This is really a pain because I want to map `Shift`+`Insert` in vim but can't do it in tmux. Interestingly, when I run GNU screen in the same xterm, it easily distinguishes between `Insert` and `Shift`+`Insert`. I'm starting to believe it's some wickedness in tmux and not my setup. Does anyone know how to make tmux get the keys transparently just like how xterm gets it without mangling it up in the middle or is there something I am doing wrong?


title: tmux.conf file will not use backslash comma in lines \;

text: Using tmux both 1.7 and 1.8. I see `\;` in tmux.conf files everywhere, but it fails with an error when I add it to mine. Here is an example:               bind -t vi-copy 'y' copy-selection \; run-shell "tmux save-buffer - | curl -d @- localhost:5482" I get this error: > /Users/user/.tmux.conf:30: usage: bind-key [-cnr] [-t key-table] key command > [arguments] Examples here:   1. How can I bind multiple tmux commands to one keystroke?   2. http://superuser.com/questions/562567/tmux-bind-key-and-running-shell-isnt-working Seems to only happen when using the bind -t option.


title: Migrating from hardware to software RAID

text: I have an old PCI-X controller running 8 drives in RAID 5. I'd like to dump the controller and go to software RAID under Ubuntu. Is there a way to do this and retain the data from current array? **EDIT:** (and a slight tangent) The answers below are certainly fine, but here's a bit of added detail in my specific situation. The hardware raid was being done by an old Promise raid card (don't remember the model number). My whole system went down (dead mobo, most likely) and the old controller was a PCI-X card (not to be confused with PCI-e). I asked the question hoping to salvage my data. What I did was buy another Promise (HighPoint) card, and plug all the drives in and install Ubuntu. I was expecting to have to rebuild the array, but surprisingly enough, the HighPoint card saw the old array and brought it up clean. Moral of the story - it looks like at least Promise controllers store their metadata on the arrays themselves, and appear to have some amount of forward compatibility.


title: Can't mount EXT4 hard drive after mounting it in windows

text: I have a 2TB Western external HDD.   Its original filesystem was NTFS but I formatted it to EXT4.   I had no problem in Linux; But today after I mounted it using `ext2fsd` in a windows box, I cant mount it in linux anymore!   The drive had no partition but after that windows mount `Disk Utility` Shows it has a 1KB partition and 2TB unallocated space!!!   My Data are not corrupted (I still can view my files using `ext2fsd` in Windows!)   Trying to mount using `mount -t ext4` fails and dmesg says:               EXT4-fs (sdb): VFS: Can't find ext4 filesystem        also `fsck` gives:               e2fsck 1.41.11 (14-Mar-2010)     e2fsck: Bad magic number in super-block while trying to open /dev/sdb          The superblock could not be read or does not describe a correct ext2     filesystem.  If the device is valid and it really contains an ext2     filesystem (and not swap or ufs or something else), then the superblock     is corrupt, and you might try running e2fsck with an alternate superblock:         e2fsck -b 8193 <device>      I think that Western's internal application is started in Windows and corrupted FS by creating a partition for itself. How can I Fix it?   Thanks * * * **Edit:**   I also tried `e2fsck -b 8193 /dev/sdb` and got same result:               e2fsck 1.41.11 (14-Mar-2010)     e2fsck: Bad magic number in super-block while trying to open /dev/sdb          The superblock could not be read or does not describe a correct ext2     filesystem.  If the device is valid and it really contains an ext2     filesystem (and not swap or ufs or something else), then the superblock     is corrupt, and you might try running e2fsck with an alternate superblock:         e2fsck -b 8193 <device>      So I tried to find super backup superblocks using `testdisk`, it gave:               superblock 0, blocksize=4096 [Ariyan2T]     superblock 32768, blocksize=4096 [Ariyan2T]     superblock 98304, blocksize=4096 [Ariyan2T]     superblock 163840, blocksize=4096 [Ariyan2T]     superblock 229376, blocksize=4096 [Ariyan2T]     superblock 294912, blocksize=4096 [Ariyan2T]     superblock 819200, blocksize=4096 [Ariyan2T]     superblock 884736, blocksize=4096 [Ariyan2T]     superblock 1605632, blocksize=4096 [Ariyan2T]     superblock 2654208, blocksize=4096 [Ariyan2T]      I tried to repair it using `fsck.ext4 -b 32768 -B 4096 /dev/sdb` and the result was:               e2fsck 1.41.11 (14-Mar-2010)     fsck.ext4: Bad magic number in super-block while trying to open /dev/sdb          The superblock could not be read or does not describe a correct ext2     filesystem.  If the device is valid and it really contains an ext2     filesystem (and not swap or ufs or something else), then the superblock     is corrupt, and you might try running e2fsck with an alternate superblock:         e2fsck -b 8193 <device>      * * * **EDIT2:** `fdisk -l /dev/sdb` returns:               Warning: invalid flag 0x0000 of partition table 5 will be corrected by w(rite)          Disk /dev/sdb: 2000.4 GB, 2000365289472 bytes     255 heads, 63 sectors/track, 243197 cylinders     Units = cylinders of 16065 * 512 = 8225280 bytes     Sector size (logical/physical): 512 bytes / 512 bytes     I/O size (minimum/optimal): 512 bytes / 512 bytes     Disk identifier: 0x00021365             Device Boot      Start         End      Blocks   Id  System     /dev/sdb1               1      243198  1953480704   85  Linux extended      * * * **Edit3 (as psusi's comment):** `sudo dd if=/dev/sdb bs=512 count=1 skip=262144 | xxd -a`:               1+0 records in     1+0 records out     512 bytes (512 B) copied, 0.42691 s, 1.2 kB/s     0000000: ae61 5cc1 3be6 6d8d ceed 0cc8 293b fa1b  .a\.;.m.....);..     0000010: 5931 fa58 7420 550a b40e 7b1c b0a6 ad60  Y1.Xt U...{....`     0000020: 1f29 dcae af2a a935 7185 f1d9 6b64 7f29  .)...*.5q...kd.)     0000030: fed0 4c79 fc3b 1544 becd bda0 e7a4 836b  ..Ly.;.D.......k     0000040: ea50 1800 0868 89ac 592d 63a2 05e5 116d  .P...h..Y-c....m     0000050: 4654 9870 671a e11d 7ae0 6bdd dd23 bf5a  FT.pg...z.k..#.Z     0000060: 94ac a20d 695b d010 d8f2 4620 5930 561b  ....i[....F Y0V.     0000070: af93 7d8c 06c3 72c7 3757 7815 e955 3278  ..}...r.7Wx..U2x     0000080: 5773 22b3 2908 52b5 f7e9 59ea b618 5830  Ws".).R...Y...X0     0000090: b29f d244 9a72 ead9 5a77 d3ce e83a 8c44  ...D.r..Zw...:.D     00000a0: 96d9 a89f dd82 b72a f624 10a8 0f44 31a5  .......*.$...D1.     00000b0: 29b6 811a f9cd 175a c00b 670a 5051 ce87  )......Z..g.PQ..     00000c0: 5b00 bd80 20d5 c6e5 f0d0 593e f923 005d  [... .....Y>.#.]     00000d0: 1a6f 83ea 7f28 3305 dc72 7d92 4258 cb4e  .o...(3..r}.BX.N     00000e0: 00de 6a6c 4575 d355 3682 28dd f765 e099  ..jlEu.U6.(..e..     00000f0: 1193 d0cc 64ad a841 ecd7 2c24 08e2 96f5  ....d..A..,$....     0000100: 0fb2 e4fd ef04 1914 f63c 30ce 0df9 3470  .........<0...4p     0000110: 166f 080d 7872 dfce a854 ef20 a237 447a  .o..xr...T. .7Dz     0000120: 05b1 653f 109b 52c3 553b 966c 9733 838e  ..e?..R.U;.l.3..     0000130: c2c9 52cd 4b8f 1e85 cd70 abf4 f9b6 c0c5  ..R.K....p......     0000140: 1412 0f2f 8389 9f4b 94af a523 c6c5 6e04  .../...K...#..n.     0000150: 25d4 d049 fde8 cd9d 94bd 608e e08a f6c6  %..I......`.....     0000160: 389a 5571 9182 d642 7680 f905 9fb6 179a  8.Uq...Bv.......     0000170: 9c6c 5290 ec62 a44f 3f05 fa39 f2a1 18c7  .lR..b.O?..9....     0000180: ba96 297f 2d04 a646 8cc8 e50c ee90 76c0  ..).-..F......v.     0000190: f9ae e586 0f89 6227 35bb b390 9477 8720  ......b'5....w.      00001a0: 2a6c c2b1 9f15 ecdd 8216 523c 2b61 731e  *l........R<+as.     00001b0: 1b1f 0d24 5914 7e8a 7c32 957b 4f24 a464  ...$Y.~.|2.{O$.d     00001c0: ccb4 ecd9 7d1e 967d 9d6b ee20 fa02 9e65  ....}..}.k. ...e     00001d0: 593c 640e fbd2 4f6e e0f8 53b8 4b4a b3fa  Y<d...On..S.KJ..     00001e0: a630 30f1 8170 55a4 dd91 805c d522 9412  .00..pU....\."..     00001f0: 7c0f 1afa ff47 ab23 9721 5a3d f87a 181f  |....G.#.!Z=.z..      and `sudo dd if=/dev/sdb bs=512 count=1 skip=2 | xxd -a`:               1+0 records in     1+0 records out     512 bytes (512 B) copied, 0.000880215 s, 582 kB/s     0000000: 0000 0000 0000 0000 0000 0000 0000 0000  ................     *     00001f0: 0000 0000 0000 0000 0000 0000 0000 0000  ................      * * * a question: Can I repair it with `mkfs.ext4 -S /dev/sdb` without loosing data? * * * **EDIT4:** At `skip=2050` there is a `53ef` at position 0x38 (`sudo dd if=/dev/sdb bs=512 count=1 skip=2050 | xxd -a`):               1+0 records in     1+0 records out     512 bytes (512 B) copied, 0.000688801 s, 743 kB/s     0000000: 0000 4707 00f0 1b1d cc98 7401 769e 2a1a  ..G.......t.v.*.     0000010: 9df7 4607 0000 0000 0200 0000 0200 0000  ..F.............     0000020: 0080 0000 0080 0000 0020 0000 ce17 0750  ......... .....P     0000030: ce17 0750 1a00 2600 53ef 0100 0100 0000  ...P..&.S.......     0000040: a26d 9d4f 004e ed00 0000 0000 0100 0000  .m.O.N..........     0000050: 0000 0000 0b00 0000 0001 0000 3c00 0000  ............<...     0000060: 4202 0000 7b00 0000 8160 9a1f f334 4827  B...{....`...4H'     0000070: b6df 00c2 8981 7b36 4172 6979 616e 3254  ......{6Ariyan2T     0000080: 0000 0000 0000 0000 2f6d 6564 6961 2f41  ......../media/A     0000090: 7269 7961 6e32 5400 4bb7 7001 80fd 39e9  riyan2T.K.p...9.     00000a0: 607c e2c0 8098 6ced 94be 7fed 1529 21c0  `|....l......)!.     00000b0: 6026 a0c5 c280 0000 6026 a0c5 2042 b0c5  `&......`&.. B..     00000c0: 0000 0000 2042 b0c5 0000 0000 0000 8b03  .... B..........     00000d0: 0000 0000 0000 0000 0000 0000 0000 0000  ................     00000e0: 0800 0000 0000 0000 0000 0000 b536 a950  .............6.P     00000f0: 02a9 455e 9fa8 b9a3 0f2b 61b1 0101 0000  ..E^.....+a.....     0000100: 0000 0000 0000 0000 a26d 9d4f 0af3 0200  .........m.O....     0000110: 0400 0000 0000 0000 0000 0000 ff7f 0000  ................     0000120: 0080 880e ff7f 0000 0100 0000 ffff 880e  ................     0000130: 0000 0000 0000 0000 0000 0000 0000 0000  ................     0000140: 0000 0000 0000 0000 0000 0000 0000 0008  ................     0000150: 0000 0000 0000 0000 0000 0000 1c00 1c00  ................     0000160: 0100 0000 0000 0000 0000 0000 0000 0000  ................     0000170: 0000 0000 0400 0000 5962 660c 0000 0000  ........Ybf.....     0000180: 0000 0000 0000 0000 0000 0000 0000 0000  ................     *     00001f0: 0000 0000 0000 0000 0000 0000 0000 0000  ................      * * * **EDIT5:**   `mount -t ext4 /dev/sdb1 /media/tmpmp/` returns:               mount: wrong fs type, bad option, bad superblock on /dev/sdb1,            missing codepage or helper program, or other error            In some cases useful info is found in syslog - try            dmesg | tail  or so      `file -s /dev/sdb1` returns:                /dev/sdb1: data


title: Pipe find into grep -v

text: I'm trying to find all files that are of a certain type and do not contain a certain string. I am trying to go about it by piping find to grep -v example:               find -type f -name '*.java' | xargs grep -v "something something"      This does not seem to work. It seems to be just returning all the files that the find command found. If it helps, what I am trying to do is basically find all .java files that match a certain filename(e.g. ends with 'Pb' as in SessionPb.java) and that do not have an 'extends SomethingSomething" inside it. My suspicion being a newbie to unix is that I'm doing it wrong. So how should the command look like instead?


title: Arch Linux: Yaourt/Makepkg Can Not Build Apache

text: I am using yaourt to automatically compile Apache from source every time there’s an update available from `extra`. I am doing this so that I can have a custom suexec docroot (`/srv/www` rather than the default `/srv/http`). This has worked flawlessly for several updates, until now.               $ yaourt -S apache     ==> Building apache from sources.          ==> Retrieving PKGBUILD and local sources...     receiving file list ... done     ./     PKGBUILD     apache.conf.d     apache.install     apache.tmpfiles.conf     apachectl-confd.patch     arch.layout     httpd     httpd.logrotate     pcre_info.patch          sent 199 bytes  received 10416 bytes  7076.67 bytes/sec     total size is 9809  speedup is 0.92     => removes/replaces '--with-suexec-docroot=\/srv\/http' by '--with-suexec-docroot=\/srv\/www' in global     --- ./PKGBUILD  2012-07-06 00:02:13.000000000 -0400     +++ ./PKGBUILD.custom   2012-07-06 15:49:03.000000000 -0400     @@ -102,7 +102,7 @@                 --enable-so \                 --enable-suexec \                 --with-suexec-caller=http \     -           --with-suexec-docroot=/srv/http \     +           --with-suexec-docroot=/srv/www \                 --with-suexec-logfile=/var/log/httpd/suexec.log \                 --with-suexec-bin=/usr/sbin/suexec \                 --with-suexec-uidmin=99 --with-suexec-gidmin=99 \     ==> Edit PKGBUILD ? [y/N] ("A" to abort)     ==> ------------------------------------     ==> n          ==> apache dependencies:      - openssl (already installed)      - zlib (already installed)      - apr-util (already installed)      - pcre (already installed)               ==> Edit apache.install ? [y/N] ("A" to abort)     ==> ------------------------------------------     ==> n          ==> Continue building apache ? [Y/n]     ==> --------------------------------     ==>      ==> Building and installing package     ==> Making package: apache 2.2.22-4 (Thu Jul  5 14:47:33 EDT 2012)     ==> Checking runtime dependencies...     ==> Checking buildtime dependencies...     ==> Retrieving Sources...       -> Downloading httpd-2.2.22.tar.bz2...       % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current                                      Dload  Upload   Total   Spent    Left  Speed     100 5252k  100 5252k    0     0  93231      0  0:00:57  0:00:57 --:--:-- 93283       -> Downloading httpd-2.2.22.tar.bz2.asc...       % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current                                      Dload  Upload   Total   Spent    Left  Speed     100   835  100   835    0     0   5191      0 --:--:-- --:--:-- --:--:-- 10437       -> Downloading 02-rename-prefork-to-itk.patch...       % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current                                      Dload  Upload   Total   Spent    Left  Speed       0     0    0     0    0     0      0      0 --:--:--  0:01:06 --:--:--     0curl: (7)     couldn't connect to host     ==> ERROR: Failure while downloading 02-rename-prefork-to-itk.patch         Aborting...     ==> ERROR: Makepkg was unable to build apache.     ==> Restart building apache ? [y/N]     ==> -------------------------------     ==>       The problem seems to be that curl can’t find `02-rename-prefork-to-itk.patch`. I don’t know what URL that’s located at, in what file it’s specified, or how I might find an alternate location for it. Any idea what is going on/how to troubleshoot?


title: How to open the same directory in another panel in Midnight Commander?

text: In Midnight Commander, how to quickly set the right panel to the same directory as the left panel (and vice versa)?


title: Change numbers in the Number column to be consecutive from 0 for an mdadm RAID array

text: I have a RAID 1 array:               # mdadm --detail /dev/md0     /dev/md0:             Version : 1.2       Creation Time : Thu Oct 18 21:52:43 2012          Raid Level : raid1          Array Size : 1048564 (1024.16 MiB 1073.73 MB)       Used Dev Size : 1048564 (1024.16 MiB 1073.73 MB)        Raid Devices : 2       Total Devices : 3         Persistence : Superblock is persistent              Update Time : Fri Oct 19 16:25:32 2012               State : clean      Active Devices : 2     Working Devices : 3      Failed Devices : 0       Spare Devices : 1                     Name : cow:0  (local to host cow)                UUID : 9e691db1:f8fcc7d8:f56d9c11:1c202693              Events : 98              Number   Major   Minor   RaidDevice State            2       8        2        0      active sync   /dev/sda2            3       8       18        1      active sync   /dev/sdb2                 4       8       34        -      spare   /dev/sdc2      Is it possible to change the numbers in the `Number` column to 0, 1, 2 instead of 2, 3, 4? They were 0, 1, 2 until I messed around a bit with the array, removing and adding devices.


title: Tool to monitor in and out data network traffic w graphs and detailed stats

text: Is there a tool, that can gather stats on network usage? Requirements:   * Generate HTML (or other format, convertible to HTML)   * Time line graphs for bandwidth usage, also which hosts use the most bandwidth and what port is used by that host.   * Which ports are using most bandwidth  This isn't the full requirements, but things I can think of just now. I am not sure what the name of this kind of tool is called.


title: When changing distro

text: I wonder if I have previously installed ubuntu with root, home, and swap partition. And now I want to change distro to arch linux. Is it so that I only need to wipe my root-partition and install arch linux there instead?


title: Using OGG/Vorbis, is there a way to continue to record to an existing audio file?

text: I am using Vorbis/ogg to record audio (using arecord and then pipping to oggenc). I have downloaded oggvideotools, which gave me oggCat, which will let me join two previously recorded audio files into one file. But, my problem is this: The device I am working on is known to have the "plug pulled", but it is recording while the power is on (swapping out batteries etc.). Once the device is powered back on, I need to continue to record to the previous file (automated recording). Right now, I can use arecord to record two separate files, and then once the recording is done, I can oggCat the two, but that doesn't get me what I want 100%, I need to be able to continue recording where the first file got cut off. I originally put this on Stackoverflow, trying to solicit a python response, but it was closed by moderators - I hope this is a better place for it. I need python and busybox solutions. Unfortunately, other solutions outside Python and Busybox are not available to me - furthermore, downloading additional packages/programs is also not available, I have oggenc, arecord, and oggvideotools. Any advise on where to look? Can I somehow pipe arecord data from a temp file to oggCat? Like: `oggCat NewFile.ogg File1.ogg (arecord file2.ogg ...)` Where "(arecord file2.ogg ...) is the file currently being recorded and simultaneously being appended to Newfile.ogg? Thanks in advance, (P.S. the audio files will have the exact same parameters - i.e. same channels, rates, etc)


title: Using UUID's with mdadm

text: I'm using GPT as my partitioning scheme. I check the UUID's of my partitions:               # ls -l /dev/disk/by-partuuid/     total 0     lrwxrwxrwx 1 root root 10 Oct 18 22:39 0793009a-d460-4f3d-83f6-8103f8ba24e2 -> ../../sdb3     lrwxrwxrwx 1 root root 10 Oct 18 22:39 13f83c47-ad62-4932-8d52-e93626166e7f -> ../../sdc3     lrwxrwxrwx 1 root root 10 Oct 18 22:39 1b247b1f-0b7b-419e-bc3b-0f90cbadb87c -> ../../sdc2     lrwxrwxrwx 1 root root 10 Oct 18 22:39 224d5933-7a23-4833-b785-79a67c9b9306 -> ../../sda1     lrwxrwxrwx 1 root root 10 Oct 18 22:39 2ff625b2-b96b-4ce5-b752-57cdf7092258 -> ../../sda3     lrwxrwxrwx 1 root root 10 Oct 18 22:39 449956f9-7289-49ed-9a37-ed6be9264d1c -> ../../sdb1     lrwxrwxrwx 1 root root 10 Oct 18 22:39 a2a95e45-7e4c-4b20-a2bd-66d96e737590 -> ../../sdb2     lrwxrwxrwx 1 root root 10 Oct 18 22:39 a8c07f74-9d6d-4f45-9453-dd2e6998f100 -> ../../sda2     lrwxrwxrwx 1 root root 10 Oct 18 22:39 c2c9e94c-9c73-4d6e-a4ec-2229f56152e8 -> ../../sdc1      And add `/dev/sdc2` using its UUID:               # mdadm /dev/md0 --add /dev/disk/by-partuuid/1b247b1f-0b7b-419e-bc3b-0f90cbadb87c     mdadm: added /dev/disk/by-partuuid/1b247b1f-0b7b-419e-bc3b-0f90cbadb87c      But when I look at the details of the RAID array it reports `/dev/sdc2` instead of the UUID.               # mdadm --detail /dev/md0     /dev/md0:             Version : 1.2       Creation Time : Thu Oct 18 21:52:43 2012          Raid Level : raid1          Array Size : 1048564 (1024.16 MiB 1073.73 MB)       Used Dev Size : 1048564 (1024.16 MiB 1073.73 MB)        Raid Devices : 2       Total Devices : 2         Persistence : Superblock is persistent              Update Time : Fri Oct 19 15:57:19 2012               State : clean      Active Devices : 2     Working Devices : 2      Failed Devices : 0       Spare Devices : 0                     Name : cow:0  (local to host cow)                UUID : 9e691db1:f8fcc7d8:f56d9c11:1c202693              Events : 47              Number   Major   Minor   RaidDevice State            2       8       34        0      active sync   /dev/sdc2            1       8       18        1      active sync   /dev/sdb2        1. Is it impossible to construct a RAID array using UUID's?   2. Or is it using the UUID but reports the normal name to increase the readability? In that case, how can I tell?   3. I would like to use UUID's so that I may move the disks around freely in the machine without breaking anything. Doesn't that sound like a good idea?


title: Piping output from a segfaulting program

text: I have a script that calls a program (specifically, `ttf2afm`, part of tetex 3.0) that sometimes segfaults and sometimes doesn't. The information I need is always printed out _before_ it segfaults, but I'm having a hard time stopping the pipe redirection from failing and not outputting anything to the pipe when the program fails. I've tried redirecting through a FIFO, parenthesizing the process with a `true` at the end, executing from a shell function and encasing in `sh -c`, but the script never seems to let the process output _anything_ , redirected or otherwise-not even to stderr. I know it is capable of output, being that it's perfectly capable of giving it from the command-line, but not from a script for some reason. My question is, is there any way for the script to ignore the fact that the program segfaults and give me the output anyway? I'm running BASH 4.1.10(2)-release.


title: Simple Shell Script with Arithmetic issue... ** is giving me trouble

text: When I run this script I get this error: > ./myscript.sh: 16: arithmetic expression: expecting primary: "1 ** 1" When I run this shell script with bash, as in `#! /bin/bash` on the first line, the math works properly; unfortunately I need to use `/bin/sh`. What am I doing wrong? I'm on Linux Mint if that matters.               #! /bin/sh          x=1     while [ $x -le 10 ]     do         y=1         while [ $y -le 10 ]         do             echo $(($y ** $x))"   \c"             y=`expr $y \+ 1`         done         echo         x=`expr $x \+ 1`     done


title: start-stop-daemon returning always 0 (success)

text: I have set up `start-stop-daemon` to start my script automatically               case "$1" in        start)           log_begin_msg "starting foo"           start-stop-daemon --start --chuid nobody --user nobody --pidfile \           /tmp/foo.pid --startas /usr/local/bin/foo.sh &           log_end_msg $?      the problem is, it always returns 0 (success),even if the process was not started. How can I capture the return code of `start-stop-daemon` properly ?


title: Zero-fill numbers to 2 digits with sed

text: Input:               201103 1 /mnt/hdd/PUB/SOMETHING     201102 7 /mnt/hdd/PUB/SOMETH ING     201103 11 /mnt/hdd/PUB/SO METHING     201104 3 /mnt/hdd/PUB/SOMET HING     201106 1 /mnt/hdd/PUB/SOMETHI NG      Desired output:               201103 01 /mnt/hdd/PUB/SOMETHING     201102 07 /mnt/hdd/PUB/SOMETH ING     201103 11 /mnt/hdd/PUB/SO METHING     201104 03 /mnt/hdd/PUB/SOMET HING     201106 01 /mnt/hdd/PUB/SOMETHI NG      How can I add a `0` if there is only a single digit, e.g. `1` in the "day" part? I need this date format: YYYYMM DD.


title: How to execute same command "X" multiple times with a time delay of some number of seconds?

text: I know how to execute multiple commands at same time but now what I need is to run the same command multiple times with some time delay between the command execution. ### Requirements   * I don't want to use a script for this   * A single one line command to accomplish this   * Needs to run on Linux   * Need to control the number of times the command will run


title: find with user variables

text: I am trying to call find with a few variables. So far I had this:               DIRECTORY="./ "     FILENAME=-regex" .*test.*"     find $DIRECTORY $FILENAME      Which works fine. If I change the filename to :               FILENAME=-regex" .*"      to list all the files in the directory, I get an error:               find: paths must precede expression: ..      What am I doing wrong?


title: Difference between /usr/include/sys and /usr/include/linux?

text: Well, obviously there is a difference, but I'm curious about the rational behind why some things go under /usr/include/sys and others go under /usr/include/linux, and have the same header file name? Does this have something to do with POSIX vx non-POSIX? Also, I've managed to populate /usr/include/linux with headers on my Fedora system by grabbing a the kernel-headers package, is there a standard package name for me to get header files that go under /usr/include/sys? I haven't been able to find it.


title: How does one find and replace text in all open files with geany?

text: How does one find and replace text in **all open files** with geany?


title: Fast tool to generate thumbnail video galleries for command line

text: I use gframecatcher to generate thumbnail video galleries, i.e. something like this: ![enter image description here](http://i.stack.imgur.com/wPlfF.jpg) However this is a GUI tool and I want to create recursively a gallery for every video in a directory structure, so I am looking for a fast command line tool to do this.


title: How to setup an audio/sound output monitor/listener?

text: I am working with an Arduino and am trying to get it to respond to sound when it is played on my computer. I'm communicating with it over a serial port. I need to know if there are any audio/sound monitoring tools that will work from the command line so I could write a shell script to do everything. Something similar to `airmon-ng` for wireless (Although not exactly like this as this monitors external stats. I'm looking for something that can do this internally). I'm not sure if such a tool exists because I couldn't seem to find the right combination of keywords to find it on google. This is for an audio-out listener. I think similar tools exist for line-in.


title: what does the following command do?

text: what does the following command do? I have tried to study the linux command but I could not find out what this command does. here is the command:               touch finger ; finger touch


title: How to cp or rm files based on ownership / permission

text: After a problem with spam, I stopped `postfix`               postfix stop      and checked through the `mailq` manually to find hundreds of thousands of unsent spam. The spam was sent from one of the sites hosted locally, and I know that user has not tried to send any emails since I stopped outgoing mail. Therefore all the messages in `/var/spool/postfix/maildrop` that originate from that user on my machine are known to be spam, and I'd like to delete or move them to another dir for later investigation. I would like to **move all the files with a given owner** (in this case the user 'web2') **from**               /var/spool/postfix/maildrop      **to**               /var/spool/postfix/temp-spam      How can I do this?


title: Panasonic printer refuses to print

text: _I recently switched from Ubuntu to Opensuse because of bloatware (including Unity)._ However, I'm not able to make my LAN printer `Panasonic KX-MB 2010` work. In Ubuntu I set the printer up using this tutorial, but in Opensuse I end up with this error even though `rastertogdi` binary is copied correctly:               /usr/lib/cups/filter/rastertogdi failed      I also tried the official driver for RedHat, but I end up with one of these errors (randomly):               /usr/lib/cups/filter/gstoraster failed      or               Cannot load libgs or libgs version too old then 8.0      Any help would be appreciated.


title: How to create a shortcut of some folder on Docky?

text: I am using docky on ubuntu 14.04.I am able to pin shortcut of applications to it. But how can I make a shortcut of a particular folder to it. Like It has home folder icon in docky ..I want to have folder location directed to that particular one.


title: What are the advantages of using named pipe over unnamed pipe?

text: I was reviewing a set of interview questions that are asked from a unix admin; I found a topic called "named pipe". I googled the topic; to some extent I have been able to understand it :- named pipes || FIFO But still I feel that I am lacking the knowledge of when to use this particular type of pipe. Are there any special situations where unnamed pipes would fail to work ?


title: bash prompt - long command circle back to same line after adding color

text: Note: I am using Putty and my TERM is set to XTERM. I have added the color to my bash prompt as               PS1="\[\033[0;32m\]\d \t \u\e[1;33m@\H /\W $ \[\033[1;37m\]"      just to simplify PS1 in English -               ${GREEN}\d \t \u{YELLOW}@\H \W $ {reset-color}      Now, whenever my command is long and doesn't fit into the line of screen, it should come over to the next line, but it doesn't and the initial character start getting replaced which each character I type. The whole command is present but is not seen completely. It executes normally, so it's just the display that is getting distorted. The situation worsens when I go back to the first character and try to delete the characters, the whole command line moves up and up erasing the previous data that was on screen. After some trial and error removing some-part I found that addition a `@` leads to the above behavior               \e[1;33m      I really don't remember why I had put this and I am not able to trace this back. Can you help me in resolving this issue? The long commands should get on the next line and not on the same line.


title: What filesystem offers best protection for securing data against corruption due to power loss?

text: I am running a small `uClibc` and `busybox` based embedded system on an x86 device. I am using an initramfs but I also mounting a custom `ext3` directory on a compact flash device in IDE mode that I am using to store persistent measurement logging data created by a custom written c++ application. I chose the `ext3` file system as it is recommended for safety against power loss when using CF drives in IDE mode in a couple of books I have read ( _Building Embedded Linux Systems_ by Karim Yaghmour and _Embedded Linux Primer_ by Christopher Hallinan). This is particularly important and the data is critical. However, due to some of the comments in my previous question Confusion with how to restore corrupt ext3 files if power outage occurs during a file write it would appear that in fact this file system does not offer the guarantee of safety against data corruption due to power loss. So I would like to know if   1. Is `ext3` actually the best choice for this setup?   2. Does power loss during a disc write operation only corrupt the portion of data I am appending to the file periodically or can it corrupt the **entire** file?   3. Is data that is **not** being written at the point of power loss completely safe? In particular, is there any risk that my `initramfs.cpio` file can become corrupt also?   4. Is there any method I can use in my application code to protect the data (i.e. creating an extra partition and writing my data to mirror images so that there are always 2 copies) - speed is not a real issue for my application so expensive copying operations are acceptable. I have seen and read the answers to this related question: Do journaling filesystems guarantee against corruption after a power failure?, but it doesn't quite cover some of the things that are confusing me. I realise that I am asking a lot of questions but it seems that despite reading a lot of material I have had a fundamental failure to understand the risks to my data in the event of power loss.


title: redirection failing for CGI program

text: I'm trying to redirect the contents of command output to a file in a CGI program. The issue for me is that the output file is not getting created. The CGI Code snippet is as follows:               #!/bin/bash          echo "Content-type: text/html"     echo ""          echo ""     echo ""          `mysql -u root -predhat -H  -D mysql -e "select host,db from  db;" > output.txt`           echo ""      echo ""       The CGI script is getting called from an HTML program. Also,I can use `INTO OUTFILE` with a `mysql` command, but I want that output redirection should work for any command. Ownerships are as follows:                 #ls -l /var/www/cgi-bin/example.sh       -rwxr-xr-x 1 root root 839 Apr 11 21:34 /var/www/cgi-bin/example.sh      `# ps -ef | grep httpd root 2442 1 0 19:30 ? 00:00:00 /usr/sbin/httpd apache 2464 2442 0 19:30 ? 00:00:00 /usr/sbin/httpd apache 2465 2442 0 19:30 ? 00:00:00 /usr/sbin/httpd apache 2466 2442 0 19:30 ? 00:00:00 /usr/sbin/httpd apache 2467 2442 0 19:30 ? 00:00:00 /usr/sbin/httpd apache 2468 2442 0 19:30 ? 00:00:00 /usr/sbin/httpd` How can I resolve the issue?


title: No boot menu with Linux Mint and Windows 7

text: Currently I have Windows 7 installed on my main hard drive (64gb SSD). I recently installed Linux Mint on a secondary hard disk (1TB HDD). My issue is that when I turn the PC on there is no boot menu to allow me to choose which OS I want to boot into. I know this may be because the two operating systems are on different hard disks but is there any way I can have a choice which OS to run without having to change the hard disk drive boot priority in the BIOS?


title: Replace data at specific positions in txt file using data from another file

text: I have a text file in the below format:               $data This is the experimental data         good data     This is good file     datafile     1 4324 3673 6.2e+11 7687 67576     2 3565 8768 8760 5780 8778          "This is line '2'"     3 7656 8793 -3e+11 7099 79909     4 8768 8965 8769 9879 0970     5 5878 9879 7.970e-1 9070 0709799     .     .     .     100000 3655 6868 97879 96879 69899     $.endfile      I want to replace the data of the 3rd and 4th column from row '2' to '100000' with the data from two other text files which have one column of 99999 rows each. How can I do this using `awk`, `sed` or any other unix command? Note that the column delimiter is space. The other two text files have 99999 lines each, and they are both in the following format:               12414     12421     36347     3.4e+3     -3.5e22     987983     .     .     .     87698


title: What special characters does grep parse by default?

text: > **Possible Duplicate:**   >  In a regular expression, which characters need escaping? I know there is the `-E` flag which treats the "search term" as a regular expression. However, it seems that even without that, `grep` is treating some characters specially. For example, if I run:               grep "$var" *      Then it lists every line of the file (I assume it's using `$` as the end-of- line regex). The period also seems to look for any character under certain circumstances. So what are the special characters I need to be wary of when using `grep`?


title: Bash script for logging in ftp

text: I have seen this question: link I have similar, if not the same request. I'd like to create a script that will log me in ftp server. I do not want to automate the whole exchange, I just want to speed up the login. Security is not an issue, it can be most insecure way of doing it, I don't care, I doubt anyone would try to access the server, and even if someone does, I still don't care. =) I have tried this:               #!/bin/bash     ftp -n ftp.domain.com     quote USER user     quote PASS pass      It seems to log me in successfully, but when I try to issue a new command I get:               530 You aren't logged in     ftp: bind: Address already in use


title: Oracle 11g R2 on Redhat 6

text: I have a Solaris background, and I am new in RHEL, and I want to install Oracle 11g on it. I downloaded Oracle documentation, that illustrate how to install it for RHEL 6. The following or later version of packages for Oracle Linux 6, and Red Hat Enterprise Linux 6 must be installed:               binutils-2.20.51.0.2-5.11.el6 (x86_64)     compat-libcap1-1.10-1 (x86_64)     compat-libstdc++-33-3.2.3-69.el6 (x86_64)     compat-libstdc++-33-3.2.3-69.el6.i686     gcc-4.4.4-13.el6 (x86_64)     gcc-c++-4.4.4-13.el6 (x86_64)     glibc-2.12-1.7.el6 (i686)     glibc-2.12-1.7.el6 (x86_64)     glibc-devel-2.12-1.7.el6 (x86_64)     glibc-devel-2.12-1.7.el6.i686     ksh     libgcc-4.4.4-13.el6 (i686)     libgcc-4.4.4-13.el6 (x86_64)     libstdc++-4.4.4-13.el6 (x86_64)     libstdc++-4.4.4-13.el6.i686     11     libstdc++-devel-4.4.4-13.el6 (x86_64)     libstdc++-devel-4.4.4-13.el6.i686     libaio-0.3.107-10.el6 (x86_64)     libaio-0.3.107-10.el6.i686     libaio-devel-0.3.107-10.el6 (x86_64)     libaio-devel-0.3.107-10.el6.i686     make-3.81-19.el6     sysstat-9.0.4-11.el6 (x86_64)      I tried to install each package. I download this package: compat- libcap1-1.10-1.src.rpm               rpm -i compat-libcap1-1.10-1.src.rpm      and I got this output:               warning: compat-libcap1-1.10-1.src.rpm: Header V3 RSA/SHA256 Signature, key ID c105b9de: NOKEY     warning: user mockbuild does not exist - using root     warning: group mockbuild does not exist - using root     warning: user mockbuild does not exist - using root     warning: group mockbuild does not exist - using root     warning: user mockbuild does not exist - using root     warning: group mockbuild does not exist - using root     warning: user mockbuild does not exist - using root     warning: group mockbuild does not exist - using root     warning: user mockbuild does not exist - using root     warning: group mockbuild does not exist - using root     warning: user mockbuild does not exist - using root     warning: group mockbuild does not exist - using root     warning: user mockbuild does not exist - using root     warning: group mockbuild does not exist - using root     warning: user mockbuild does not exist - using root     warning: group mockbuild does not exist - using root     warning: user mockbuild does not exist - using root     warning: group mockbuild does not exist - using root      And someone advice me to solve this problem:                   # yum install mock          and create the ‘mockbuild’ user              # useradd -s /sbin/nologin mockbuild      When I tried to use:               yum install mock      I got this output:               Loaded plugins: product-id, refresh-packagekit, security, subscription-manager     Updating certificate-based repositories.     Unable to read consumer identity     Setting up Install Process     No package mock available.     Error: Nothing to do      I can't use any one of these commands `yum` and `rpm`


title: How can I make a public variable in Linux that all users would see?

text: I need to have a variable `$FOO` on the system that contains a string all users could use, but I have no idea how to create one. The Upstart job is obviously not a solution as from this thread - Is it possible to export env variable via Upstart? But I have no idea where else I should look, being Windows developer for a very long time.


title: Bash script is not working

text: I wanted to create a script that executes the `ls` command with the provided arguments. Why isn't it working? I tried running it with for example `-R`, then it echoes (I echoed the same thing for comparison):                   ls "-R"      but says that it cannot access "-R": no such file or directory. But when I execute `ls "-R"` in the terminal, it works. The script itself:               text='ls'          while [[ $# -gt 0 ]]     do         text+=' "'         text+=$1         text+='"'              shift          done     echo 'ls "-R"'          echo $text     $text


title: Problem with OpenSSH

text: I think I got an OpenSSH-problem with my Ubuntu Server 14.04.1. Let me explain my setup: For development, I use Git and Gitolite. I have 3 server:   * server A ( master-server for git-mirroring)   * server B ( slave-server for git-mirroring)   * server C (new slave-server for git-mirroring - in some months it should replace server a) Every server got the public-key from every other server. The .ssh-directory got the permission 0700 and the authorized_keys-file in .ssh/ got 0600. I follow the instruction of http://gitolite.com/gitolite/mirroring.html for setting up a new slave for the mirroring. I try the command "ssh server ... info" on every mashine: server A:               $ ssh server B info     hello server a, this is git@server b running gitolite ...       (this works fine - I didnt setting up these)               $ ssh server c info:     git@server c´s password:      if I enter the correct password for user git from server C, I got a message like this:               /usr/share/info/dir     File: dir,      Node: Top       This is the top of the INFO tree            This (the Directory node) gives a menu of major topics.       Typing "q" exits, "?" lists all Info commands, "d" returns here,       "h" gives a primer for first-timers,       "mEmacs<Return>" visits the Emacs manual, etc.            In Emacs, you can click mouse button 2 on a menu item or cross reference       to select it.          * Menu:          Basics     * Common options: (coreutils)Common options.     * Coreutils: (coreutils).       Core GNU (file, text, shell) utilities.     * Date input formats: (coreutils)Date input formats.     * Ed: (ed).                     The GNU line editor     * File permissions: (coreutils)File permissions.                                     Access modes.     * Finding files: (find).        Operating on files matching certain criteria.      If I try it on server B ssh server C info, the message appears like on server A. I don´t know why it´s not working with server c. If I try on server C ssh server a/b info, it works fine. **Update:** If I use command from server A "ssh server c info" the auth.log from server C shows:               Aug 26 14:15:22 server C sshd[14785]: Accepted password for git from 192.168.1.60 port 51074 ssh2     Aug 26 14:15:22 server C sshd[14785]: pam_unix(sshd:session): session opened for user git by (uid=0)     Aug 26 14:15:22 server C systemd-logind[958]: Removed session 60.     Aug 26 14:15:22 server C systemd-logind[958]: New session 61 of user git.     Aug 26 14:15:22 server C sshd[14833]: Received disconnect from 192.168.1.60: 11: disconnected by user     Aug 26 14:15:22 server C sshd[14785]: pam_unix(sshd:session): session closed for user git


title: Error 8000: Bad sectors when installing Centos 6.5 Minimum

text: I downloaded the ISO Centos 6.5 i386 and burned it onto a disk. When I try to install it on my computer, I get the following with               install or upgrade an existing system          .loading vmlinuz..EDD: Error 8000 reading sector 16929     .EDD: Error 8000 reading sector 17176     .EDD: Error 8000 reading sector 17746     .     Loading initrd.img.......................      Then I allowed it to boot from the local drive. The same thing happened again. It doesn;t seem to be getting anywhere.


title: How to download Debian package's source code?

text: I want to read source code of some package in Debian, how can i do that?


title: Adding a route with time-limited validity?

text: I have read different routing protocols, each one adds routes with limited time validity to routing table. Is there a method in Linux/Ubuntu, without installing any routing daemon, to add a time limited route? If so how? NOTE: I was looking at man pages of `ip route add ...` and **rto_min** looks important for that, but I don't fully understand its function.


title: Re-access NFS volume from OS X Mavericks client after server reboot?

text: My home server, running FreeBSD 10-RELEASE p7, exports NFS volumes to my MacBook Pro, running current OS X Mavericks. The MacBook mounts these via automount as `/net/servername/volume` without any config change from my side. This works fine in general. Now, when the server has rebooted, these volumes become inaccessible. When I try to `cd` into a directory of an NFS volume, I get a `No such file or directory`, although the volume isn't even mounted, so the automounter _should_ be able to just mount it. Some accesses also give me a `Device not configured`. With former versions of OS X, a `SIGHUP` to the `automountd` helped to restore access to the NFS volumes. Now, with Mavericks, the `automountd` does not exist any more, and HUPing the `autofsd` does not help, nor does running `automount -c` to clear the cache. What else, short of a reboot, can help?


title: Postfix favors non virtual to virtual host

text: I have a linux user thomas and 2 domain names domain1.com and domain2.com. I have followed steps to have two virtual mail boxes `/var/mail/vhosts/domain[12].com/` When I test and send an email to thomas@domain2.com, it lands in `/var/mail/vhosts/domain2.com/thomas/...` When I send it to thomas@domain1.com, it lands in /var/mail/thomas. However, `dovecot` looks into `/var/mail/vhosts/%d/%n`. How can I fix that ?


title: Difficulty Installing SSH on Oracle RHEL 5.5

text: I am having difficulty installing SSH on RHEL 5.5 - I have disabled my Firewall and SELinux. I have gone through: Oracle Docs, to see if SSH is enabled, but I got: To check if SSH is enabled:               # /usr/bin/svcadm ssh     -bash: /usr/bin/svcadm: No such file or directory      If SSH is not enabled, then:               # /usr/sbin/svcadm enable ssh     -bash: /usr/sbin/svcadm: No such file or directory      But that did not work either. I have tried installing SSH Server and Client:               # yum -y install openssh-server openssh-clients     Loaded plugins: security     Setting up Install Process     Nothing to do     # yum install openssh-server.x86_64     Loaded plugins: security     Setting up Install Process     Nothing to do      Not sure what is going on here. All I want to do is to run PuTTy and connect remotely to the server. **Update 1:** I have just run:               # /usr/sbin/serviceconf sshd status      And that showed me the Service Configuration screen (on the GUI). I can see that sshd is running:               OpenSSH server daemon     openssh-daemon (pid 2457) is running...      I just restarted it, but still unable to connect using PuTTy. **Update 2:** I have found out how to check to see if the service is running:               # /sbin/service sshd status     openssh-daemon (pid 2516) is running...      I have 2 VM's running the same OS, except the IP addresses are different. VM 1:               eth0      Link encap:Ethernet  HWaddr 08:00:27:5D:FE:C0                 inet addr:10.0.11.28  Bcast:10.255.255.255  Mask:255.0.0.0      VM 2:               eth0      Link encap:Ethernet  HWaddr 08:00:27:5D:FE:C0                 inet addr:10.0.11.27  Bcast:10.255.255.255  Mask:255.0.0.0      I can connect fine with VM 2.


title: how install freebsd in minimum size?

text: I want to install a FreeBSD just to use squid cache server on it. i want to know how can i make this installation to its minimum size? i installed the boot-only ISO file on virtual box, but it took around 600 megabytes installed. by the way there is an old machine so i want it work in this minimum size. is there any script to download just needed files? and which file system is best for squid cache holding partition?


title: Best mechanism for logging in and uploading backup files

text: I have a server that I want to regularly backup. I create backups with encrypted tar using OpenSSL, and now I want to connect to my home server and upload my backed up files there. I need a mechanism, with which I can connect to my home server, log in, and be able to only upload and read the files there. If my server gets compromised, I don't want the hacker to have access to my home server. So I want the account only to be able to write/read files into **only one** directory, without even being able to peek on the system files in my home folder. What's the best transfer mechanism to do that? SSH or FTPS or something else?


title: BC—automatic full precision multiplication

text: High, I need to test my arbitrary precision calculator, and `bc` seems like a nice yardstick to compare to, however, `bc` does truncate the result of each multiplication to what seems to be the maximum scale of the involved operands each. Is there a quick way to turn this off or to automatically set the scale of each multiplication to the sum of scales of the factors so that it doesn't lose any precision? If you have a more elegant solution to this involving something other than `bc`, I would appreciate your sharing it. Example:               $ bc <<< '1.5 * 1.5'     2.2      The real answer is 2.25.


title: Can't install Linux Mint on Macbook Pro (2008)?

text: I have a Macbook Pro that I believe is from 2008. It's harddrive is completely wiped and formatted (FAT32 if I remember correctly) with the only exception of a working installation of rEFIt. Not even an OS. I want to install Linux Mint 17 x64 on it. I've burned two DVDs from the ISO and neither are recognized as bootable media (the CD is spit out every time I try to boot from it). I have two different thumb drives I've been alternating between. They're 16GB and 8GB and I haven't noticed any difference between them. They both seem fully functional. I've spent 20+ hours on this over the weekend and here's what I see and what I know so far. I've tried both USB Universal Installer (UUI) and UNetbootin to image the thumb drives. I've given up on UNetbootin after hearing a few negative things, besides, it didn't work for me. When I plug the UUI drive in, rEFIt adds 3 options: boot with /efi/boot/bootx64.efi, boot with /efi/boot/grubx64.efi, or the generically title "Boot Linux from UUI". If I "Boot Linux from UUI" the screen goes black except for the words "Missing Operating System." I've tried reformatting the thumb drive (a full reformat, not a "quick" one) before reimaging but I get the same error anyway. As for the other two options, they both do the same thing. They present with 3 options (in a black and white terminal style UI). I don't remember the wording exactly but it basically boiled down to "Boot Linux Mint", "Boot Linux Mint (Compatibility Mode)", and "Check storage medium integrity". Selecting "Boot Linux Mint" leads to a never ending black screen. No output, no splash, just an "on" black (there's power to the screen, it didn't turn it off). I've let it sit for 5 or 10 mins with no change. Selecting "Boot Linux Mint (Compatibility Mode)" gets me some output. I'm rather new to linux so I don't recognize much of the output. It looks like some of the normal output from a linux boot. If I understand correctly, the number in brackets at the left hand side of each line of the output is uptime in seconds. This output will go for about 6 seconds before stopping (not always at the same line) and seems to freeze. No blinking cursor, no progress. I've also let this sit for 5 or 10 mins and it never moves on. "Check storage medium integrity" sits at a black screen similar to "Boot Linux Mint". I've tried installing x86 instead of x64, I've tried Mate instead of Cinnamon (didn't have much hope for that one, but I'm desperate), I've tried both USB slots in the laptop. I've tried editing the boot statements and did notice that one of the paths started with `/cdrom/...` but changing it to `usb` or `blk3` (I've learned in the EFI shell that the USB could be accessed by `blk3:`) had no visiable change. I haven't tried a different Linux because I'm really pulling for Mint. What experience I have from trying Linux in VMs is mostly Mint. Installing Ubuntu isn't my end game, but if you'd think it'd help, I'm willing to try it. If I did get Ubuntu installed, I wouldn't know what to do next. For me, it simply isn't as easy as this page makes it sound. I'm learning quite a bit though, and honestly part of me loves it. However it's been long enough. I just want the problem solved. What can I do to help make this installation happen?


title: Compress a folder with tar?

text: I'm trying to compress a folder (`/var/www/`) to `~/www_backups/$time.tar` where `$time` is the current date. This is what I have:               cd /var/www && sudo tar -czf ~/www_backups $time"      I am completely lost and I've been at this for hours now. Not sure if `-czf` is correct. I simply want to copy all of the content in `/var/www` into a `$time.tar` file, and I want to maintain the file permissions for all of the files. Can anyone help me out?


title: How can I make beep sound through speakers(spdif)?

text: I want to `beep` through speakers. I'm using alsa through S/PDIF of ESI Julia. User is in the audio group.               ls /dev/snd     controlC0  midiC0D0  pcmC0D0c  pcmC0D0p  pcmC0D1c  pcmC0D1p  seq  timer      If I try `beep -e /dev/snd/`* - all devices return this:               ioctl: Inappropriate ioctl for device     ioctl: Inappropriate ioctl for device      I'm shure it's `/dev/snd/pcmC0D1p` that I need, it's the only one busy when music is playing.


title: Why does Ubuntu store the daemon logs on /var/log/daemon.log.1 instead of /var/log/daemon.log?

text: Pretty much what the title says. Trying to `cat /var/log/daemon.log` doesn't produce any output, while `cat /var/log/daemon.log.1` does. Why do daemons store logs to the **/var/log/daemon.log.1** file instead of **/var/log/daemon.log**? Is there a specific reason they are storing on the other file? **NOTE:** `ls -l /var/log` shows both of those files have the same permissions and both are owned by a user called `admin`


title: FreeBSD csh, TAB to show available choices?

text: I am a newbie to FreeBSD. How can i configure `csh` or `tcsh` to show available choices by pressing TAB twice, just like bash?


title: Cut colored text ignoring color tags

text: My problem is similar to this one; I want to use `cut` to simulate a `nowrap` on `tmux`, but my output is colored. I know how many columns I want to keep (50) but I don't know how many color tags will be on the output. Cutting with `cut -c-50` generates all kinds of different output, depending on how many escape characters (color tags) are on each line. So, summing it up: can I cut the text with a fixed width ignoring the colors, so that I always end up with 50 colored characters?


title: "tar --exclude-backups" does not exclude files with tilde at end

text: If I have the following directory:               $ ls -a foo     .  ..  a  #a#  a~  b  b.bkp  c  .git  .hg  .svn      and call:               $ tar zcf foo-no-bkp.tar.gz --exclude-backups foo/      The resulting archive still has backup files (even those considered backup files according to the documentation).               $ tar ztf foo-no-bkp.tar.gz      foo/     foo/a~     foo/.svn/     foo/#a#     foo/.hg/     foo/a     foo/.git/     foo/b.bkp     foo/c     foo/b      I am using GNU tar 1.26 on Ubuntu 12.04. What can be wrong? Should it be considered a bug?


title: How to configure gpg to enter passphrase only once per session

text: Is it posible to configure `gpg` in a way that I enter passphrase only once, and it will work for the whole session (I'm using `Ubuntu/XFce`)? I'm not sure how `gpg` works, it seems that the default function is that `gpg` asks `gpg-agent` for the passphrase and the agent runs pin-entry to ask for passphrase. I would like to use pinentry-curses only once per session, so I can paste my passphrase (I have `hex` string from a sentence - I use `echo -n <SENTENCE> | str-hex`) and sign email from Claws Mail without putting passphrase (you can't use pinentry-curses with Claws Mail).


title: Problem with Airprint server for iOS 6

text: I'm trying to set up Airprint server on Raspberry Pi under CUPS. I have done everything like in this tutorial: Configuring the Raspberry Pi as an AirPrint server. Then I have done this: Linux Airprint Server for iOS6 devices to make it compatible with iOS 6 devices, but iPad with iOS 6 can't see it. It only can be seen by another CUPS server on the local network. Any ideas?


title: BAMT wireless connection no DHCPOFFERS received

text: I have managed to get my Edimax EW-7811Un wireless adapter registered and the correct driver installed, but need some help getting it connected to my WPA2 PSK network.               root@bamt-miner:/home/user# lsusb      Bus 001 Device 005: ID 7392:7811 Edimax Technology Co., Ltd EW-7811Un 802.11n Wi  reless Adapter [Realtek RTL8188CUS]          root@bamt-miner:/home/user# lsmod     Module                  Size  Used by     8192cu                542854  0               wlan0     Link encap:Ethernet  HWaddr 80:1f:02:7c:6e:3a               inet6 addr: fe80::821f:2ff:fe7c:6e3a/64 Scope:Link               UP BROADCAST MULTICAST  MTU:1500  Metric:1               RX packets:4 errors:0 dropped:885 overruns:0 frame:0               TX packets:2 errors:0 dropped:245 overruns:0 carrier:0               collisions:0 txqueuelen:1000               RX bytes:198810 (194.1 KiB)  TX bytes:23383 (22.8 KiB)          wlan0:avahi Link encap:Ethernet  HWaddr 80:1f:02:7c:6e:3a               inet addr:169.254.5.114  Bcast:169.254.255.255  Mask:255.255.0.0               UP BROADCAST MULTICAST  MTU:1500  Metric:1      My /etc/network/interfaces looks like this               auto lo     iface lo inet loopback          auto eth0     iface eth0 inet dhcp          auto wlan0     iface wlan0 inet dhcp         wpa-ssid myawesomeinternethotspot         wpa-psk myunbreakablewpa2password     iface default inet dhcp      Is there something that i'm missing?


title: Equivalent of forward/back buttons for unix shell (when navigating directories)?

text: I'd like to be able to type in terminal commands of forward/back especially if I went from a directory with a super-long name to home (and want to return back to the directory with the super-long name).


title: How to create UDF images and burn them to DVD or CDROM?

text: Writing CDs with `cdrecord` and making images with `genisoimage` is no problem. I want to write DVDs in a similar manner, first creating an image, then burning it to disk. This is quite beneficial, since I can inspect the image before burning it to disk. Now, all I've seen, is how to use the `growisofs` command to burn something to DVD, but all how-to's were using ISO9660 for DVDs. But I want to burn UDF images. Before I can burn them, I need to make them, but how do I create UDF images? Also, If you could explain, or link on how to burn BluRay, that would be great, too. All tools must be command line, as I need to work with it, where GUI is no option.


title: how to reboot a frozen FreeBSD server from the serial console?

text: Linux has the "magic sysrq key" to reboot frozen machines remotely, and it works over the serial console, but what about FreeBSD? Is there a way to send a "control-alt-delete" to FreeBSD servers on serial consoles?


title: Where is/should be created wpa_supplicant.conf on Debian

text: I want to set my regulatory domain on debian stable but i can't seem to find `wpa_supplicant.conf` wich resided under `/etc/wpa_supplicant/wpa_supplicant.conf` on fedora. Does anyone know where to find it on debian? Just to clarify i use NetworkManager to manage my networks.


title: Completion of words on the screen as in VIM (Bash or Tmux)

text: How can I configure Bash, Zsh or Tmux to complete the **last matching identifier on the screen**? Consider this common scenario:               $ git fetch     remote: Counting objects: 16, done.     remote: Compressing objects: 100% (9/9), done.     remote: Total 9 (delta 4), reused 0 (delta 0)     Unpacking objects: 100% (9/9), done.     From /opt/git/thunder      * [new branch]      issue540   -> origin/issue547314        e9204cf..4d42c3f  v2.1       -> origin/v2.1      How can I get Bash / Zsh/ Tmux to complete `issue547` on the CLI easily? When I press `Tab` after `$ git checkout is` Git helpfully completes to `issue`, but I must complete the digits by myself because **all the previous digits do in fact match existent Git branches**. In VIM, pressing `Ctrl`+`P` for omnicomplete will complete as the previous match, so in this case `issue547314` will in fact be completed. **How can I get this behaviour in Bash, in Zsh or in Tmux**? I'm currently using Bash 4.2 and Tmux 1.10 on Ubuntu Server (usually 12.04 LTS). I can update to the latest Ubuntu Server LTS (14.04) if needed. **EDIT** : I would not mind any solution that uses Bash, Zsh, or Tmux as long as it is not difficult to use. So `Tab` or `Ctrl`+`P` or some other such shortcut would be fine, but not `Alt`+`Meta`+`Super`+`Shift`+`א`.


title: Text editor with split screen option

text: Is there an editor which has the option to "split the screen" into two or more parts, accessing more than one file (possibly with a file tree) without opening more editor windows at once, and how would one do this (what are the commands). I don't know if I made myself clear, but "split screen" is the only way to describe what I want to achieve. I want to use it to program, having more than one file open for editing. Note that I'm pretty new to both vi and emacs, if these are capable of doing this. Also, if this has to be done through a terminal editor, can it be done in the same terminal, regardless of the screen size?


title: USB flash drive mounts and unmounts automatically

text: Whenever I plug my flash drive into the usb, a message like this window appears on the screen:               Error mounting /dev/sdb1 at /media/sajjad/Linux Mint 16 Cinnamon 64-bit: Command-line `mount -t "ntfs" -o "uhelper=udisks2,nodev,nosuid,uid=1000,gid=1000,dmask=0077,fmask=0177" "/dev/sdb1" "/media/sajjad/Linux Mint 16 Cinnamon 64-bit"' exited with non-zero exit status 13: $MFTMirr does not match $MFT (record 0).     Failed to mount '/dev/sdb1': Input/output error     NTFS is either inconsistent, or there is a hardware fault, or it's a     SoftRAID/FakeRAID hardware. In the first case run chkdsk /f on Windows     then reboot into Windows twice. The usage of the /f parameter is very     important! If the device is a SoftRAID/FakeRAID then first activate     it and mount a different device under the /dev/mapper/ directory, (e.g.     /dev/mapper/nvidia_eahaabcc1). Please see the 'dmraid' documentation     for more details.      What can I do about this problem?


title: AIX 6.1 JFS2 Oracle files system, not using much files system cache

text: I am running Oracle database on AIX 6.1, Oracle using JFS2 file systems. Maxperm is set to 90%. This is busy database server, but it is not using the file system cache (less then 2%). The system has 40GB free memory. Is there a reason why file system cache is not used?


title: How to add unique id to file name in cron job?

text: My cronjob looks like this:               5 3 * * * mysqldump -u root test > /srv/backup/mysql_daily.dump      How can I make filename unique for every time when cronjob writes mysql_daily.dump?


title: Escape on Control key, Control on Capslock key, Capslock on Escape key

text: I'm looking for a method that works in both X and the console with console- setup (e.g. xkboptions, no X-exclusive methods like `xmodmap`). With XKBoptions, combining `ctrl:swapcaps` and `caps:swapescape` does not achieve the desired effect - it puts control on capslock (good) and capslock on both the control and escape keys. For the curious / confused, the rationale is to optimize the keyboard layout by putting more frequently used functions on easy to reach keys. Since I never use capslock anyways I would also settle for a solution that puts Control on CapsLock and Escape on Control and leaves the Escape key as is (leaving me with no CapsLock function).


title: fcron or followup on debian wheezy (stable)

text: I've been using fcron for a long time on debian linux. In oldstable it is still existing fcron_oldstable. So sad in the actual stable `wheezy` there is no fcron_stable.   Are there suggestions which cron to use?   Why was it removed from debian?   In nabble one can find the suggestion to use anacron as an addition - but that solves my problems only for jobs needing to run in periods of days. For some applications, I used `fcron` to run thins in periods of hours.


title: 'tie' [nonexisting] files to programs

text: Recently, I just had an idea which turned out to be pretty useful under certain circumstances. But first some simple explanation: In Perl, you have the option to tie variables to some functions which are called when the variable is used. E.g. for: "Write the changes of that variable to HD every time it is changed". This is pretty useful in a lot of situations. See the perldoc for more detailed explanations: http://perldoc.perl.org/functions/tie.html So I had an idea: Is it possible to bind files in Unix/Linux in general (or on any specific file system, just for curiosity, though I use ext4 mainly) to scripts? One example where this would be really useful would be crontab. This file is not quite simple to maintain automatically if you have a lot of cronjobs and a lot of different persons working on it. Everytime it needs to be changed and so on and so forth. Here, a database would come in handy, where all the information needed is stored + a script which turns the information in the Database to something cron can understand. So, my idea basically is, in this example, not to have the crontab file but instead having it linked to a script, lets say `/root/crontab.pl`. In my mind, every time the OS tries to find the crontab itself, it would instead see: "Oh, file doesn't exist, though. It's tied to this and that. I should execute that script and the output of it will be used as if it was the file", so being totally transparent to the programs itself. Of course, there are other ways to achieve this thing: replacing the file, this and that and so on and so forth, but the basic idea should be kind of clear. I actually haven't found anything like that in my research, though, because I mainly program Perl and I'm used to call that thing "tie" and don't know any other words for that, that might be my fault. So: Is there anything? And, if not: Does anything speak against such a feature? I really think there are plenty situations where that would be awesome.


title: How can I delete a trailing newline in bash?

text: I'm looking for something that behaves like Perl's `chomp`. I'm looking for a command that simply prints its input, minus the last character if it's a newline:               $ printf "one\ntwo\n" | COMMAND_IM_LOOKING_FOR ; echo " done"     one     two done     $ printf "one\ntwo" | COMMAND_IM_LOOKING_FOR ; echo " done"     one     two done


title: How to reference a script-local dictionary in a Vim mapping?

text: Somehow I'm not able to execute the following mapping:               function! s:MySurroundingFunctionIWantToKeep()       let s:Foobar={'foo': 'bar'}       map \42 :echo <sid>Foobar.foo<cr>     endfunction     call s:MySurroundingFunctionIWantToKeep()      I thought it works the same way as it does with a script-local function:               function! s:MySurroundingFunctionIWantToKeep()       function! s:Foobar()         echo 'bar'       endfunction       map \42 :call <sid>Foobar()<cr>     endfunction     call s:MySurroundingFunctionIWantToKeep()      Also freeing `s:Foobar` from `s:MySurroundingFunctionIWantToKeep()` doesn't help, like:               let s:Foobar={'foo': 'bar'}     map \42 :echo <sid>Foobar.foo<cr>      Declaring the `s:Foobar` script-local variable as `g:Foobar` global variable does the trick.


title: Mouse and keyboard not working in qemu emulation of beagleboard with latest angstrom image

text: I was trying to emulate an angstrom image for beaglexm in qemu on my Ubuntu 12.04 laptop. In a new window the image boots up and autologins into GNOME shell. But keyboard and mouse remains unresponsive. I gave the following command:               qemu-system-arm -M beaglexm -m 1024 -sd Angstrom-TI-GNOME-image-eglibc-ipk-v2012.01-core-beagleboard-2012.01.11.img -clock unix -serial stdio -device usb-mouse -device usb-kbd -net nic -net user,hostfwd=::2222-:22      As the emulation starts, following log is generated on the parent terminal               Warning: vlan 0 with no nics     Warning: requested NIC (anonymous, model unspecified) was not created (not supported by this machine?)     U-Boot SPL 2011.12-00006-gb1fd369 (Dec 30 2011 - 09:48:45)     OMAP SD/MMC: 0     reading u-boot.img     .     U-Boot 2011.12-00006-gb1fd369 (Dec 30 2011 - 09:48:45)     OMAP36XX/37XX-GP ES1.1, CPU-OPP2, L3-165MHz, Max CPU Clock 1 Ghz     OMAP3 Beagle board + LPDDR/NAND     I2C:   ready     DRAM:  512 MiB     NAND:  256 MiB     MMC:   OMAP SD/MMC: 0     *** Warning - bad CRC, using default environment     .     ERROR : Unsupport USB mode     Check that mini-B USB cable is attached to the device     In:    serial     Out:   serial     Err:   serial     Beagle xM Rev A     No EEPROM on expansion board     No EEPROM on expansion board     Die ID #51454d5551454d555400000051454d55     Net:   Net Initialization Skipped     No ethernet found.     Hit any key to stop autoboot:  0     The user button is currently NOT pressed.     SD/MMC found on device 0     reading uEnv.txt     .     13 bytes read     Loaded environment from uEnv.txt     Importing environment from mmc ...     Loading file "/boot/uImage" from mmc device 0:2 (xxa2)     3372316 bytes read     Booting from mmc ...     ## Booting kernel from Legacy Image at 80200000 ...        Image Name:   Angstrom/3.0.14/beagleboard        Image Type:   ARM Linux Kernel Image (uncompressed)        Data Size:    3372252 Bytes = 3.2 MiB        Load Address: 80008000        Entry Point:  80008000        Verifying Checksum ... OK        Loading Kernel Image ... OK     OK     .     Starting kernel ...     .     Uncompressing Linux... done, booting the kernel.     omap2_inth_read: Bad register 0x000020     omap_i2c_write: Bad register 0x0000d0     omap_i2c_write: Bad register 0x0000d0     omap_i2c_write: Bad register 0x0000d0     omap_i2c_write: Bad register 0x0000d0     omap_i2c_write: Bad register 0x0000d0      After the image completely boots up into shell, the keystroke is not responsive but logs the following in the parent terminal:               usb-kbd: warning: key event queue full      I tried a solution given here by building latest linaro-qemu from scratch but same result. Also I am not able to ssh into this running image. I issued the following command               ssh -p 2222 root@localhost      It is simply refusing the connection


title: Vi editor behaving randomly while editing

text: When I open a PuTTY session in full screen I can't scroll down and up properly with the down arrow key. It seem to move down the screen and gets stuck somewhere in the middle. When I open PuTTY in small window it works fine for scrolling down or up. But still when I use l key or right arrow key to move right it seems to delete characters and move with tabs.


title: basic division using variable and integer

text: I'm an extreme beginner in bash commands, and am having trouble figuring out a basic division command. `count = redis-cli llen domains;` `echo $count` returns 1000 How can I echo `$count/1000`? I've tried different combinations of:               echo `expr $count / 1000`;     echo $count/1000;     echo ($count / 1000);      Could someone help me craft this command and explain how it should be setup?


title: Run a script (for an app GUI) when logged from NX but limit shell commands on terminal

text: I have a user which will be accessing an app GUI via NX NoMachine. I want to allow this user to execute the command to bring up the app GUI (done automatically by NX) BUT prevent him from executing any other commands from Putty. I've been trying to achieve this using .bash_profile and .bashrc but I've had no luck. How can I do this this?


title: Sending function keys (F1-F12) over SSH

text: I have a Fedora machine that I can SSH to. One of the programs I'd like to use occasionally uses the function keys. The problem is that I'm SSH'ing from an Android tablet (ASUS Transformer Infinity) with a physical keyboard, but no `F1`-`F12` keys. So, until the terminal app I'm using (VX ConnectBot) decides to add them as a feature, I'm looking for a way to send them using the rest of the keyboard. I can use all printable ASCII characters, `Esc`, `Ctrl`, `Shift`, `Enter`, and `Tab`.


title: After OpenSuse upgrade from 12.1 to 12.2 there is no sound

text: After OpenSuse 12.1 64bit upgrade to OpenSuse 12.2 their is no sound however test sound is played in KDE Phonon application. Under the root account sound is working normally.


title: Is there any chance to run ClearCase Remote client under Fedora 14?

text: I'm using Fedora 14 as main dev-env PC and spent time of trying to setup CCRC 7.1 to my desktop. The problem is - while installation when I presses install button - nothing happens. No error message and no actions. As I understood Fedora isn't supported by IBM, is ther any workaround?


title: How to connect Ubuntu 13.10 to TV via HDMI?

text: I have a Lenovo Laptop with Ubuntu 13.10 running and would like to connect it to the TV via HDMI. In the dual-boot Windows, I just have to connect the HDMI cable and the screen is displayed on the TV. How to do that in Ubuntu 13.10? When I connect the HDMI cable nothing happens, and the command `xrandr` shows only one single display (the laptop built-in screen). Do I need to install something else? To run a command to have Ubuntu detect the HDMI output? Restart Ubuntu with HDMI plugged in? ...? Output of `xrandr` while HDMI cable is plugged in:               xrandr: Failed to get size of gamma for output default     Screen 0: minimum 1600 x 900, current 1600 x 900, maximum 1600 x 900     default connected primary 1600x900+0+0 0mm x 0mm        1600x900        0.0*       The output of `lspci | grep VGA` without the HDMI plugged in:               00:02.0 VGA compatible controller: Intel Corporation 3rd Gen Core processor Graphics Controller (rev 09)      The output of `sudo lshw -c video` without HDMI plugged in is:               PCI (sysfs)       *-display UNCLAIMED             description: VGA compatible controller        product: 3rd Gen Core processor Graphics Controller        vendor: Intel Corporation        physical id: 2        bus info: pci@0000:00:02.0        version: 09        width: 64 bits        clock: 33MHz        capabilities: msi pm vga_controller cap_list        configuration: latency=0        resources: memory:c0000000-c03fffff memory:b0000000-bfffffff ioport:3000(size=64)


title: I deleted my user directory, but I'm not sure how

text: I just installed a second hard drive. Previously my partition scheme was /dev/sda1 contained the boot files, and /dev/sda2 contained everything else. Now /dev/sda is the new hard drive, and /dev/sdb is the old hard drive. I want to use /dev/sda as my /home partition. So, I created the GPT partition table in /dev/sda with `gdisk` (single partition), then I formatted /dev/sda1 with `mkfs.ext4`, and then I added /dev/sda1 to my fstab as /home, ext4, "defaults", 0, and 2. I rebooted. I should have rebooted at this point, but I did something stupid and `mv`ed my only user folder, mszegedy, to /. I then `mount`ed /dev/sda1 in /home, and `mv`ed mszegedy back to /home. I then rebooted, to find that /home/mszegedy did not exist. I went looking for it, but I couldn't find any of my files or any folder with the name "mszegedy", so I concluded that I had deleted it. /dev/sda1 was mounted in /home. I tried unmounting /dev/sda1 and remounting it, but the result was the same. The interesting part is when I tried to `useradd -m mszegedy`, no directory named "mszegedy" appeared in /home, and when I tried it again, it said that I already existed. Rebooting turned out the same result. What's going on?


title: Using sed to insert latex commands around headers of a document

text: I have a documen with headers in ALL CAPS, for example:               NAME            env - run a program in a modified environment      and I want to insert               \item[      before the header and               ] \hfill \\      after a header so that the result will be like:               \item[NAME] \hfill \\            env - run a program in a modified environment      I wrote a sed script to add LaTeX formatting for most of the document, but this line of my script is not working properly:               s/\([A-Z]\)*/\\item\[&\] \\hfill \\\\/g      Instead of producing the desired output (above example), I am getting:               ...\item[NAME] \hfill \\     \item[] \hfill \\ \item[] \hfill \\ \item[] \hfill \\ \item[] \hfill \\ \item[] \hfill \\ \i$     \item[] \hfill \\     ...      As you can see, it correctly inserts the formatting around the HEADER, but also replaces everything else in the document. How can I fix this?


title: What does [converted] mean at the bottom of vim?

text: I have a log file, and when I open it via vim, it looks not readable, and it has [converted] at the bottom. What does [converted] mean? Is there a way to fix the format issue so that it is human readable?


title: Filesize difference of same name folders

text: Two different folders, have the same name but they have different filesize. Is there any linux command that can compare two folders and tell me the diff in filesize at the same time?


title: How can I do logging of every screen sessions

text: I am using screen utility for couple of years. I just simply love it. In cloud machines I do have multiple screens as I work with a team. I want to log every commands that have been run in every sessions. Suppose there are three screens ex. A,B and C. I want to get A's all sessions commands and so on. It would be really great if you can give me a hint or details. Thanks in advance.


title: fstab doesn't mount after boot of a virtual machine

text: I created virtual machine out of WordPress turnkey appliance (I believe it's based on Ubuntu) inside Virtual Box. I am able to mount a folder on turnkey from the host (Windows7) manually. So I added this to the /etc/fstab `//10.1.1.4/d/data/Dropbox/onlinebackup/projects/newplugin /var/www/wordpress/wp- content/plugins/newplugin cifs username=user,password=password ` but the mount doesn't work after starting the virtual machine. Interestingly when the machine is up and running I can ssh there and run `mount -a` and the Windows directory is mounted. Any idea what is happening and how to fix it?


title: Kernel pppd task hung after running over serial port

text: I am trying to run the `ppp` daemon on the console port of my board which has p2020 processor with Linux kernel 2.6.32. After running `ppp` interface `ppp0` is not coming up and I get an error `pppd blocked for more than 120 sec`. I am not able to debug this. How can I prevent this error from occurring? syslog output given below.               INFO: task pppd:2957 blocked for more than 120 seconds.     "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.     pppd D 0fe61c98 0 2957 2953 0x00000002     Call Trace:     [eec93d10] [c021ace4] n_tty_set_termios+0x3f8/0x59c (unreliable)     [eec93dd0] [c0007920] __switch_to+0x54/0xb0     [eec93de0] [c0381e8c] schedule+0x1f0/0x2f8     [eec93e20] [c021f308] tty_ldisc_ref_wait+0x6c/0xb0     [eec93e60] [c0218888] tty_ioctl+0x13c/0x9dc     [eec93e90] [c00b0aa4] vfs_ioctl+0x34/0x8c     [eec93ea0] [c00b0cc8] do_vfs_ioctl+0x88/0x72c     [eec93f10] [c00b13ac] sys_ioctl+0x40/0x74     [eec93f40] [c000f998] ret_from_syscall+0x0/0x3c     INFO: task pppd:2957 blocked for more than 120 seconds.     "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.     pppd D 0fe61c98 0 2957 2953 0x00000002


title: Program to show keystrokes (shortcuts) on display

text: I'm going to make a presentation about a software product and it has some key shortcuts, that I want to show. Is there a program, which displays the keyboard-shortcuts, that I have used?


title: Why do people call Linux a kernel rather than an OS?

text: Why do people refer to Linux as a kernel rather than an operating system? To the best of my knowledge, the kernel is one part of the operating system.


title: Why does a desktop launcher does not start my app, while command line does?

text: I installed a (proprietary) software in /opt and I am able to run it perfectly using command line. Then I'd like to create a desktop icon to launch it : on my Mint distro I use "create_launcher" However, when clicking on my fresh icon, nothing happens. Why ?


title: Checking mail and running a script without downloading

text: I'm writing a script to run certain processing activities (mainly moving some data files to another machine where they can backed up), but I only know when to trigger the copy when a mail is delivered to a specific folder in an IMAP mailserver (which is outside my network). So I'm looking for something that can _only_ perform a mail check and _in case of new mail_ trigger the script. I do not want to download the contents of the IMAP folder unless there is no other choice. Can `fetchmail`, `getmail` or `offlineimap` do this, or is there anything else?


title: Cron: Client does not have permissions to send as this sender

text: Platform: Arch Linux Cron: cronie Mail: msmtp I discovered that sending cron output to a mailbox hosted by Office 365 produced the following error, even though sending mail through the CLI was working fine:               Apr 01 04:41:10 prod crond[306]: msmtp: the server did not accept the mail     Apr 01 04:41:10 prod crond[306]: msmtp: server message: 550 5.7.1 Client does not have permissions to send as this sender     Apr 01 04:41:10 prod crond[306]: msmtp: could not send mail (account default from /etc/msmtprc)     Apr 01 04:41:10 prod crond[306]: msmtp: cannot log to /var/log/msmtp.log: cannot open: Permission denied     Apr 01 04:41:10 prod crond[306]: msmtp: log info was: host=smtp.office365.com tls=on auth=on user=cron@domain.com from=cron@domain.com recipients=recipient@domain.com smtpstatus=550 smtpmsg='550 5.7.1 Client does not have permissions to send as this sender' errormsg='the server did not accept the mail' exitcode=EX_UNAVAILABLE     Apr 01 04:41:10 prod CROND[3212]: (postgres) MAIL (mailed 29 bytes of output but got status 0x0045                                         )     Apr 01 04:41:10 prod CROND[3212]: pam_unix(crond:session): session closed for user postgres


title: CentOS 6 "Default" Installation Options

text: Can someone tell me the difference between a Desktop Install, a Basic Server install, and a Minimal Install? During installation, it doesn't give a description and I can't find documentation on it either. This is for a CentOS 6 installation.


title: NFS mount to a subdirectory of already mounted directory

text: We have a strange scenario (AIX 5.3) - There is a directory `/mnt` to which an NFS share from windows server1 is mounted Then there is another directory `/mnt/subdir1` to which NFS share from windows server2 is mounted. It is noticed that the second mount `/mnt/subdir1` fails on system restarts. I can manually mount this location using `mount` command. Is the failure due to nested nature of the /mnt directory structure? In `/etc/filesystems` - entry for `/mnt` appears before `/mnt/subdir1`


Is there a simple linux command that will tell me what my display manager is? I'm using Xfce. Are different desktop environments usually affiliated with different display managers?


title: "unix:10.0" in DISPLAY variable

text: We are using Oracle Secure Global desktop to provide remote access to the Solaris desktop. It sets the `DISPLAY` variable to `unix:10.0`. It seems to be working as if the `DISPLAY` was set to `localhost:10.0`. What does "unix" mean here? Is it a common usage or something specific to SGD? As far as I know, usually `DISPLAY` is set in the form `[hostname or IP]:[screen]`.


title: How to make Firefox open mailto: links with mutt in terminal

text: All I want to do is pass `mailto:` links to `urxvt -e mutt -F ~/path/to/muttrc` with the rest of the mailto: URL appended. I've tried every script I can find online that purports to do this, from simple:               #!/bin/sh     exec "urxvt -e mutt -F /path/to/muttrc \"$@\""      to complex, and the most they do is open a terminal window for a split second before it automatically vanishes again (and there is no evidence of a running mutt process). Any suggestions?


title: grep -- removing text after delimiter token

text: I have a file in which I need to eliminate everything after the first `;` on every line. So a file like this:               sdfsdsdf;     fsdfsddf;sdfsd;      Will result in this:               sdfsdsdf     fsdfsddf      I have looked into `grep` and `sed`. I would appreciate an answer incorporating either of these commands.


title: How to boot on a ramdisk?

text: I'm working on a linux embedded for a custom board with a ARM9 processor. My kernel version is : 2.6.33 I'm trying to boot on a ramdisk, kernel correctly mount the file system but failed to execute /init               VFS: Mounted root (ramfs filesystem) on device 0:12.     Freeing init memory: 108K     Warning: unable to open an initial console.     Failed to execute /init.  Attempting defaults...     Kernel panic - not syncing: No init found.  Try passing init= option to kernel.      This is Kernel command line: `console=ttyS0,115200n8 root=/dev/ram init=/init rw rootfstype=ramfs rootwait` I tried to use a ramdisk with only a "hello world" program as init script, it doesn't work to. I created my ramdsik image following this http://www.glomationinc.com/doc/HowToEditRAMDisk.PDF Any ideas ?


title: How do you work with old servers?

text: I've recently fallen into doing more work on LAMP servers, which is pretty new to me. At first it wasn't a problem migrating my preference files, but as I've grown and learned more, my preferences and workflow has become more specific (and less portable*). This morning I was asked to work on an old Red Hat 4 server and it's... it's just so old I don't know what to do with it. Vim 6? Everything installed through RPMForge? Can't even install `tree` without having to add repositories? No actual user accounts except root? `/sbin/` and `/usr/sbin/` aren't even in the root user's path? This thing was installed once and never modified. Every installed package is from the ice age. The first ice age. So what do you do in this situation? Should I even bother trying to work **on** on the server, or is there a better way to go about this? * - really the only thing that broke is support for the Jellybeans color theme, and my usage of Vim tabs. edit - I guess the way I posed it was unclear, but the emphasis in the question should be on _you_. What I'm really trying to get a sense for is what other people would do in a similar situation. Remember: I'm consulting. It's not my job to reinstall the server. It's not my job to do a security audit and harden the server. It's my job to take vague requirements from a non-technical client running a very old server and make them happen in as little time as possible. That's it. I'm a developer, not a sysadmin; it's all pretty new to me, and getting it up to speed properly would take more time than I can afford to spend. It's been in production for years; I'm just making modifications. Do I _want_ this server to be improved? Of course! Would I _want_ this project to be something I'm proud of? Yes! Is that going to happen? No. I'm maintaining old software that I have zero interest in that doesn't even receive a lot of traffic. I just want to do the task in a comfortable way without too much hassle. edit 2 - after a bit of searching and fiddling around, I eventually mounted what I need locally with sshfs and MacFuse. That way I can stay in the terminal and use a mix of local and remote tools based on what I'm doing.


title: Do I need to remove all "java|jre" packages from my system to be secure from java vulnerabilities?

text: Currently I have these installed on my Scientific Linux 6.3:               [root@localhost ~]# rpm -qa | egrep -i 'java|jre'     java-1.7.0-openjdk-1.7.0.9-2.3.7.1.el6_3.x86_64     java-1.6.0-openjdk-1.6.0.0-1.56.1.11.8.el6_3.x86_64     tzdata-java-2012j-1.el6.noarch     [root@localhost ~]#       Do I need to remove then to be safe from the recent Java vulnerabilities? (If I try to remove the java-1.6.0-openjdk.. then it wants to remove libreoffice too..) Or the vulnerabilities are just related to java webbrowser plugins?


title: faster alternative to cp -a

text: For a simple transfer of /home to another disk i use `cp -a` that seems to me an extremely slow way. Should like know a more efficient way to complete the task. I have /home mounted as logical volume, but the target disk is not an LVM system


title: batch-install packages accordings to the list

text: In order to install a copy of fedora system i want to know how to install packages previously listed with `yum --list installed>mypkglist` I like do the task in batch mode.


title: Priviledge separation for Firefox (aka: how to secure webbrowsing)

text: I do this on Scientific Linux 6.3 (to implement it, it requires a minimal Linux knowledge): ### Shared directory for downloads Remember you can only copy from or to this directory, never "move" files to here or move files from here!               adduser ffuser     passwd ffuser # use a very good and very long password     groupadd ffgroup     vi /etc/group # add ffuser and the normal user to the end of the ffgroup line. after editing a users group, you need to re-login with it..     mkdir /home/Downloads; chmod -R 2770 /home/Downloads; ln -s /home/Downloads /home/NORMALUSERHERE/Desktop/Downloads; chown ffuser:ffgroup /home/Downloads/     echo "umask 007" >> /home/ffuser/.bashrc     ssh-copy-id -i /home/NORMALUSERHERE/.ssh/id_rsa.pub '-p PORTNUMBER ffuser@127.0.0.1'      ### With root               vi /etc/ssh/sshd_config     PasswordAuthentication no     PubkeyAuthentication yes     PermitRootLogin without-password     ListenAddress 127.0.0.1     Port SOMEHIGHPORTNUMBERHERE      ### Download firefox with this oneliner               URL="https://ftp.mozilla.org/pub/mozilla.org/firefox/releases/latest/linux-x86_64/en-US/"; URLEND=`curl -s $URL | sed 's/"/\n/g' | fgrep '.tar' | sort -nr | egrep -v '/a|align|/td' | head -1`; curl "${URL}${URLEND}" > ${URLEND}"      ### Don't show ffuser/root at login [using GNOME2]               sed -i 's/\[greeter\]/\[greeter\]\nExclude=ffuser,root/g' /etc/gdm/custom.conf     cat /etc/gdm/custom.conf      ### Flash Only use flash if really needed.               yum install flash-plugin     # run this with ffuser     mkdir -p "/home/`whoami`/.firefox/plugins"; ln -s "/usr/lib64/flash-plugin/libflashplayer.so" "/home/`whoami`/.firefox/plugins"      ### Use these as DEFAULT Firefox add-ons               https://addons.mozilla.org/en-US/firefox/addon/wot-safe-browsing-tool/ # WOT settings -> Searching -> Show only negative ratings # FOR REAL SECURITY don't use this plugin, because it send out url's that you are visiting..     https://addons.mozilla.org/en-US/firefox/addon/adblock-plus/     https://www.eff.org/https-everywhere     https://addons.mozilla.org/en-US/firefox/addon/flashblock/ # if you are using flash.. but don't use it.. don't install flash..     https://addons.mozilla.org/en-US/firefox/addon/cookie-whitelist-with-buttons/      ### Add-ons for extra security               https://addons.mozilla.org/en-US/firefox/addon/noscript/ # tick the "restrict on trusted sites too" in the "embedded objects" tab     # in 2013.03 convergence didn't worked very well: https sites were slow with it, etc...     http://convergence.io/ # Firefox wouldn't start after installing convergence for the first time, just "kill" Firefox, start it again and then it will be ok :)      ### about:config               app.update.silent     true          network.http.pipelining     true          network.http.proxy.pipelining     true          network.dns.disableIPv6     true          # only if using Linux/BSD     browser.download.manager.scanWhenDone     false          browser.cache.disk.capacity     262144          browser.cache.offline.capacity     262144          layout.spellcheckDefault     2          browser.sessionstore.max_tabs_undo     2          browser.sessionstore.max_windows_undo     2          plugins.hide_infobar_for_missing_plugin     true          # THESE 5 ARE IMPORTANT FOR SECURITY REASONS     geo.enabled     false          network.http.sendRefererHeader     0          pdfjs.disabled     true          # only if using noscript!     noscript.showPermanent     false          New -> String     general.useragent.override     Mozilla/5.0 (Windows NT 6.1; WOW64; rv:19.0) Gecko/20100101 Firefox/19.0     # just don't use your real user agent..      ### Disable flash cookies For privacy, if Flash is installed. Go to:               https://www.youtube.com/      and right click a flash element               Right click -> Global Settings... -> Storage TAB -> Block all sites from storing information on this computer     Camera and Mic TAB -> Block all sites from using the camera and microphone     Playback -> Block all sites from using peer-assisted networking      ### Other important configs   * Options->Advanced->Network->Offline storage 256 MB   * Options->Advanced->General->Accessibility-> Uncheck Always check to see if Firefox is the default browser on startup Uncheck Use smooth scrolling   * Remove Unused Search Engines! Check `about:plugins`. There shouldn't be any plugins.               rm /usr/lib/mozilla/plugins/*      After this, you can start Firefox with:               ssh -p 52317 ffuser@127.0.0.1 -X /home/ffuser/.firefox/firefox-bin > /dev/null 2>&1      Firefox has built-in auto update. A few usefull websites:   * https://panopticlick.eff.org/   * http://centralops.net/asp/co/BrowserMirror.vbs.asp   * http://samy.pl/evercookie/   * http://whatsmyuseragent.com/ These questions are all related to this one topic (that's why I didn't started several questions):   1. How could this setup be tricked from security side? Are there any tips/tricks to give less permissions to "ffuser"?   2. Firefox still runs after closing it. How to close the Firefox process if there isn't any Firefox windows? (It's not causing any problems, just frustrating)   3. There isn't any sound with "ssh -X" from Firefox. How do fix this?


title: why daily cron isn't running on CentOS 6?

text: I have a daily cronjob set up on CentOS 6 OS which should look after the log rotation job. The file is /etc/cron.daily/logrotate and it's contents are               #!/bin/sh     /usr/sbin/logrotate /etc/logrotate.conf >/dev/null 2>&1     EXITVALUE=$?     if [ $EXITVALUE != 0 ]; then         /usr/bin/logger -t logrotate "ALERT exited abnormally with [$EXITVALUE]"     fi     exit 0      I expected that logs will be rotated as being activated by this daily cronjob but it isn't. I see no evidence that the daily cronjob is run from the log file /var/log/cron. However, the hourly jobs are run as shown by the log file. I have added a line on /etc/crontab file               # run-parts     02 4 * * * root run-parts /etc/cron.daily       but that made no change. I have no idea why this log rotation isn't working. I would be pleased if someone can shed some light.


title: Roundcube Web Mail client to hide folders

text: Roundcube web mail client works perfectly. But the problem is that I want to hide INBOX subfolders (they are without content) globally. There are separate folders which are used and they are with content. It's possible to unsubscribe them in client machine, but it's big job with all users. ![enter image description here](http://i.stack.imgur.com/k65Ws.png) Running Dovecot IMAP server. Configuration:               // store draft message is this mailbox     // leave blank if draft messages should not be stored     // NOTE: Use folder names with namespace prefix (INBOX. on Courier-IMAP)     $rcmail_config['drafts_mbox'] = 'Drafts';          // store spam messages in this mailbox     // NOTE: Use folder names with namespace prefix (INBOX. on Courier-IMAP)     $rcmail_config['junk_mbox'] = 'Junk';          // store sent message is this mailbox     // leave blank if sent messages should not be stored     // NOTE: Use folder names with namespace prefix (INBOX. on Courier-IMAP)     $rcmail_config['sent_mbox'] = 'Sent';          // move messages to this folder when deleting them     // leave blank if they should be deleted directly     // NOTE: Use folder names with namespace prefix (INBOX. on Courier-IMAP)     $rcmail_config['trash_mbox'] = 'Trash';          // display these folders separately in the mailbox list.     // these folders will also be displayed with localized names     // NOTE: Use folder names with namespace prefix (INBOX. on Courier-IMAP)     //$rcmail_config['default_imap_folders'] = array('INBOX', 'Drafts', 'Sent', 'Junk', 'Trash');          //$rcmail_config['default_imap_folders'] = array('');