Why does only one network adapter ever get DHCP IP address?

I am using a Panda Board which is running a build of Angstrom. The Panda Board has an in build Ethernet port and this is working fine, getting a DHCP address successfully. I am going to be housing it in a larger container than the one supplied, which won't give me access to the internal port, so I am trying to use a USB Network Adapter. Angstrom correctly identifies the adapter but it never gets a DHCP address. I've tried connecting both and just the USB one, but only the internal one will ever get an address. Can someone help me? I'm new to linux! Output of `ifconfig -a`:               eth0      Link encap:Ethernet  HWaddr 2A:40:E0:FD:3B:0A                 inet addr:172.17.33.163  Bcast:172.17.33.255  Mask:255.255.255.128               UP BROADCAST RUNNING MULTICAST  MTU:1492  Metric:1               RX packets:112 errors:0 dropped:0 overruns:0 frame:0               TX packets:59 errors:0 dropped:0 overruns:0 carrier:0               collisions:0 txqueuelen:1000                RX bytes:14645 (14.3 KiB)  TX bytes:11844 (11.5 KiB)          eth2      Link encap:Ethernet  HWaddr 00:0E:C6:88:F7:C6                 UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1               RX packets:62 errors:0 dropped:0 overruns:0 frame:0               TX packets:14 errors:0 dropped:0 overruns:0 carrier:0               collisions:0 txqueuelen:1000                RX bytes:7116 (6.9 KiB)  TX bytes:4844 (4.7 KiB)          lo        Link encap:Local Loopback                 LOOPBACK  MTU:16436  Metric:1               RX packets:0 errors:0 dropped:0 overruns:0 frame:0               TX packets:0 errors:0 dropped:0 overruns:0 carrier:0               collisions:0 txqueuelen:0                RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)          wlan0     Link encap:Ethernet  HWaddr 2A:00:E0:FD:3B:0A                 UP BROADCAST MULTICAST  MTU:1500  Metric:1               RX packets:0 errors:0 dropped:0 overruns:0 frame:0               TX packets:0 errors:0 dropped:0 overruns:0 carrier:0               collisions:0 txqueuelen:1000                RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)      The contents of `/etc/network/interfaces`:               wlan0     iface wlan0 inet dhcp         wpa-conf /etc/wpa_supplicant.conf         wpa-driver wext                     iface atml0 inet dhcp          # Wired or wireless interfaces     auto eth0     iface eth0 inet dhcp          auto eth1     iface eth1 inet dhcp          auto eth2     iface eth2 inet dhcp          auto eth3     iface eth3 inet dhcp          # Ethernet/RNDIS gadget (g_ether) or LAN9514     usb0     iface usb0 inet dhcp          usb1     iface usb1 inet dhcp          usb2     iface usb2 inet dhcp          usb3     iface usb3 inet dhcp          # Bluetooth networking     iface bnep0 inet dhcp


Being not admin user how to install local GCC instead of provided?

So I came into my classrom Debian is installed, and gcc 4.1. I want to install (compile from sources is an option - I have time..) for my self GCC 4.7 and adress it in bash as gcc anywhere. Is such thing possible and how to do it?


Is it possible to install Windows and Linux on the same partition?

Just wonder is it possible to install Windows and Linux on a ntfs partition and have both OSes share a root filesystem as either one is booted? Then the partition will have /bin, /sbin, /home, /lib and "Program Files" ,"Windows" and "Document and Settings" in the same place! Will Windows and Linux both be bootable in this file system layout?


Predict filename before downloading from a URL, in shell script

I have a shell script that downloads files from a list using `wget`, and resumes automatically if there is any non-critical error (because of unstable WIFI during storms). The problem is, I want to write to a `filename.part` file and then remove the .part extension once completed (overwriting and such are handled at that point). This works for simple urls like `http://myserver.org/myfile.doc`, but completely fails to guess a filename like `http://myserver.org/index.php?file_id=foo`. (my method would try to write to `index.php.part` instead of the desired result) I can have wget get the "final" filename automatically and write to it, but that won't let me use the `-O` option to save with a different extension, it leaves no control. So my question is, is there any standard way (or tool) to get the "final" filename in a download URL so I can write to a file with the same name but an added extension? (using `-O` in wget or `-o` in curl, such as `wget $URL -O "$URL_GUESSED_FILENAME.part"`) My tools are either wget or curl, no preference even if I currently use wget. Alternatively, if there's a way to do it in Python, I can accept that too.


Binary compatibility between Mac OS X and Linux

Brace yourselves, this question will likely appear naive and/or foolish, seeing as I am relatively new to the inner workings of unix like systems, and programming in general. Ready? Ok! I will go through about 3 levels of ludicrosity, increasing as I go along. * * * We have two systems with similar hardware (main point being the processor, let us say a standard intel core 2 duo). One is running (insert your linux distro here: Ubuntu will be used henceforth), and the other is running let's say Mac OS X. One compiles an equivalent program, Let us say something like:               int main()     {         int cat = 33;         int dog = 5*cat;         return dog;     }      The code is extremely simple, because I don't want to consider the implications of shared libraries yet. When compiled on the respective systems. Is not the main difference between the output a matter of ELF vs Mach-O? If one were to strip each binary of the formatting, leaving a flat binary, wouldn't the disassembled machine instructions be the same? (with perhaps a few differences depending on the compilers habits/tendencies). **1.)** If one were to develop a program to repackage the flat binary produced from our Ubuntu system, in the Mach-O formatting, would it run in the Mac OS X system? Then, if one only had the compiled binary of the supposed program above, and one had this mystical tool for repackaging flat binaries, would simple programs be able to run on the Mac OS X system? * * * Now let us take it a bit further. We now have a program with source such as:               #include <stdio.h>     int main()     {         printf("I like tortoises, but not porpoises");         return 0;     }      **2.)** Assuming this program is compiled and statically linked, would our magical program still be able to repackage the raw binary in the Mach-O format and have it work on mac os X? Seeing as it would not need to rely on any other binaries, (for which the mac system would not have in this case) * * * And now for the final level; **3.)** What if we used this supposed program to convert all of the necessary shared libraries to the Mach-O format, and then instead compiled the program above with dynamic linking. Would the program still succeed to run? That should be it for now, obviously each step of absurdity relies on the previous base, to even make sense. so If the very first pillar gets destroyed, I doubt there would be much merit to the remaining tiers. I definitely would not even go as far as to think of this with programs with GUI's in mind. Windowing systems would likely be a whole other headache. I am only considering command line programs at this stage. Now, I invite the world to correct me,and tell me everything that is wrong with my absurd line of thinking.


How to know how long a process has been running?

> **Possible Duplicate:**   >  How to check how a long a program has been running? I am interested in doing this purely using bash.


Odd problem regarding 'apt-get update'

I was having some serious network troubles, and now running `sudo apt-get update` gives this error:               ...     Hit ftp://ftp.is.co.za experimental/contrib i386 Packages     Reading package lists... Error!     E: Encountered a section with no Package: header     E: Problem with MergeList /var/lib/apt/lists/ftp.is.co.za_debian_dists_testing_main_binary-i386_Packages     E: The package lists or status file could not be parsed or opened.      It's an odd one because I've never seen it before. Have you experienced it? How can I fix it?


anisha@linux-y3pi:~/> google-earth      ./googleearth-bin: error while loading shared libraries: libGL.so.1: cannot open shared object file: No such file or directory          anisha@linux-y3pi:~/> locate libGL     /opt/google/earth/free/libGLU.so.1     /usr/lib64/libGL.so     /usr/lib64/libGL.so.1     /usr/lib64/libGL.so.1.2     /usr/lib64/libGLU.so.1     /usr/lib64/libGLU.so.1.3.070802          anisha@linux-y3pi:~/> uname -a     Linux linux-y3pi 2.6.34-12-desktop #1 SMP PREEMPT 2010-06-29 02:39:08 +0200 x86_64 x86_64 x86_64 GNU/Linux      > > On OpenSUSE, try zypper in Mesa-32bit to install the 32 bit version of the > library.               linux-y3pi:# zypper in Mesa-32bit     Retrieving repository 'google-chrome' metadata [\]     Failed to download /repodata/repomd.xml from http://dl.google.com/linux/chrome/rpm/stable/x86_64     Abort, retry, ignore? [a/r/i/?] (a): r     Retrieving repository 'google-chrome' metadata [|]     Failed to download /repodata/repomd.xml from http://dl.google.com/linux/chrome/rpm/stable/x86_64     Abort, retry, ignore? [a/r/i/?] (a): i     Retrieving repository 'google-chrome' metadata [error]     Repository 'google-chrome' is invalid.     Can't provide /repodata/repomd.xml : User-requested skipping of a file     Please check if the URIs defined for this repository are pointing to a valid repository.     Warning: Disabling repository 'google-chrome' because of the above error.     Retrieving repository 'google-earth' metadata [/]     Failed to download /repodata/repomd.xml from http://dl.google.com/linux/earth/rpm/stable/i386     Abort, retry, ignore? [a/r/i/?] (a): r     Failed to download /repodata/repomd.xml from http://dl.google.com/linux/earth/rpm/stable/i386     Abort, retry, ignore? [a/r/i/?] (a):


bash script is trying to execute a variable

I have a very short Bash script, like this:               variable="3 things"     if $(echo $variable|grep "^[0-9]\{1,\}") #if $variable begins with [0-9]     then         echo $(echo $variable|sed 's/ .*$//')     else         echo "0"     fi      `$variable` will eventually be the output of a command which will be a string beginning with either a number or the word "No ". I want the script to return just the number or else the digit 0. I'm getting the error, `script.bash: line 2: 3: command not found` and I don't understand why bash is trying to execute "3" as a command. Any insight would be appreciated (or suggestions on better ways to write this---I'm not good with bash script). Thanks


What do '+b#' packages versions mean in Debian?

Today I checked out my upgrades and saw 63 upgrades in Debian testing. Fine. I got curious because most of them are held back, so I used `-V` to see the versions. To my surprise, most of them where upgrading to `+b1` or `+b2` versions. Like a good boy I do `apt-get changelog libc6` (yeah, that one is important) just to see that the changelog has no `+b1` version. So, what are these versions for?               sudo apt-get -V upgrade     Reading package lists... Done     Building dependency tree            Reading state information... Done     The following packages have been kept back:        gdm3 (3.4.1-9 => 3.4.1-9+b1)        libalgorithm-diff-xs-perl (0.04-2+b2 => 0.04-2+b3)        libapt-pkg-perl (0.1.29 => 0.1.29+b1)        libcairo-perl (1.103-2 => 1.103-2+b1)        libclass-c3-xs-perl (0.13-1+b2 => 0.13-1+b3)        libclone-perl (0.34-1 => 0.34-1+b1)        libcrypt-blowfish-perl (2.14-1 => 2.14-1+b1)        libcrypt-openssl-bignum-perl (0.04-4 => 0.04-4+b1)        libcrypt-ssleay-perl (0.58-1 => 0.58-1+b1)        libdbd-mysql-perl (4.023-1 => 4.023-1+b1)        libdbi-perl (1.628-1 => 1.628-1+b1)        libdigest-crc-perl (0.18-1+b1 => 0.18-1+b2)        libdigest-md4-perl (1.9+dfsg-1 => 1.9+dfsg-1+b1)        libfile-fcntllock-perl (0.14-2 => 0.14-2+b1)        libfile-fnmatch-perl (0.02-1+b2 => 0.02-1+b3)        libglib-perl (1.301-1 => 1.301-1+b1)        libgtk2-perl (1.247-2 => 1.247-2+b1)        libhtml-parser-perl (3.71-1 => 3.71-1+b1)        libio-pty-perl (1.08-1+b2 => 1.08-1+b3)        libjson-xs-perl (2.340-1 => 2.340-1+b1)        liblist-moreutils-perl (0.33-1+b1 => 0.33-1+b2)        liblocale-gettext-perl (1.05-7+b1 => 1.05-7+b2)        libmath-bigint-gmp-perl (1.37-2 => 1.37-3)        libnet-dbus-perl (1.0.0-2 => 1.0.0-2+b1)        libnet-dns-perl (0.68-1.1 => 0.68-1.2)        libnet-pcap-perl (0.17-1 => 0.17-1+b1)        libnet-rawip-perl (0.25-1+b2 => 0.25-1+b3)        libnet-ssleay-perl (1.55-1 => 1.55-1+b2)        libpam-systemd (44-12 => 44-12+b1)        libpango-perl (1.224-2 => 1.224-2+b1)        libparams-util-perl (1.07-1 => 1.07-1+b1)        libpurple0 (2.10.7-2 => 2.10.7-2+b1)        libsocket-perl (2.011-1 => 2.011-1+b1)        libsocket6-perl (0.23-1+b2 => 0.23-1+b3)        libsub-name-perl (0.05-1+b2 => 0.05-1+b3)        libsvn1 (1.6.17dfsg-4.1+b1 => 1.7.9-1+nmu4)        libterm-readkey-perl (2.30-4+b2 => 2.30-4+b3)        libterm-readline-gnu-perl (1.20-2+b1 => 1.20-2+b2)        libtext-charwidth-perl (0.04-7+b1 => 0.04-7+b2)        libtext-iconv-perl (1.7-5 => 1.7-5+b1)        libuuid-perl (0.02-5 => 0.02-5+b1)        libxml-libxml-perl (2.0010+dfsg-1 => 2.0010+dfsg-1+b1)        libxml-parser-perl (2.41-1+b1 => 2.41-1+b2)        libyaml-libyaml-perl (0.38-3 => 0.38-3+b1)        perl (5.14.2-21 => 5.18.1-3)        perl-base (5.14.2-21 => 5.18.1-3)        perl-modules (5.14.2-21 => 5.18.1-3)        perl-tk (804.031-1 => 804.031-1+b1)        subversion (1.6.17dfsg-4.1+b1 => 1.7.9-1+nmu4)        systemd (44-12 => 44-12+b1)        vim (7.3.923-3 => 7.3.923-3+b1)        vim-common (7.3.923-3 => 7.3.923-3+b1)        vim-gtk (7.3.923-3 => 7.3.923-3+b1)        xchat (2.8.8-7.1 => 2.8.8-7.1+b1)        xserver-xorg-core (1.12.4-6.1 => 1.12.4-6.2+b1)     The following packages will be upgraded:        libc-dev-bin (2.17-92 => 2.17-92+b1)        libc6 (2.17-92 => 2.17-92+b1)        libc6-dbg (2.17-92 => 2.17-92+b1)        libc6-dev (2.17-92 => 2.17-92+b1)        libc6-i686 (2.17-92 => 2.17-92+b1)                    apt-cache policy libc6     libc6:       Installed: 2.17-92       Candidate: 2.17-92+b1       Version table:          2.17-92+b1 0             500 http://ftp.us.debian.org/debian/ testing/main i386 Packages             500 http://http.debian.net/debian/ jessie/main i386 Packages      *** 2.17-92 0             100 /var/lib/dpkg/status                    apt-get changelog libc6     eglibc (2.17-92) unstable; urgency=low            * kfreebsd/local-sysdeps.diff: update to revision 4839 (from glibc-bsd).           -- Petr Salinger <petr.salinger@seznam.cz>  Wed, 31 Jul 2013 22:38:47 +0100          eglibc (2.17-91) unstable; urgency=low            [ Petr Salinger ]       * switch libpthread implementation on kfreebsd-* to fbtl.         Closes: #703545. Closes: #665287. Closes: #683825. Closes: #489066.       * split some parts of kfreebsd/local-linuxthreads29.diff         into  kfreebsd/local-nscd-no-sockcloexec.diff and               kfreebsd/local-linuxthreads-tlsdesc.diff       * add kfreebsd/local-fbtl.diff and kfreebsd/local-fbtl-depends.diff       * kfreebsd/local-sysdeps.diff: update to revision 4809 (from glibc-bsd).         Closes: #718181. Addresses: #717032 in new binutils.       * update testsuite-checking/expected-results-*-kfreebsd-gnu-*         by fbtl tests that are known to fail.     (snip)


diff binary files of different sizes?

Is there a neat way to see the difference between two binary files? They are mostly the same, but some bytes are changed, and one of the files has sequences inserted in some places. Diffing the output of `xxd` would work if bytes were only changed, and not inserted.


Why is my EC2 server's time off by ~10 seconds every day?

I have what I believe is a system file, `/etc/cron.daily/ntpupdate` which runs   `ntpdate ntp.ubuntu.com` daily to sync with the network time. Every day it generates output very similar to this:               /etc/cron.daily/ntpupdate:     16 Jan 06:30:42 ntpdate[21446]:     step time server 91.189.94.4 offset -12.646804 sec      I'm not positive what the `91.189.94.4` means but I'm pretty sure `-12.646804 sec` means that my server is off by around 12 seconds. But I don't know why it is off by around the same amount every day. This is an Amazon EC2 instance running Ubuntu. I can only guess that either it is losing / gaining 12 seconds per day, or something else is syncing the time with another clock that is off by 12 seconds and then I am re-syncing it. What should I do to try and track this down further? I don't see any other cron jobs in the `/etc/cron.*` directories or in the users' cron jobs... **UPDATE** Just thought I'd share that I started running this hourly to see if there would be a big jump at a certain hour. This is what the hourly output is:               16 Jan 15:17:04 ntpdate[8346]:     adjust time server 91.189.94.4 offset -0.464418 sec      So apparently every hour the clock is off by around half a second, so that makes sense that each day (24 hours) the clock would be off by around 12 seconds. Guess the clock is just running fast! Thanks!


Set default sound card in Pulse Audio

I have two soundcards on my systems and pulseaudio always picks the wrong one. How do I set up the default soundcard in the pulse audio preferences?


Looking for an ISO creator

I'm looking for a ISO image creator, already tried `isomaster`, but it doesn't work with unicode chars, it just take it as bad chars, so what other tool can I use? I don't need booting, just archive them. (Please don't tell me to use tar or whatever, I'm doing so for reasons)


Spotlight/Search on Fedora

I apologize for the MacOSX reference, but is there an equivalent of Spotlight- Search in Fedora, specifically FC14 x86_64 ?


recursive 'ls' giving absolute filenames

When I do 'ls -R' in a directory, I get something like               ./dir1     dir2 file1.txt file2.txt          ./dir1/dir2     file3.txt file4.txt      but I would like a command that gives me               ./dir1/file1.txt     ./dir1/file2.txt     ./dir1/dir2/file3.txt     ./dir1/dir2/file4.txt      such that I can use it in a for-loop to process all files.


Toshiba Drive Sleeping - SDPARM

My toshiba 1tb external keeps going to sleep and I can't seem to locate anything that resembles a standby parameter. Does anyone know a way to get this drive to quit sleeping? Here is the output of `sdparm -a /dev/sdc`:                   sudo sdparm -a /dev/sdc         /dev/sdc: TOSHIBA   External USB 3.0  0001     Read write error recovery mode page:       AWRE        1  [cha: n, def:  1, sav:  0]       ARRE        0  [cha: n, def:  0, sav:  0]       TB          0  [cha: n, def:  0, sav:  0]       RC          0  [cha: n, def:  0, sav:  0]       EER         0  [cha: n, def:  0, sav:  0]       PER         0  [cha: n, def:  0, sav:  0]       DTE         0  [cha: n, def:  0, sav:  0]       DCR         0  [cha: n, def:  0, sav:  0]       RRC         3  [cha: n, def:  3, sav:  0]       COR_S       0  [cha: n, def:  0, sav:  0]       HOC         0  [cha: n, def:  0, sav:  0]       DSOC        0  [cha: n, def:  0, sav:  0]       LBPERE      0  [cha: n, def:  0, sav:  0]       WRC         3  [cha: n, def:  3, sav:  0]       RTL         0  [cha: n, def:  0, sav:  0]     Caching (SBC) mode page:       IC          0  [cha: n, def:  0, sav:  0]       ABPF        0  [cha: n, def:  0, sav:  0]       CAP         0  [cha: n, def:  0, sav:  0]       DISC        0  [cha: n, def:  0, sav:  0]       SIZE        0  [cha: n, def:  0, sav:  0]       WCE         0  [cha: n, def:  0, sav:  0]       MF          0  [cha: n, def:  0, sav:  0]       RCD         0  [cha: n, def:  0, sav:  0]       DRRP        0  [cha: n, def:  0, sav:  0]       WRP         0  [cha: n, def:  0, sav:  0]       DPTL        0  [cha: n, def:  0, sav:  0]       MIPF        0  [cha: n, def:  0, sav:  0]       MAPF        0  [cha: n, def:  0, sav:  0]       MAPFC       0  [cha: n, def:  0, sav:  0]       FSW         0  [cha: n, def:  0, sav:  0]       LBCSS       0  [cha: n, def:  0, sav:  0]       DRA         1  [cha: n, def:  1, sav:  0]       NV_DIS      0  [cha: n, def:  0, sav:  0]       NCS         0  [cha: n, def:  0, sav:  0]       CSS         0  [cha: n, def:  0, sav:  0]     Informational exceptions control mode page:       PERF        0  [cha: n, def:  0, sav:  0]       EBF         0  [cha: n, def:  0, sav:  0]       EWASC       0  [cha: n, def:  0, sav:  0]       DEXCPT      0  [cha: n, def:  0, sav:  0]       TEST        0  [cha: n, def:  0, sav:  0]       EBACKERR    0  [cha: n, def:  0, sav:  0]       LOGERR      0  [cha: n, def:  0, sav:  0]       MRIE        6  [cha: n, def:  6, sav:  0]       INTT        0  [cha: n, def:  0, sav:  0]     Background control (SBC) mode page:       S_L_FULL    0  [cha: n, def:  0, sav:  0]       LOWIR       0  [cha: n, def:  0, sav:  0]       EN_BMS      0  [cha: n, def:  0, sav:  0]       EN_PS       0  [cha: n, def:  0, sav:  0]       BMS_I       0  [cha: n, def:  0, sav:  0]     Logical block provisioning (SBC) mode page:       SITUA       0  [cha: n, def:  0, sav:  0]      The following appears to be working, I'll update this question if the drive does indeed sleep again.               sudo hdparm --prefer-ata12 -S 0 /dev/sdc          /dev/sdc:      setting standby to 0 (off)     SG_IO: bad/missing sense data, sb[]:  f0 00 01 00 50 40 00 0a 00 00 00 00 00 1d 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00


at job seems to be running using /bin/sh though I have a #!/bin/bash

I am trying to run a job using `at`, and I have a `bash` script (I do have `#!/bin/bash` as the first line), but the job fails because of use of `[[` and `]]` in the script, I see the following in the `mail` that it generates:               =sh: 58: [[: not found     =sh: 58: [[: not found     =sh: 58: [[: not found     =sh: 58: [[: not found     =sh: 58: [[: not found      The `/bin/sh` is a link to `dash`, but if I have the she-bang line as `#!/bin/bash` in my script - should it not use `bash` instead? P.S If I just run the script on my `bash` prompt - it works fine with no errors (and it has executable permissions). --EDIT-- I am adding the job like this:               $ at 1:30 am today -f /path/to/my/script.sh                    $ which bash      /bin/bash          $ ls -l /bin/sh     lrwxrwxrwx 1 root root 4 Mar 30  2012 /bin/sh -> dash          $ uname -a     Linux server1 3.5.0-46-generic #70~precise1-Ubuntu SMP Thu Jan 9 23:55:12 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux


QLogic 42C1831 HBA drivers on RHEL 4.8? Using Kernel 2.6.x

We're trying to get a QLogic 42C1831 HBA installed on a system using RHEL 4.8. We've tried the drivers from QLogic for Linux Kernel 2.6.x (which this system is running) and are getting all sorts of errors trying to install them. The drivers to specifically mention that they're for RHEL 5.x, but I was wondering if anyone has gotten this to work? If you'd like to look at the driver files we're using they're here


UDEV rule when USB flash drive is unplugged

I wrote a rule to automount my USB stick to certain folder but when I unplug it the folder still mounted and when I `ls` there I see a lot of errors like: `Directory bread (block: NNNN) failed` I tried to use               SUBSYSTEM=="block", ACTION=="remove", RUN+="/bin/umount /media/disk"      it's not working. My mount rule looks like               SUBSYSTEM=="block", ACTION=="add", RUN+="/bin/mount -t vfat <options> /dev/%k /media/disk"


Understanding udev rules and permissions in libusb

I had a problem with my scanner. Xsane worked only as root. Using it as normal user it didn't find any devices. Adding the user to the groups `saned` or `scanner` didn't help. Finally I solved the problem by changing               # 'libusb' device nodes     SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", MODE="0664"      to               # 'libusb' device nodes     SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", MODE="0666"      in `/lib/udev/rules.d/50-udev-default.rules` However I do not understand why this works and if it has any negative side effects. I guess that this gives write permissions to all users on any usb device, but I don't know if and why this is correct and why this solves the scanner problem. Could anyone explain in detail why this works and wether it has any side effects. My system is: `ubuntu 12.04`, the scanner is a `HP PSC 1200 all in one` device `hplip` is installed from the repository.


OpenSwan - Cannot Reach Subnets other than my own

I have replicated a working VPN server hosted on AWS, it's has practically almost the same configuration but for the range of IP's delivered. I'm connecting to it through a MacBook (created a VPN connection), i get the IP but i whenever i try to login to anything but the same subnet i get a "connection timeout". The right side is setup to %any and there is no port issue that i can see, is there something i can check to figure out where to start troubleshooting this issue? Regards


Finding Writeable Remaining Space

I work for an organization where we employees are alloted separate space on a remote server. I SSH to that server, and the using **du** I get to know that free space shown is around 2 GB. But not all can be written by me. Is there any way by which I can know the **writeable** free space ? I am a linux newbie. Appreciate you guys help.


Error when subtracting two negative numbers in ksh: "assignment requires lvalue"

I am trying to debug someone else's script: The code line is:               y=$((${oldvalue[$x]}-${newvalue[$x]}))      `y` gets calculated fine as long as both sides are positive numbers. However, I have a production situation where they are both negative and the error I get is:               DEBUG Old value = -4144290000     DEBUG New value = -4009685000     script.sh: line 123: -4144290000--4009685000: assignment requires lvalue      I never would use `ksh` myself for even the simplest of calculations but I am in a position of production support and have to deal with a big ball of mud, I would use at least Perl/Python. Can anybody tell why this problem is happening and how to fix it?


How to configure external USB touchpad for a laptop

I have a laptop that, obviously, comes with a touchpad and a keyboard. However, I have an USB keyboard with integrated touchpad that better suits my needs. I use Ubuntu 13.10 and I cannot find how to configure the external touchpad sensitivity, or any other options. The default touchpad settings tool from Ubuntu works fine, but it only changes the settings for the laptop's default touchpad. I also tried `gpointing- device-settings`, no luck. Google's search results only mention touchpads from laptops, nothing about a second touchpad input device... How would I achieve this? Here is the output of `xinput`: http://pastebin.ca/2643065


DRBD8 and GFS on CentOS5

I am trying to combine DRBD8 and GFS2 on CentOS5. Is there any possibility to do this without using a mulicast-cluster underneath? (CentOS seems to use AIS) This is a two-node-cluster, so a simple unicast setup should do.


Is there kernel patch to prevent load files into RAM for LiveCD? I mean, if I'm use LiveCD with "boot to Ram" option, there is no needs for kernel to load executable binaries to RAM from RAM. It would greatly decrease RAM usage for LiveCD. E.g. modern Linux distributive with even openoffice may be less than 2Gb. Modern Personal Computer with 4Gb may load whole of such distributive into RAM to increase speed in 1000x, but logs and temporary files with some snapshots puts to hard drive.


permission denied for ptrace under GDB

I initially posted this question on StackOverflow, as a GDB problem. I didn't find a solution there, but they did help me find that it's a permissions problem, so I'm posting it here. I have set a super simple C program and compiled it with GCC(with the `-g` flag). I've tried running it with `gdb a.out`, set a breakpoint on `main` and run it, but GDB ignored my breakpoint and simply ran the entire program nonstop. On my questions in SO they told me to run it with strace and grep for failed calls to ptrace. I did so and got:               5765 ptrace(PTRACE_TRACEME, 0, 0, 0) = -1 EPERM (Operation not permitted)      When I'm trying to run GDB with sudo it works fine, so it's definitely a permissions problem. I've also tried reinstalling GDB, hoping it'll re-set the permissions, but it didn't help. Here are the groups and permissions for GDB and for the executable I'm trying to debug:               -rwxr-xr-x 1 idanarye users 7797 Dec 28 04:52 ./a.out     -rwxr-xr-x 1 root root 5206304 Aug 31 07:10 /usr/bin/gdb      I tried googling for this problem, but all I could find is another problem where GDB fails to attach to running processes due a to a new security rule that prevents ptracing another process unless it's a child process. This is not the problem here, since I let GDB start the process I want to debug. I've tried the suggested solution(changing `/proc/sys/kernel/yama/ptrace_scope`) anyways and it didn't work. What am I missing here? What permissions do I need to give and to what? I'm running a 64bit ArchLinux. # UPDATE No idea how or why, but it works now. Probably a system update fixed it...


Up to date Mint and AMD/ATI Radeon 2600 HD Mobility

I just installed Linux Mint (3.11 Kernel) on a 2007 Notebook with a Radeon 2600 HD Mobility. Works fine so far, but is there any chance I can use propritary drivers for this GPU? What will happen if I just install `fglrx` with the Synaptics package manager? Will it warn me if my GPU is not supported? I'm asking because Manjaro Linux (based on Arch Linux) has a simple tool to install `catalyst-legacy` (even on Kernel 3.12), so I was wondering how to do this on Mint.


Why setsebool command of SELINUX taking so long and slow?

Hi I am new to the SELINUX and I have noticed the command setsebool take longer time than other linux commands. Such as:               setsebool -P ftp_home_dir ON      Out of curiosity I want to know why "setsebool" command needs such a long time to complete the task?


How to receive emails on CentOS 5 server?

I've installed postfix with this nice tutorial http://wiki.centos.org/HowTos/postfix and postfix and dovecot are up and running. I set up user maildir as tutorial suggested. Now I can check my messages by windows email client via POP3. There are none yet. But when I'm trying to send email to this server via other mail service, it don't come. I suspect that I should open SMTP port on my server. When I try to               telnet myserver.com 25      I get nothing.


Difference between sdX and vdX

When I use Ubuntu and CentOS, I see `/dev/sda` and `/dev/vda`. So I can't understand what is the different between above two?


No logical volume groups found, LVM stuck at boot

I'm running Ubuntu 14.04 (64bit). Long story short, I've compiled a custom kernel and now I'm running into some issues with my encrypted hard drive. When I boot my machine and attempt to start the new kernel, it starts loading and reports:               Reading all physical volumes, this may take a while ...        No Logical Volume Groups found        No Logical Volume Groups found      While compiling the new kernel, I've taken my current kernel configuration (from `/boot/config-$(uname-r)` as the base so all modules that were in use during the compilation should also be available with the new kernel. I'm a little stumped at where to start debugging. A colleague suggested I take a look at the `initrd`-images for both kernels. I've unpacked both images but have had little luck in determining what might be wrong. The size is quite different: The new initrd:               emikkva@slartibartfast:/tmp/15$ ll init.img     -rw-rw-r-- 1 emikkva emikkva 18278400 july 18 18:01 init.img      And the old one:               emikkva@slartibartfast:/tmp/15$ ll ../13/init.img      -rw-rw-r-- 1 emikkva emikkva 77744640 heinä 18 18:02 ../13/init.img      But the only differences are (both images unpacked):               emikkva@slartibartfast:/tmp/15$ diff -r . ../13     Binary files ./init.img and ../13/init.img differ     Only in ../13/lib: firmware # This might be a problem?     Only in ../13/lib/modules: 3.13.0-32-generic     Only in ./lib/modules: 3.15.0-rc8+      grub boot parameters are identical for both kernels. Using the old kernel works just fine. I understand I've got little information to offer here but I will of course update the question with anything that might be relevant according to comments and answers. EDIT: lsblk output:               emikkva@slartibartfast:~$ lsblk     NAME                           MAJ:MIN RM   SIZE RO TYPE  MOUNTPOINT     sda                              8:0    0 238,5G  0 disk       ├─sda1                           8:1    0   243M  0 part  /boot     ├─sda2                           8:2    0     1K  0 part       └─sda5                           8:5    0 238,2G  0 part         └─sda5_crypt (dm-0)          252:0    0 238,2G  0 crypt          ├─ubuntu--vg-root (dm-1)   252:1    0 222,3G  0 lvm   /         └─ubuntu--vg-swap_1 (dm-2) 252:2    0  15,9G  0 lvm   [SWAP]      pvs:               emikkva@slartibartfast:~$ sudo pvs       PV                     VG        Fmt  Attr PSize   PFree       /dev/mapper/sda5_crypt ubuntu-vg lvm2 a--  238,23g    0       dmsetup ls --tree:               emikkva@slartibartfast:~$ sudo dmsetup ls --tree     ubuntu--vg-swap_1 (252:2)      └─sda5_crypt (252:0)         └─ (8:5)     ubuntu--vg-root (252:1)      └─sda5_crypt (252:0)         └─ (8:5)      EDIT 2: Checking the configuration file as per suggested by @derobert:               emikkva@slartibartfast:~/airlied-linux$ grep -i 'config_crypto_aes\|config_dm_crypt\|config_crypto_xts\|config_crypto_sha256\|config_crypto_sha512' .config     CONFIG_DM_CRYPT=m     CONFIG_CRYPTO_XTS=m     CONFIG_CRYPTO_SHA256_SSSE3=m     CONFIG_CRYPTO_SHA512_SSSE3=m     CONFIG_CRYPTO_SHA256=y     CONFIG_CRYPTO_SHA512=y     CONFIG_CRYPTO_AES=y     CONFIG_CRYPTO_AES_X86_64=m     CONFIG_CRYPTO_AES_NI_INTEL=m      The configuration for the new kernel was identical, except for that `_SSE3` -ending options, they were commented out. Current crypto-algorithm in use seems to be `aes-xts-plain64` according to the output of `dmsetup table sda5_crypt`.


Compile a program without sudo access

I am connected to a linux system with SSH in my college. I found that ctorrent is a console alternative of bitorrent. I have downloaded the tar.gz source but to compile/install it needs sudo access Is there a way to install the program without sudo access? I don't know a lot about linux and cannot make this answer work with ctorrent.


How to delete number of lines from file repetitively

I've read How do I delete the first n lines of an ascii file using shell commands?, it is helpful. However I've a file something as below (please consider 2 columns as 2 different files):               1 4     1 4     1 4     1 4     1 4     3 5     3 5     3 5     3 5     3 5     7 5     7 5     7 5     7 5     7 5      I need to delete line 2-5 then 7-10 and so on (Valid outputs are 1, 3, 7 and 4, 5, 5). I know number of lines for which pattern (number) repeats. However I don't know if everytime it would follow same pattern for e.g. here its 1, 3, 7 next file can have 4, 6, 1 or 4, 5, 5 so I need to make it number of lines based than grepping the values. Can anyone give me a pointer how would I delete lines repetitively?


How to install caffeine on fedora16?

https://launchpad.net/caffeine I'm trying to install caffeine on Fedora but I am stuck on some problem, that is I can't run:               ./bin/caffeine


getting the message "out of partition" after installing GRUB 2. What is happening?

I recently moved a partition with a complete Linux install except `/home` to a new disk (with DD). Everything went fine, I can mount the partition, browse it... perfect. Next step: install GRUB to make it bootable. Restarted from a Live CD mounted the partition (`mount /dev/sda1 /mnt/root/`) and installed GRUB:               grub-install --boot-directory=/mnt/root /dev/sda      I get a success message when I do this. Now, when I boot, I go to the GRUB rescue CLI with the error "out of partition". I tried to see what's inside the disk `ls (hd0,1)/` and I got the list of directories. If I try to list the content of one of the directories I get an "out of partition" again. The hardware is actually a virtual machine (QEMU).


How do I route different users over different OpenVPN tunnels in Linux?

The setup: I have multiple, static-key OpenVPN client/server configurations, labeled "client1", "client2", and "client3" with server/client IPs 10.10.1.1/10.10.1.2, 10.10.2.1/10.10.2.2, and 10.10.3.1/10.10.3.2, respectively, hosted on one Linux server and one Linux client (with three openvpn processes each, each with a different tunX interface). I have three users on my Linux client machine, user "client1", "client2" and "client3". I have my server setup to do NAT so that incoming traffic from client1 on 10.10.1.2 goes out to the Internet (via -j SNAT in iptables) from one IP, client2 on 10.10.2.2 out another IP, etc. The problem: What I don't have is a way for the client Linux machine to properly route traffic from each user to the proper OpenVPN server IP over it's OpenVPN tunnel. Essentially, I am wanting all Internet-destined traffic from client1 to go out one internet-facing IP on the OpenVPN server, traffic from client2 to go out another, and so on and so forth for as many users as I'd like to add. But this must all be done from ONE machine hosting all the different client users. I am aware of an iptables functionality involving marking packets by user ID and then setting up IP routing based on these marks, but I don't know how to actually achieve it. Are there any iptables/netfilter/etc gurus out there that can help me in this matter?


Stream system audio through mpd

I use mpd to stream music to my phone (connected to Hi-Fi) via `http`. Yet, this only works for songs in my mpd database. I oftentimes want to play stuff in my browser and would like that to be streamed over `mpd`, too. Is there a way to route the `pulse audio` output to `mpd` instead of the speakers?


Multiple remote gateways for one ipsec phase 1 entry with pfsense

On a Sonicwall I've to replace it is possible to configure multiple remote gateways for one phase 1 ipsec entry. Can I do this on a pfsense 2.0 installation too? I haven't found a way so far and looking into the generated racoon configuration I could not even imagine how it could work, but as it works on the Sonicwall it supposingly is not impossible for ipsec at all. Is there a way to achieve this on the pfsense?


Why is LVM metadata backed up to /etc/lvm and not /boot?

Recent question I saw got me thinking on this particular point:   * If bootloader restrictions usually cause `/boot` to be outside LVM, why isn't this the target of LVM metadata backups?  Putting it underneath `/etc` seems like it would make a chicken and egg dilemma possible if we're restoring a PV for the root filesystem's VG versus just having it already available for access in rescue mode. Also, if most installers make the root filesystem LVM, it would seem they're almost intentionally creating the situation (versus the distro doing a symlink from `/etc/lvm/archive` to a directory underneath `/boot` or patching the tools to look for LVM information in `/boot`). Not that it's really a problem (I can usually just get it out of backup) but it would seem like having it under `/boot` is more ideal. I was wondering what the logic might have been for locating it under `/etc`.


I need a very light weight GUI to run under Ubuntu 9.04 (jaunty) with a twist

I am in kind of a pickle. I have a VPS, for which I am paying next to nothing and grandfathered in. Therefore I am unwilling to part with it. And I want it to perform a smidgen more by making it accessible via VNC. Mind you this VPS runs with 256MB RAM, burstable to 512 MB only. And it is stuck at Ubuntu version 9.04, for which the usual Ubuntu archive is not providing any more new installations as it is out of support I believe. Upgrading to a supportable Ubuntu version is harder than pulling teeth at this time. So, my question has two parts:   1. What is the best and lightest weight window manager that will run under jaunty with 256MB RAM?   2. (the twist) Where can I download all necessary parts so that I don't need to use any repositories to install it? Step-by-step instructions are highly appreciated. I have a keen understanding of legacy Unix platforms but my experience with Linux is quite limited.


How to make RHEL 6 to boot in Text-mode?

I am using RHEL 6.4 on a HP-Z620 Workstation.Whenever this machine starts up, it comes up with Graphics Mode e.g. Splash Screen,Red Hat Logo etc. But I want my machine to start in Text Mode. e.g. I want my machine showing all Kernel Messages(saying which services are being started). Previous versions of RHEL provided an option               Press I for interactive startup      But this version does not provide that. How to get back that feature?


How can I use two HDD as one on Debian?

I have installed Debian on my server with a 250GB HDD. Now I have bought another HDD that is 2TB large, but I don't know how I could use that 2TB with my webhosting solution. I heard about LVM, but can I use it after I installed Debian, or is it better to copy everything and reinstall my Linux?


How do I capture audio from interactive webpages using VLC?

## I'm trying to capture an audio video feed (screen-cast) from my web browser and all screen-casting options I tried have the same issue: # No sound is captured * * * ### Platform I'm using a near default install of Linx Mint KDE x64 Petra. The FLAC package is installed Outputs of `cat /proc/asound/pcm`               00-00: ALC270 Analog : ALC270 Analog : playback 1 : capture 1      00-03: HDMI 0 : HDMI 0 : playback 1      * * * ### My current process is   * open vlc and press `Ctrl`-`C`   * change `Capture mode` to `Desktop`   * Change `Desired fame rate` to something reasonable (24 f/s)   * Check `Show more optoions`   * Change `Caching` to 0   * check `Play another media synchronously` ## I think the problem is in this next step:   * In the `Extra media` field I've tried entering `alsa://plughw` or `alsa://hw:0,0` as specified here.   * I've also tried browsing for my audio device:     * I clicked `Capture Device` tab     * Next to `Capture mode` I selected `Video for Linux 2`     * Next to `Audio device name` I chose hw;0,0     * I then pressed select **However, when I'm retured to the`Open Media` window, the text next to `Extra media` is filled in with `v4l2://` with no references to the audio device.** Following this, I click the drop down next to `play` and choose convert and set the profile to `Video - Theora + Flac (OGG)` and set my destination file to `<someFile>.ogg` and hit `start` and launch the webpage I want to record. The video comes out fine, but there is no audio. **Note:** As VLC's user-base is likely much larger than any other option I've tried, I've decided to restrict my focus to solving this issue for VLC but am not opposed to other solutions aside from the obvious bridging of the headphone and mic jacks via an 3.5mm audio cable.


I want to install Kali Linux side by side on my machine which is currently running on Ubuntu 12.10.Is it possble and if it is could you instruct me how?


Bash: Filter invalid commands from history, specifically passwords

> Related Question, less specific: Automatic cleanup of Bash history This question focuses on a single problem. Over time, a user will eventually enter a password on the command line by accident, and may even press enter, which will place the password in history. The user probably was expecting a password prompt, but something was typed wrong, causing that prompt to not show. This user may not know how to clean up the history with `history` and `history -d`, or may be too busy to think about it. I suggest removing all history items that are not found in `which`, or other white-list. An added benefit is you will not make the same mistake twice on a mis-typed command, not found in `which` Do you know of   * a way to tell `bash` to run my cleanup script before, or right after writing history,   * an option that includes this particular `which` based cleanup already, or   * an alternative way to prevent passwords from being stored in `history`?


Command to find file/path lengths that are too long for burning to DVD?

I'm trying to burn a DVD from Windows but it fails because the full path name length exceeds the limit of something like 255 characters. Our files are stored in Debian Linux (accessed by Windows using samba), so to avoid running some dodgy Windows app to find long path names I'd prefer to find them using a Linux command. What command could I run to output a list of the relative path and file names for a given folder, sorted by the length of each (in descending order)? The output should look something like this:               92 ./site/testapidocs/wjhk/jupload2/policies/class-use/DefaultUploadPolicy_WithoutAlertBox.ht     83 ./site/testapidocs/wjhk/jupload2/upload/class-use/PacketConstructionThreadTest.html     76 ./site/apidocs/wjhk/jupload2/upload/helper/class-use/ProgressBarManager.html     52 ./site/xref/wjhk/jupload2/gui/JUploadFileFilter.html     31 ./site/samples.java/applet.jnlp     17 ./site/index.html


strange problem: join: file 2 is not in sorted order

sort flash_int_list.txt|join finish_comm - > t1     join: file 2 is not in sorted order      I have sorted flahs_int_list.txt but it still says file 2 is not in sorted order what is wrong ? the flash_int_list.txt is like(just the first 2 lines are shown,it has mearly 1000 lines):               1     8cvGIKL7C-M   1  1         1         0    0    0    0  -28     9     27ugSKW4-QQ   1  3         3         0    0    0    0  -28


Cygwin: readline lib loaded in different locations

Within cygwin, almost each unix command I type prints a warning message, takes time and eventually gives a correct result:               -bash-4.1$ ls     0 [main] bash 7468 child_info_fork::abort: cygreadline7.dll: Loaded to different address:     parent(0x320000) != child(0x3B0000)     -bash: fork: retry: Resource temporarily unavailable      What is the meaning of this warning?


Why does Linux only see 3832MB of my 4096MB of RAM?

I am setting up a lot of 64-bit RedHat VMs (VMware vSphere) for our development department in my company. Most of them start with 4096MB of RAM, but Linux only seems to recognize 3832MB. Can anyone tell me why that is?


Uncompress txt.gz files

Trying to uncompress txt.gz files on Linux. gzip, gunzip, unzip are not recognizing the file format. The archive is guaranteed to be not corrupted.


How to apply du (f.x.) to all sub directories except for some of them?

./a      |-/bx1      |-/by2      |-/bz3      |-/bx4      |-/by5      Now I want to apply `du` to all sub-folders except for /by2 and /bx4. I can make it happen for one folder:               du --max-depth=1 --exclude=./by2      but not for two. * * * I found to related questions:   1. Getting size of directories and exclude some folders   2. Using --exclude with the du command In (1) regular expressions are applied which won't work in my case - at least not comfortably. In (2) the exclusion refers to a full sub-directory. Essentially my question is: Can I feed `\--exclude` a list of files/directories and if yes, how?


Debian cannot SSH to OS X by hostname (Windows OK)

I've seen some questions asking why xxx can't connect to `MyMacName.local`, which answer regarding Avahi as a requirement. I don't think I am in the same category as I can successfully connect to a Windows machine without needing to do anything on my Debian one. I am able to SSH into both Windows and Mac via IP address, but the Mac only via IP. Does something need to change on the Mac side or the Debian host? **UPDATE:**   * Debian can connect to Windows via hostname   * Windows can connect to Debian via hostname   * Debian **cannot** connect to OS X via hostname   * OS X **cannot** connect to Debian via hostname All can connect to each other via IP


Persistent directory stacks across sessions in zsh

I would like to share my directory stack (the one accessed with `dirs`) across sessions and tmux panes/windows. In the `zshbuiltins` man page I have found `autopushd` to add every directory I switch into to the stack. But there does not seem to be a native way to have the stack persist and share it. Do I have to save the stack to a temporary file or is there a better solution?


How to know which is the default script shell in Centos?

I'm using Centos 6 and after reading about different shells and dash implementasion as sh replacement in Debian, Ubuntu and Fedora, made up my mind to replace sh with dash as the script shell in Centos. I have no idea how to see if this is already done, because I have both sh and dash in my system, so how do I know which is my default script shell?


Translate GNU ps flags to standard flags

I'm using `oh-my-zsh` and its `ssh-agent` plugin on OSX, but lately somebody upstream decided to use `ps x`. I'm not entirely sure what that even does, since I haven't used a GNU userland in something close to a decade. The goal appears to be finding out whether `ssh-agent` is already running, so I'm not sure why any flags to `ps` are even needed. Can somebody help me cook up a cross-platform-friendly alternative? UPDATE: If you want to take a look for yourself, here's the source for the `ssh-agent` plugin


zip command is failing during high memory usage

We have several perl scripts, which generates and emails reports. The script that emails the files expects a `.zip` extension. The report scripts generates a `.txt` or `.xls` file and then runs the following `zip` command:               print `zip -m $zip_filename $output_filename`;      What's happening is that in some cases (typically, when the perl script uses a lot of memory), the above command fails. From what I gathered the script fails, because there is not enough memory to run the `zip` command. This is a sporadic problem, and a bit hard to pin-down. I have to generate `.zip` files and cannot use a different compression method. I was hoping that someone could tell me whats going on here. I am suspecting that the `-m` flag might be causing this. What's weird to me is that I have manually ran the `zip` command from `bash` several times, and never had it fail, even while using a lot of memory. Here's the result of a `free` command to give you an idea of how much memory I am talking about. The report scripts can occasionally use more than 10GB of Memory:               -bash-4.1$ free                  total       used       free     shared    buffers     cached     Mem:      49409336   48948192     461144          0    1184716    8147564     -/+ buffers/cache:   39615912    9793424     Swap:      2047992    2047988          4      `$output_filename` could be a pattern matching more than one file.


Creating a public document directory for a normal user

We usually see personal web pages like http://a-site.com/~someone/, in this case, "someone" is a user of "a-site". How to enable this by default, so whenever we add a new user "foo", then http://a-site.com/~foo/ is created automatically? Is the tilde in "~someone" optional, customizable? **Software environment:** Webserver: Apache or Yaws (Erlang based webserver)


Before logging in my system, any way to make a key simulate another key?

In my keyboard `I` button doesn't work. I had earlier asked a Q on how to make a key simulate another key. That Q solved the issue only after I logged in my system. I'm working on Ubuntu 13.04. But how to solve the same issue that I'm facing before logging in my system? Take the below example: While logging, in GRUB 2 boot menu, I press "c" & enter command line. Now here how to make a key simulate `I`? It would solve my issue completely if the change incorporated to achieve this is permanent in effect (whether I login or not; even if I boot into a different software, etc)


mkinitcpio did not include modules.devname in cpio image

I'm running Arch Linux with a customized kernel. I modified the PKGBUILD from abs, and renamed the package to `linux-custom`. The PKGBUILD is fine, after installation I could see the `modules.devname` in the `/lib/modules/$(uname -r)/` folder But that file is not included while creating the initrd image. Perhaps there's something wrong with my mkinitcpio profile?               %> cat /etc/mkinitcpio.d/linux-custom.preset      # mkinitcpio preset file for the 'linux-custom' package          ALL_config="/etc/mkinitcpio.conf"     ALL_kver="/boot/vmlinuz-linux-custom"          PRESETS=('default' 'fallback')          #default_config="/etc/mkinitcpio.conf"     default_image="/boot/initramfs-linux-custom.img"     #default_options=""          #fallback_config="/etc/mkinitcpio.conf"     fallback_image="/boot/initramfs-linux-custom-fallback.img"     fallback_options="-S autodetect"


Is it possible to make a Microsoft LifeCam HD-5000 work under linux?

I am trying to set up a virtual machine which will act as a home security system. (If you've chatted with me in The Tavern, you may know why...) I purchased two USB webcams (Microsoft LifeCam HD-5000) and am trying to get them to work with Motion. However when I connected them to my Ubuntu 10.10 VM, no `/dev/video` devices were created. `dmesg` said:               jnet@sharon:~$ dmesg|tail     [  558.421978] uvcvideo: Failed to initialize the device (-5).     [  558.423487] usbcore: registered new interface driver uvcvideo     [  558.423492] USB Video Class driver (v0.1.0)     [  569.042808] usbcore: deregistering interface driver uvcvideo     [  570.840343] uvcvideo: Found UVC 1.00 device Microsoft® LifeCam HD-5000 (045e:076d)     [  585.801811] uvcvideo: UVC non compliance - GET_DEF(PROBE) not supported. Enabling workaround.     [  595.775370] uvcvideo: Failed to query (129) UVC probe control : -110 (exp. 26).     [  595.775592] uvcvideo: Failed to initialize the device (-5).     [  595.777012] usbcore: registered new interface driver uvcvideo     [  595.777018] USB Video Class driver (v0.1.0)      There's **a lot** of results on Google for "uvcvideo: Failed to query (129) UVC probe control : -110 (exp. 26).". many people were saying to unload the `uvcvideo` module and reload it, because it loads before the `usbaudio` module. But no amount of unloading and reloading worked. A custom compile of the `uvcvideo.ko` module was suggested but the link to the source was dead. Is there any way to make these webcams work under a *nix-like system? **Please note it does not have to be Ubuntu** , I was setting up a brand new VM for this purpose so I am open to any unix-like OS, be it Fedora, CentOS, a BSD flavor or even Open Solaris or similar.


What does this logrotate nginx config do?

In my `/etc/logrotate.d/nginx` I saw,               /var/log/nginx/*.log {             daily             missingok             rotate 52             compress             delaycompress             notifempty             create 640 nginx adm             sharedscripts             postrotate                     [ -f /var/run/nginx.pid ] && kill -USR1 `cat /var/run/nginx.pid`             endscript     }      The postrotate script looks like killing the nginx process, which does not make sense so I must be wrong. What it is doing?


ssh log sent to email in Cygwin

I am using Cygwin in Windows 7. I am trying to make my syslog-ng daemon send a ssh log via email to me when ever someone tries to log into my computer. I tried using the code below (entered into `/etc/syslog-ng/syslog-ng.conf` but the smtp driver is not recognized. Is there a way to get it to work?               filter f_ssh {             program("sshd"); };              destination d_email_notification {             smtp(                 host("localhost") port(25)                 from("syslog notification" "syslog@localhost")                 reply_to("syslog" "syslog@localhost")                 to("User" "user@email.com")                 subject("[syslog notification]: ssh message")                 body("Syslog received:\n$MSG")                 );         };              log {             source(s_local);             filter(f_ssh);             destination(d_email_notification);         };


Read entire file into memory?

Is there any way to read entire file into memory in bash, without using external command like `cat`? I know the syntax to get output from a file, i.e `<(/bin/ls)`, but now I need to read the file into entire memory, i.e `$A` would hold the contents (and there could be null, EOF like stuff)


How do you implement layout with the autostarting of applications in the i3 window manager?

This is a follow-up on a prior question on how to autostart applications on individual workspaces with the i3 window manager and what can and can't be done inside the `~/.i3/config` configuration file. First, the provided solution based on _Arch_ Linux documentation and an update provided by op where he pushes the logic further:               exec --no-startup-id i3-msg 'workspace 1:Web; exec /usr/bin/firefox'     exec --no-startup-id i3-msg 'workspace 1; exec firefox; workspace 2; exec urxvt; workspace 1'      Also of interest is this exchange about leveraging some of that directly on the command line without duplicating:               i3-msg workspace 3; i3-msg exec firefox     i3-msg workspace 9; i3-msg exec chromium      But I have _never_ seen a configuration which autostarts many windows/apps in each workspace according to a desired vertical or horizontal layout. My goal is to autostart this simple configuration I use:                _____ _____     ___________     ___________     | lx  | lx  |   |        |u_|   |     |     |   proportions:     |_____|_____|   |  FF    |lx|   |spacefm    |   1- 25% each     |medit| lx  |   |        |__|   |     | vlc |   2- 75/25 x 25/50/25     |_____|_____|   |________|u_|   |_____|_____|   3- 50/50           1               2               3      So it starts with something like this in the `config` file:               exec --no-startup-id i3-msg 'workspace 1; exec i3-sensible-terminal; layout toggle split; layout splitv; split vertical; exec i3-sensible-terminal; exec i3-sensible-terminal; exec i3-sensible-terminal; workspace 2; exec firefox; exec urxvt; exec i3-sensible-terminal; exec urxvt; workspace 3; exec spacefm; exec vlc'      But how in the world do you achieve the type of layout and vert/horizontal splitting you want? I'm trying, but it's not clear how you "mix" execution and layout. The syntax feels idiosyncratic to start because you're executing `i3-img` within i3's configuration. Do you use `split h` (or v) - `layout split v` - `exec layout split v` - `focus down`(or right) in between each `exec` call?? For a single workspace, the configuration starts all applications either vertically or horizontally and I can't seem to influence layout - or the last `split` command in the chain decides whether the windows are added vertically or horizontally. `i3-msg` seemingly ignores parts of the command that aren't properly formatted in some cases so it's hard to debug. This is further compounded by the fact that you really need to quit X and `startx` again every time to verify the results as just refreshing the configuration with `mod+shift+R` won't cut it even if you close everything on each of the workspaces. What is the proper way of configuring this? Does anyone have a solution which implements something like that? The documentation is pretty good but it doesn't provide that I can see a detailed example which mixes execution and layout on multiple workspaces.


How to start aufs for two local directories

I'm trying to create a sandbox for testing an untrusted software. I'm using Debian, I have installed `aufs-tools`. When I try to mount a minimal example with the following command:               mount -t aufs -o dirs=./write=rw:/=ro none ./mount      I'm getting:               mount: wrong fs type, bad option, bad superblock on none,            missing codepage or helper program, or other error            (for several filesystems (e.g. nfs, cifs) you might            need a /sbin/mount.<type> helper program)            In some cases useful info is found in syslog - try            dmesg | tail  or so      Using `br:` instead of `dirs=` gives the same.


Running Cinnamon/X from command line ---> No sound, software rendering

I am booting directly into the terminal of Linux Mint 17. Now I would like from there to start cinnamon gui. I do that with "startx". However, by doing that I do not have any sound (just "Dummy Output" in output devices) and I get the message telling me that Cinnamon is running in "Software Rendering mode". Now, if I directly boot into the GUI, then everything works fine. Also if I run "sudo startx" it works fine, but then I'm logged in as root. EDIT: Here are the outputs for `lsmod` and `service --status-all`: Directly booting into Cinnamon GUI: http://pastebin.com/qWRNVJ6c Booting to terminal, then `startx`: http://pastebin.com/BuBDHin3 I am booting into the terminal by adding `text` into the `grub.cfg`, see this excerpt of /boot/grub/grub.cfg:               menuentry 'Linux Mint 17 Cinnamon 64-bit, 3.13.0-24-generic (/dev/sda3)' --class ubuntu --class gnu-linux --class gnu --class os {         recordfail         gfxmode $linux_gfx_mode         insmod gzio         insmod part_msdos         insmod ext2         set root='hd0,msdos3'         if [ x$feature_platform_search_hint = xy ]; then           search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos3 --hint-efi=hd0,msdos3 --hint-baremetal=ahci0,msdos3  20503a34-3ca8-45dc-9c02-d397c327c85d         else           search --no-floppy --fs-uuid --set=root 20503a34-3ca8-45dc-9c02-d397c327c85d         fi         linux   /boot/vmlinuz-3.13.0-24-generic root=UUID=20503a34-3ca8-45dc-9c02-d397c327c85d ro quiet text         initrd  /boot/initrd.img-3.13.0-24-generic     }      The only thing I changed here is adding `quiet text` instead of `quiet splash` as it was generated from the Mint installation.


Format of cookies when using wget?

What's the format of the "natescapes" cookies.txt when I need to mirror a website that requires login. I use some chrome extension that returns cookies in that format, I save them in cookies.txt, import with wget command but no use, it just downloads content like I'm not logged in at all Appreciated any help


. (dot) in file mode

I `tar` a folder on windows and `untar` on RHEL machine. `ls -l` shows a `.` in file mode and folders are in `blue + yellow background`.               [root@xt-storage-01 apache-tomcat-8.0.5]# ls -l     total 120     drwxrwxrwx. 2 root root  4096 Jul 24 11:18 bin     drwxrwxrwx. 2 root root  4096 Jul 24 11:18 conf     drwxrwxrwx. 2 root root  4096 Jul 24 11:18 lib      what's the meaning of `.` at the end of file mode?


iptables rules for iscsi initiator

I need to configure `iptables` on my client (iscsi-initiator). From `tcpdump`, I can see that the server (iscsi target) sends `tcp` from port `3260`. So I have added following `iptables` rule on my client (where `10.1.212.51` is the iscsi target):               -A INPUT -i eth1  -s 10.1.212.51  -p  tcp  -m tcp  --dport 3260  -j ACCEPT      but `iscsi` does not work with this rule. Only after I allow all ports, does it work:               -A INPUT -i eth1  -s 10.1.212.51  -p  tcp  -m tcp   -j ACCEPT      Thus my question is, does `iscsi` need some other port as well?


I backed up my raspbian using Win32DiskImager. Later, I noticed that my Raspberry Pi did not boot because the SD card was damaged. I tried to restore the backup but still the Raspberry Pi did not boot. I formatted the card, installed a new raspbian image and everything now works fine. Is there a way to somehow "mount" the image of my backed up old SD card and exctract some configuration files from it without having to boot the Raspberry? Extract configuraiton files from raspbian image


bash script with network request in pure lsb environment

From what I can understand of LSB documentation, neither wget or netcat are standard tools always available in an LSB environment. Is there some other way to make a http request without being dependent on anything else than LSB?   What would be the most safe tool to be dependent on if I want to make it as simple as possible for users of my tool?


Do I have duplicate packages?

I'm on linux mint 12, when i run `sudo apt-get update` i see:               W: Duplicate sources.list entry http://www.duinsoft.nl/pkg/ debs/all i386 Packages        (/var/lib/apt/lists/www.duinsoft.nl_pkg_dists_debs_all_binary-i386_Packages)     W: You may want to run apt-get update to correct these problems      FSlint does not find any duplicates in `/var/lib/apt/lists`. When i search `/var/lib/apt/lists` manually, i see 3 files: `www.duinsoft.nl_pkg_dists_debs_all_binary-i386_Packages` size: 3.3 kb `www.duinsoft.nl_pkg_dists_debs_release` size: 2.9 kb `www.duinsoft.nl_pkg_dists_debs_release.gpg` size: 490 bytes This has something to do with java installation. Anyway should i delete any of these files?


Redirecting mail to Gmail

I'm trying to set up the redirection of all emails to my VPS to my Gmail account because it's easier to handle. At the moment though, it is not working, and I can't see why. I have tried a few solutions from the Internet but none have worked so far (I tell you this because I realize there may be a chance that things are conflicting). My VPS is running on CentOS 5. Postfix is the most popular solution, and this is what I have done:   * Edited /etc/postfix/main.cf to add:               virtual_alias_domains = mydomain.com     virtual_alias_maps = hash:/etc/postfix/virtual        * Created /etc/postfix/virtual and added:              admin@mydomain.com   mygmail@gmail.com     @mydomain.com   mygmail@gmail.com        * Then ran `postmap /etc/postfix/virtual` and `service postfix reload` and `service postfix restart` There is nothing in my `/var/log/maillog` but the only contents is the activity of me restarting the server etc. As a side note, if I send mail from the server command line to `admin@mydomain.com`, it redirects to my Gmail. Am I doing anything obviously wrong? I followed an article to the letter on this and many other articles recommend the same or a very similar process. If you need any more info then I will be happy to give it to you - any help is greatly appreciated.


Random lag on connection

when i try to connect to my friend's server, the connection seems randomly laggy, sometimes it's 50ms, 40ms, 60ms, but sometimes it tooks 1, 3 or 7 seconds               time curl -vv 'http://ipaddress/foo.json'     * Hostname was NOT found in DNS cache     *   Trying ipaddress... --> SLOW AT THIS LINE !!!     * Connected to ipaddress (ipaddress) port 80 (#0)     > GET /foo.json HTTP/1.1     > User-Agent: curl/7.37.0     > Host: ipaddress     > Accept: */*     >      < HTTP/1.1 200 OK     < Date: Tue, 24 Jun 2014 02:51:45 GMT     * Server Apache/2.2.27 (Unix) mod_ssl/2.2.27 OpenSSL/1.0.1e-fips mod_bwlimited/1.4 is not blacklisted     < Server: Apache/2.2.27 (Unix) mod_ssl/2.2.27 OpenSSL/1.0.1e-fips mod_bwlimited/1.4     < Last-Modified: Tue, 24 Jun 2014 02:42:12 GMT     < ETag: "2e8109e-871-4fc8be82affe4"     < Accept-Ranges: bytes     < Content-Length: 2161     < Content-Type: application/json      How could I know which part of the system that causes this? I've tried to disable mod_bwlimited, but the lag still happened I've tried to use another web server (monkey) on another port, it still happened the server:               Linux bar 2.6.32-042stab090.3 #1 SMP Fri Jun 6 09:35:21 MSK 2014 x86_64 x86_64 x86_64 GNU/Linux      Also when I tried to change `/etc/sysctl.conf` and using `sysctl -p` using `root`:               net.ipv4.tcp_tw_recycle = 1     net.ipv4.tcp_tw_reuse = 1     fs.file-max = 524288       It shows:               error: permission denied on key 'net.ipv4.tcp_tw_recycle'     error: permission denied on key 'net.ipv4.tcp_tw_reuse'     error: permission denied on key 'fs.file-max'      Maybe that values was restricted by the hosting company?


Command-line incremental backup tools

Which command line backup tool(s) has the best compression ratio? I want to backup my entire system, including media files, text files etc. I found this list on the Arch wiki site but I don't know how these tools compare to each other and which one would offer the best compression ratio overall. I realize that different tools might give better results for specific file types, but which tool and using which settings would result in the smallest archive given a mix of various input files?


"mv" command-- file vanished into non-directory

I was attempting to utilize the `mv` command to move a file onto a remote server. I ended up executing the command...               mv sqlreport.php myuser@mywebsite.org      Unfortunately, this did not work. Worse, my file seems to have disappeared. A new file, `myuser@mywebsite.org`, has appeared, but it is not a directory (In that I cannot `cd` into it). Any tips on where my file may have gone, and how to rescue it?


Unix Shell Scripting output to an Excel File

I have a Shell script with Multiple SQL statements like this:               select Count(*) from Emp where date= current_date-1;      After executing the Shell script i need a MS excel file to be create with Column name (as shown below) and result in my local system and also it has to be mailed to my mail id. Ms Excel File:               X(Table name)  - Eg: Emp     Result set           120      Can anyone help me on this ??


Is there an easy way to stop and reissue a command?

I am doing Node.js development in Ubuntu and I'm curious if there is a way to quickly stop and restart a node server. I run this command to start my app: > $ node app.js When I make changes to app.js I have to restart the server. To stop it I have to use CTRL-C followed by UP and then `enter` to reissue the startup command. Is there a faster way to do this? It doesn't seem like much until you're making many minor changes and needing to restart a lot.


Traffic segmentation for a particular subnet

Two questions is it possible to segment traffic for a particular subnet to use an interface and at the same time receive traffic from a different subnet via the same interface? This is the scenario. Sitting at home on my laptop I want to vpn into my office to be able to connect to the servers there using wlan0 but without adding another interface I also want all the rest of my traffic to use wlan0 to connect to the internet instead of routing it to the office first. Is this possible? If so w


File backed, locked shared memory and disk interaction

Varnish, a HTTP accelerator, uses a ~80MB file backed SHM log that is mlock()ed into memory. The Varnish docs recommend to store the file on tmpfs to avoid unnecessary disk access. However if the entire file is locked into memory, does the Linux kernel still write to the backing file? I tried to monitor this using inotify and fatrace, however since this interaction presumably happens all inside the kernel, no file activity was visible to these tools. There is clearly some kind of update happening either to the file or the filesystem, as monitoring the backing file with ls showed the file time changing, and sha1sum showed the contents were changing, but does this actually involve disk access or is it all happening in memory? Basically I'm trying to avoid having to do the tmpfs workaround, as using SHM to back SHM seems like an ugly workaround for a problem that might not even exist.


Sync writes very slow. Ubuntu 10.10, 32 bits, ext4

I am running ActiveMQ on my Macbook Pro that runs Ubuntu 10.10, 32 bits with an ext4 partition.               Linux iker-laptop 2.6.35-23-generic-pae #40-Ubuntu SMP Wed Nov 17 22:32:51 UTC 2010 i686 GNU/Linux      If I enable persistence in ActiveMQ the performance drops terribly. I've tested the same thing on other machines and the difference is of 2 orders of magnitude. There is a tool with activeMQ to test the HD, here are the results:               iker@iker-laptop:~/apps/apache-activemq-5.4.1$ java -classpath lib/kahadb-5.4.1.jar org.apache.kahadb.util.DiskBenchmark           Benchmarking: /home/iker/apps/apache-activemq-5.4.1/disk-benchmark.dat     Writes:        146171 writes of size 4096 written in 11.074 seconds.       13199.477 writes/second.       51.560455 megs/second.          Sync Writes:        197 writes of size 4096 written in 10.006 seconds.       19.688187 writes/second.       0.07690698 megs/second.          Reads:        5589861 reads of size 4096 read in 10.001 seconds.       558930.2 writes/second.       2183.321 megs/second.      Performance for Sync Writes is s**t. There must be something misconfigured, but this is the only app where I've noticed a HD performace issue. hdparm throws expected values:               iker@iker-laptop:~$ sudo hdparm -tT /dev/sda          /dev/sda:      Timing cached reads:   6282 MB in  2.00 seconds = 3141.73 MB/sec      Timing buffered disk reads:  240 MB in  3.00 seconds =  79.88 MB/sec


Linux and CPU usage

What does it mean for a core to run at different loads in different moments? How does a 10% load differ from a 90% load? How is this number calculated, essentially?


sending text input to a detached screen

I'm trying to run a minecraft server on my unRAID server. The server will run in the shell, and then sit there waiting for input. To stop it, I need to type 'stop' and press enter, and then it'll save the world and gracefully exit, and I'm back in the shell. That all works if I run it via telnetting into the NAS box, but I want to run it directly on the box. this is what I previously had as a first attempt:               #define USER_SCRIPT_LABEL Start Minecraft server     #define USER_SCRIPT_DESCR Start minecraft server. needs sde2 mounted first     cd /mnt/disk/sde2/MCunraid     screen -d -m -S minecraft /usr/lib/java/bin/java -Xincgc -Xmx1024M -jar CraftBukkit.jar      MCunraid is the folder where I have the Craftbukkit.jar and all the world files etc. If I type that screen line in directly, the screen does setup detached and the server launches. If I execute that line from within the script it doesn't seem to set up a screen for stopping the server, I need to 'type' in STOP and then press enter. My approach was               screen -S minecraft -X stuff "stop $(echo -ne '\r')"      to send to screen 'minecraft' the text s-t-o-p and a carriage return. But that doesn't work, even if I type it directly onto the command line. But if I 'screen -r' I can get to the screen with the server running, then type 'stop' and it shuts down properly. any guidance here? As far as I can tell (linux noob), the command formatting is ok, but the screen doesn't seem to be hearing me. The server runs well if I telnet in and do it manually, just need to run it without being connected from my remote computer.


How to send a message in Minecraft before rebooting the server?

I have a Ubuntu Linux Server 14.04 LTS which is running a Minecraft server.   I want it to reboot every 6 hours. I have that now and after the reboot, it starts the Minecraft server. Now what I want. I have the server console in a screen session named cds_screen. Is there a way to do something like `screen -d -r cds_screen && say Server is restarting && sudo reboot`?   The server runs as jebg user and not as root so can anyone help me?


Unable to 'stuff' commands into a created 'screen' immediately after creating it

> **Possible Duplicate:**   >  sending text input to a detached screen With reference to the answered question: Sending input to a screen session from outside I am trying to write a script that will create a `screen` and then `stuff` input (in my case, UNIX commands) into the shell that I want it to execute. Here's what I have till now:               $ screen -dmS new_screen bash          $ screen -S new_screen -X stuff "cd /some/path/     some_script_file.sh     " <--This new line is required to execute the above command.      $ # Note: See comments. We could insert the newline character instead of 'hard-coding' a newline string literal.      For some reason, the screen gets created fine and enters the `bash` shell. But the `cd` and `some_script_file.sh` commands don't get stuffed to the screen's bash shell. Now the really strange part is.. After I detach from the screen, re-execute the stuff command as below..               $ screen -S new_screen -X stuff "cd /some/path/     some_script_file.sh     "      and then attach back into new_screen. Now I see that the commands were correctly stuffed and executed in the bash shell inside screen. Not sure where I am going wrong here, there seems to be any issue stuff-ing commands into a not as yet attached screen.


Cron & Gnu Screen - Trouble with detached screen

> **Possible Duplicate:**   >  sending text input to a detached screen I have a script for my Minecraft server that runs automatically every 15 minutes. The problem is that after a server reboot, minecraft is automatically started in Gnu Screen. This is ideal, of course, except that for some reason the script (which returns no errors in this case) can't seem to "connect" with the screen if I don't SSH in and manually attach, then detach the screen. The script runs, but nothing happens within the screen. I have checked that I am the owner of the screen (as opposed to a system owner), and it checks out. The screen exists, and is titled properly, and everything seems like it should be working. But if I don't login to attach the screen manually first, my script can't communicate with the screen. Does anyone have any clue why this is and how I can work around it?


How to combine contents of two files having the same value in a column?

File1:               00:00 274     00:04 476     00:05 450     00:06 499     00:07 373     00:08 206     00:09 471     00:10 154      File2:               00:00 183     00:01 60     00:02 344     00:03 540     00:04 450     00:07 348     00:09 473     00:10 203      Desired output:               00:00,274,183     00:01,0,60     00:02,0,344     00:03,0,540     00:04,476,450     00:05,450,0     00:06,499,0     00:07,373,348     00:08,206,0     00:09,471,473     00:10,154,203      Column 1 of each file will be checked and if same, values will be joined to the output. Please note the "0" value for those contents not present on either file. Also, this will be used for combining contents of 6 files.


find utility does not recognize bracket notation

I've two files in the current folder: > submitWeb.m   >  submit.m the following `find` does not show the two files:               find . -regex .*submit\(Web\)?\.m      But the above regex expression works fine in emacs buffer, i.e., search for the example strings in the emacs buffer using `isearch-forward-regexp`. The default `regextype` for `find` is `emacs`. But it seems that `find` consider `\\(` as a left bracket in the filename, which differs from emacs regex syntax. So is this a bug or my misunderstanding of `find` manpage?


Can emacs render downloaded html files?

From Firefox, I downloaded a `.html` file, with a directory with name ended in `_files`, by specifying "Webpage, Complete". When open the `.html` in emacs, even under `html-mode`, only the source of the html file is displayed, and the webpage is not rendered. How can I render a downloaded html file inside Emacs? It will also be the best that the files under the `_files` dir is also used in the rendering, but I am only need to read text most of the time. I am mainly looking form some light-weight (even text) application rather than full-fledged one, because I have opened too many webpages in both Firefox and Chrome, and they take up too much resources. Is it the same as browsing a webpage via its URL?


How to launch two threads in bash shell script?

I am trying to copy files from `machineB` and `machineC` into `machineA` as I am running my below shell script on `machineA`. If the files is not there in `machineB` then it should be there in `machineC` for sure so I will try copying the files from `machineB` first, if it is not there in `machineB` then I will try copying the same files from `machineC`. I am copying the files in parallel using GNU Parallel library and it is working fine. Currently I am copying two files in parallel. Currently, I am copying the `PRIMARY_PARTITION` files in `PRIMARY` folder using GNU parallel and once that is done, then I copy the `SECONDARY_PARTITION` files in `SECONDARY` folder using same GNU parallel so it is sequential as of now w.r.t `PRIMARY` and `SECONDARY` folder Below is my shell script and everything works fine -               #!/bin/bash          export PRIMARY=/test01/primary     export SECONDARY=/test02/secondary     readonly FILERS_LOCATION=(machineB machineC)     export FILERS_LOCATION_1=${FILERS_LOCATION[0]}     export FILERS_LOCATION_2=${FILERS_LOCATION[1]}     PRIMARY_PARTITION=(550 274 2 546 278) # this will have more file numbers     SECONDARY_PARTITION=(1643 1103 1372 1096 1369) # this will have more file numbers          export dir3=/testing/snapshot/20140103          # delete primary files first and then copy     find "$PRIMARY" -mindepth 1 -delete          do_CopyInPrimary() {       el=$1       scp david@$FILERS_LOCATION_1:$dir3/new_weekly_2014_"$el"_200003_5.data $PRIMARY/. || scp david@$FILERS_LOCATION_2:$dir3/new_weekly_2014_"$el"_200003_5.data $PRIMARY/.     }     export -f do_CopyInPrimary     parallel -j 2 do_CopyInPrimary ::: "${PRIMARY_PARTITION[@]}"          # delete secondary files first and then copy     find "$SECONDARY" -mindepth 1 -delete          do_CopyInSecondary() {       el=$1       scp david@$FILERS_LOCATION_1:$dir3/new_weekly_2014_"$el"_200003_5.data $SECONDARY/. || scp david@$FILERS_LOCATION_2:$dir3/new_weekly_2014_"$el"_200003_5.data $SECONDARY/.     }     export -f do_CopyInSecondary     parallel -j 2 do_CopyInSecondary ::: "${SECONDARY_PARTITION[@]}"      **Problem Statement:-** Is there any way I can launch two threads, one to copy files in `PRIMARY` folder using the same setup as I have above, meaning it will copy two files in parallel. And second thread to copy the files in `SECONDARY` folder using the same setup as I have above, it should also copy two files parallel simultaneously? Meaning they should copy files in parallel both in `PRIMARY` and `SECONDARY` folder simultaneously not once `PRIMARY` folder is done, then copy files in `SECONDARY` folder. Currently, once `PRIMARY` folder file is done, then only I try copying the files in `SECONDARY` folder. In short, I just need to launch two threads one thread will run this -               # delete primary files first and then copy     find "$PRIMARY" -mindepth 1 -delete          do_CopyInPrimary() {       el=$1       scp david@$FILERS_LOCATION_1:$dir3/new_weekly_2014_"$el"_200003_5.data $PRIMARY/. || scp david@$FILERS_LOCATION_2:$dir3/new_weekly_2014_"$el"_200003_5.data $PRIMARY/.     }     export -f do_CopyInPrimary     parallel -j 2 do_CopyInPrimary ::: "${PRIMARY_PARTITION[@]}"      And second thread will run this -               # delete secondary files first and then copy     find "$SECONDARY" -mindepth 1 -delete          do_CopyInSecondary() {       el=$1       scp david@$FILERS_LOCATION_1:$dir3/new_weekly_2014_"$el"_200003_5.data $SECONDARY/. || scp david@$FILERS_LOCATION_2:$dir3/new_weekly_2014_"$el"_200003_5.data $SECONDARY/.     }     export -f do_CopyInSecondary     parallel -j 2 do_CopyInSecondary ::: "${SECONDARY_PARTITION[@]}"      And once all the files are copied successfully, it should echo the message, that all the files are copied. In java, I know how to launch two threads and each thread is performing certain task but not sure how in bash shell script this will work? My main task is to copy two files in parallel using GNU parallel in `PRIMARY` folder and `SECONDARY` folder at a same time? Is this possible to do in bash shell script?


I can't find executable file for sendmail?

I did a source install of Sendmail 8.14.4, and BerkeleyDB.4.1 in ubuntu14.04lts Amazon EC2. The installation was successfully compiled, as far as I know. With the installation of the source, I made a copy to `/usr/sbin/sendmail` the new version of `sendmail` using the command `cp`. But I can't find the `sendmail` file (below refer). There is no executable file..               root@ip-192-168-10-152:/usr/local/sendmail/sendmail-8.14.4/obj.Linux.3.13.0-24-generic.x86_64/sendmail# ll sendmail*          lrwxrwxrwx 1 root root 25 Jun 30 08:15 sendmail.0.dist -> ../../sendmail/sendmail.0         lrwxrwxrwx 1 root root 25 Jun 30 08:15 sendmail.8 -> ../../sendmail/sendmail.8         lrwxrwxrwx 1 root root 25 Jun 30 08:15 sendmail.h -> ../../sendmail/sendmail.h      Is it not compiled properly? Why is it?               ==========The environment set at compile ==============          root@ip-192-168-10-152:/usr/local/sendmail/sendmail-8.14.4/devtools/Site# cat site.config.m4          APPENDDEF(`confINCDIRS', `-I/usr/local/BerkeleyDB.4.1/include')         APPENDDEF(`confLIBDIRS', `-L/usr/local/BerkeleyDB.4.1/lib')         APPENDDEF(`confLIBS', `-ldb -lpthread')          ==========================================================      ### EDIT #1 I'm assume all binary files compiled successfully, except for the sendmail binary.               root@ip-192-168-10-172:/usr/local/sendmail/sendmail-8.14.9/sendmail# ./makesendmail          Configuration: pfx=, os=Linux, rel=3.2.0-58-virtual, rbase=3, rroot=3.2, arch=x86_64, sfx=, variant=optimized     Making in /usr/local/sendmail/sendmail-8.14.9/obj.Linux.3.2.0-58-virtual.x86_64/sendmail     cc -o sendmail  -L/usr/local/BerkeleyDB.4.1/lib main.o alias.o arpadate.o bf.o collect.o conf.o control.o convtime.o daemon.o deliver.o domain.o envelope.o err.o headers.o macro.o map.o mci.o milter.o mime.o parseaddr.o queue.o ratectrl.o readcf.o recipient.o sasl.o savemail.o sfsasl.o shmticklib.o sm_resolve.o srvrsmtp.o stab.o stats.o sysexits.o timers.o tls.o trace.o udb.o usersmtp.o util.o version.o      /usr/local/sendmail/sendmail-8.14.9/obj.Linux.3.2.0-58-virtual.x86_64/libsmutil/libsmutil.a /usr/local/sendmail/sendmail-8.14.9/obj.Linux.3.2.0-58-virtual.x86_64/libsm/libsm.a  -ldb -ldl -ldb -lpthread          domain.o: In function `getmxrr':         domain.c:(.text+0x1f0): undefined reference to `__res_search'         domain.c:(.text+0x200): undefined reference to `__res_query'         domain.c:(.text+0x2a5): undefined reference to `__dn_skipname'         domain.c:(.text+0x4f4): undefined reference to `__dn_expand'         domain.c:(.text+0x5be): undefined reference to `__dn_expand'         domain.o: In function `dns_getcanonname':         domain.c:(.text+0x1017): undefined reference to `__res_querydomain'         domain.c:(.text+0x10ab): undefined reference to `__dn_skipname'         domain.c:(.text+0x1213): undefined reference to `__dn_expand'         domain.c:(.text+0x12a1): undefined reference to `__dn_expand'         sm_resolve.o: In function `dns_lookup_int':         sm_resolve.c:(.text+0x21d): undefined reference to `__res_search'         sm_resolve.c:(.text+0x313): undefined reference to `__dn_expand'         sm_resolve.c:(.text+0x42e): undefined reference to `__dn_expand'         sm_resolve.c:(.text+0x598): undefined reference to `__dn_expand'         sm_resolve.c:(.text+0x6d8): undefined reference to `__dn_expand'         sm_resolve.c:(.text+0x799): undefined reference to `__dn_expand'         sm_resolve.c:(.text+0x99f): undefined reference to `__res_search'         collect2: ld returned 1 exit status         make: *** [sendmail] Error 1


Prevent `finger` from giving out mail info

To quote from `finger`'s man page > Mail status is shown as `No Mail.'' if there is no mail at all, `Mail last > read DDD MMM ## HH:MM YYYY (TZ)'' if the person has looked at their mailbox > since new mail arriving, or `New mail received ...'',` Unread since ...'' if > they have new mail. I'd rather it didn't do that. In fact I'd like finger to only display `no mail` when asked. **Is there a way to ensure this behaviour?** I have no admin rights to the machine or the network (and Google points me to nail-biting remedies for some reason). Emptying the mail folder is one solution but I'm looking for something more elegant, if possible.


Sqlite Browser NOT opening on Centos 6.5

When I try to open an .exe file in centOS (Release 6.5) by double clicking, it is not opening. I am creating an app which requires databases. I cannot check whether the data has gone in database or not because of this.I think may be some silly settings are blocking it. Any help appreciated.


How to return the directory of a given executable?

If I want to return the path of a given executable, I can run:               which mysql      Which returns for example:               /usr/bin/mysql      I'd like to return only:               /usr/bin      How can I do that?


How to find out out WHEN an user account was locked

With `passwd -S user_name` one can find out, if an account is locked, but is there a way to find out when it was locked and who it locked? Further links:   * http://serverfault.com/a/485760/78439   * Disable a user's login without disabling the account


Problem with Fedora 14 Virtual Desktops (KDE, Compiz)

I have multiple, random problems with my Virtual Desktops. I'm running Fedora 14 with KDE and Compiz on a dual-monitor config. What happens (at random):   * I often (almost always) have a problem with the Desktop of my Virtual Desktops (except for the 1st virtual desktop, that works all the time):     * Often, the background of the desktop is black and unresponsive (no wallpaper loaded, unresponsive to mouse actions).     * Sometimes the background of the desktop is composed of the windows opened in Virtual Desktop #1, but still unresponsive (I can only interact with the windows when I am on the correct VD)   * I sometimes have problems with the task bars:     * Minimized windows appear on the task bars of all the VDs.     * Then, if for example on VD #1 task bar I click on a Window which is opened in VD #2, it will switch to VD #2, displays the window and that window won't appear in other VDs task bars (because it is not minimized anymore).   * I installed the plugin rotating cube in compiz (to have hotkey to switch from one VD to another). But when I try to switch to the next or previous VD, it does the animation, but instead of switching it just stays on the same VD and minimize all the windows... Any idea?


Backing up to DVD

> **Possible Duplicate:**   >  Splitting large directory tree into specified-size chunks? I have a partition that is about 14G and I need to back it up to DVD in such a way that I can use each disc to extract the contents if I need to. Normally to backup such a partition, one can tar zip the folder and it's contents and slice it to 4.4G and then burn each slice to DVD, eg: to backup /mnt/data folder which contains about 14G of data, we run               tar cvzf - /mnt/data | split -b 4.4G backup.tgz        which would create something like (following is just an example)               backup.tgzaa        4.4G in size     backup.tgzab        4.4G in size     backup.tgzac        4.4G in size     backup.tgzad        0.8G in size      Once burned and if the situation arises for me to restore it, I need to put the slices together using cat and then gunzip and untar, if however there was an error with one of the discs when restoring then it's not possible to restore the backup. To avoid this, I would like to backup the first 4.4G to the first DVD, then next 4.4G to the second disk, with any files hitting the 4.4G to cross over the next disc and so o. In the event of any issues, I would at least have some access to the data. Is there a way to do this?? Mani


Debian 6 xsession hangs after login

Debian 6 amd64, Gnome desktop. The logon screen appears regularly. After logon, the desktop background and mousecursor appears. Nothing else happens even after a lengthy wait (hours). Same happens for a newly created user account, or root. .xsession-errors only contains "beginning session setup...", and thats it. No further changes until I shutdown the system from the commandline. Then xsession complains about losing the Display. System used to work until before my holiday. I did not change the system in a while, except for updates, and I did reboot about 3 weeks ago, did work then. System clock is correct. How do I debug what component is hanging?


NAT and source IP filtering in PF, using OpenBSD >= 4.7

I just read a book about PF (The Book Of PF, No Starch), but there's one question not answered by it. If I have a gateway machine using two interfaces, $int_if and $ext_if, and I NAT the packages coming from $int_if:net (which is, let's say, 10.0.0.0/24) to $ext_if using `match`, when gets the NAT applied? Before or after the filtering rules? Example:               match out on $ext_if from 10.0.0.0/24 nat-to ($ext_if)     pass out on $ext_if from 10.0.0.0/24     block drop out on $ext_if from 10.0.0.23      Does that work? Or gets the source IP of a packet coming from 10.0.0.23 NATed to the address of $ext_if before the check if it's from 10.0.0.23 gets evaluated? This diagram is not helpful to answer this question, I think, but it's interesting nevertheless: [http://www.benzedrine.cx/pf_flow.png] If you read the PF NAT FAQ [http://www.openbsd.org/faq/pf/nat.html], especially the section "Configuring NAT", you'll come across this sentences: _When a packet is selected by a match rule, parameters (e.g. nat-to) in that rule are remembered and are applied to the packet when a pass rule matching the packet is reached. This permits a whole class of packets to be handled by a single match rule and then specific decisions on whether to allow the traffic can be made with block and pass rules._ I think that sounds as if it's not as I stated in the paragraph above, so the source IP gets "remembered" until there's a decision about the action to be done with the packet. If the decision is made, the NATting gets applied. What do you think? P.S.: This is a quite theoretic question. If you're a little bit pragmatic, you'll do it this way:               match out on $ext_if from 10.0.0.0/24 nat-to ($ext_if)     block drop from 10.0.0.23     # or, explicitly,     # block drop in on $int_if from 10.0.0.23      So the `block` rule gets already applied when the packet comes in on $int_if. EDIT: Another possibility is, of course, to decide before NAT:               pass from 10.0.0.0/24     block drop from 10.0.0.23     match out on $ext_if from 10.0.0.0/24 nat-to ($ext_if)      If a packet from .23 arrives, it first matches the first rule, then matches the second rule and the third "rule". But as the second rule is the last deciding about passing/blocking, the packet gets blocked. Right?


How can I know my job number when I executing a COBOL program through a shell script

How can I know my job number when executing a COBOL program through a shell script?


How can other processes affect measurements made with `time`?

If I time a process using the `time` command, I get output for 'real', 'user', and 'sys'. My understanding from this discussion is that 'real' is wall time, whereas 'user' and 'sys' are process time. Does this imply that 'user' and 'sys' will be unaffected by other processes? In other words, if the computer is under heavy load or light load from other processes, it may take more time on the wall clock ('real') to finish my process. But my process may have only required 5 seconds of running time, even though it was spread out over 20 seconds of real-world time. **Am I guaranteed that I'll be told '5 seconds user time' regardless of whatever else the system is doing?**


How do you time how long a command took to run?

How would you find out how long a running process took to complete? Example:                date; dd bs=1m if=/foo of=bar; date      ^This example only has 1 second of resolution. Any shell is acceptable.


How do I time a specific command?

(The linux equivalent of TimeThis.exe) Something like:               timethis wget foo.com     Receiving foo.com       ...          wget foo.com took 3 seconds.


How can I make the screen black and white?

This is basically to transform the screen (of a laptop), into a black and white screen. I am using Ubuntu 13.04.


Cut + Copy + Paste in Linux Puppy Wary

Trying to cut + copy + paste from the standard urxvt shell in Puppy Linux Wary 5.3. If I follow this post on http://crunchbang.org/forums/viewtopic.php?id=15085 and I press:   * in urxvt: ctrl + insert = copy   * in abiword: shift + insert = paste It doesn't work. Please suggest, what's the shortcut? Or the menu command?


How to automatically mount an USB device on plugin-time on an already running system?

I know how to use `/etc/fstab` to automatically mount devices on boot or when doing `sudo mount -a`, which works perfectly fine. For example, here is my current line for my device               UUID=B864-497A /media/usbstick vfat defaults,users,noatime,nodiratime,umask=000 0 0      **How do I achieve automatic mounting when this USB device with known UUID is plugged in while the system is already running, so that I _don't_ have to run `sudo mount -a` after it is plugged in?** Additional info: I'm working on an up-to-date console-only Debian wheezy linux.


Anti Aliased Fonts with NoMachine NX

I am running nx server on a headless ubuntu server. Its desktop is to Unix -> Custom -> Emacs which gives me an Emacs window on the local machine. The only thing that does not work as expected is the anti aliased fonts. I do have anti aliased fonts on my local X but nx seems to not honor my remote Xresources file.


How to download all images from a website (not webpage) using the terminal?

I want a command that I type a URL, for example photos.tumblr.com, and it download all photos on this site in a folder, but not only images of the site's homepage. This command need to download the images from all parts of the site, such as photos.tumblr.com/ph1/1.png / photos.tumblr.com/ph3/4.jpg. **Please show me an example using this url:http://neverending- fairytale.tumblr.com/ and test it before answer the question**