title: How to disable the 2.4Ghz band wireless adapter

text: For debugging purposes, is it possible to disable the 2.4Ghz for wireless connections on Linux (Linux Mint 13 LTS, Cinnamon). I.e. to enforce the network driver to establish connections using the 5Ghz band only? Ideally, I'm looking for some command/parameter which does not require to recompile the kernel. Network card: Intel Corporation Centrino Ultimate-N 6300 I tried setting:               sudo iwconfig wlan0 channel 40      where channel 40 is in the desired 5Ghz range, but this only works once. As soon as the connection is terminated or when I roam from one access point to the other, my network connection falls back to the 2.4 Ghz range. Example:   1.     Sep  9 18:19:39 wpa_supplicant[1230]: Trying to authenticate with           00:1a:1e:88:3b:b1 (SSID='<hidden>' freq=5180 MHz)      ---Connection is established correctly.        2.     Sep  9 18:19:45 NetworkManager[908]: <info> (wlan0): roamed from        BSSID 00:1A:1E:8A:5B:41 (<hidden>) to 00:1A:1E:88:3B:B1 (<hidden>)     Sep  9 18:20:16 wpa_supplicant[1230]: Trying to authenticate with        00:1a:1e:88:3b:a1 (SSID='<hidden>' freq=2412 MHz)     ---New connection is being established using the wrong frequency.


title: How to prevent find -execdir from following symlinks?

text: Say I have a symlink: `linktob -> b` If I run something like `find . -type l -execdir chmod 777 {} \;`, the `chmod` command affects the file the symlink is pointing to, i.e. ‘b’. The man page suggests that symlinks aren’t followed by default, but that doesn’t seem to be the case here. How can I get `-execdir`, `-exec` etc. to work on the symlink itself?


title: how do I network my desktop to my laptop?

text: How do I network my desktop to my laptop? They both use my linksys router wired internet and I have a large selection of distros that I can use once I know what is called for. I run about 3-4 distros on an old Dell gx 240 and a Sager 4760 does the same each have 3/4 GB ram but the 250 GB HDD and 80 GB HDD are in the Dell and the Sager has the dvd burner so talking to eachother would be a great boon as no $$ are available. Is there a simple way to network these computers? I am even willing to install my old ethernet board so I could run a direct wire and still have web access. Not a clue what software to use. I prefer to use terminal commands. Linux has given me a new spark since I had gotton bored of waiting to die of cancer as Dr.s told me 18 months ago, still here, happier now. How do I suggest to bash that the two boxes are one?


title: FreeBSD: How to fix "ping: sendto: No buffer space available"?

text: I'm trying to ping a remote host, but I get an error.               # ping 192.168.80.1     PING 192.168.80.1 (192.168.80.1): 56 data bytes     ping: sendto: No buffer space available     ping: sendto: No buffer space available     ^C     --- 192.168.80.1 ping statistics ---     2 packets transmitted, 0 packets received, 100% packet loss      It works for other hosts:               # ping 192.168.16.1     PING 192.168.16.1 (192.168.16.1): 56 data bytes     64 bytes from 192.168.16.1: icmp_seq=0 ttl=254 time=0.442 ms     64 bytes from 192.168.16.1: icmp_seq=1 ttl=254 time=0.402 ms     ^C     --- 192.168.16.1 ping statistics ---     2 packets transmitted, 2 packets received, 0% packet loss     round-trip min/avg/max/stddev = 0.402/0.422/0.442/0.020 ms     #      The message "No buffer space available" seems to indicate some sort of memory error. And indeed, when I check with Netstat, the "mbuf clusters" number looks VERY wrong:               # netstat -m     11780 mbufs in use     4294966716/32768 mbuf clusters in use (current/max)     0/3/6656 sfbufs in use (current/peak/max)     1785 KBytes allocated to network     0 requests for sfbufs denied     0 requests for sfbufs delayed     0 requests for I/O initiated by sendfile     0 calls to protocol drain routines      What is going on here? Is there away to fix this without downtime, or do I need to reboot the host or restart the network interface?


title: Use wpa_supplicant without plain text passwords

text: I'm running gentoo on my laptop, and I'm currently using wpa_supplicant to handle wifi. My configuration works and I can connect, but it is required to type in the plain text password into the configuration file. This doesn't work if I want to connect to a friend's wifi and they want to type in the password instead of telling me what it is. There's no security with plain text passwords. How can I make this more secure so that some sort of encrypted password is stored instead of plaintext?


title: How to change the "power key" for ratpoison window manager

text: Using the ratpoison window manager, how could I remap the "power key" (which is by default Ctrl-T) to something like the Windows button? I have created a configuration file already (`~/.ratpoisonrc`) and just need to know how to bind a different key.


title: Is it possible to install Unity dock on something like Elementary OS?

text: I was trying out some different distros to choose from, and I ended up setting up Elementary OS. But I was hoping it was possible to install Unity to get the awesome dock, without reinstalling the entire OS?


title: Will I be prompted for the sudo password a second time?

text: This is what I plan to do:               #!/bin/bash          sudo -i <<'EOF'     iptables-save | awk '/^[*]/ { print $1 }                       /^:[A-Z]+ [^-]/ { print $1 " ACCEPT" ; }                      /COMMIT/ { print $0; }' | iptables-restore     EOF      I will save the above and call it cleariptables.sh. I will set it as executable. It will be placed in a folder called bin in the following path: /home/cymbal/bin/ (where cymbal is the username) I will create a shortcut to cleariptables.sh on the desktop. The contents of the shortcut will be:               [Desktop Entry]     Version=1.0     Type=Application     Terminal=true     Icon[en_US]=nm-device-wired     Name[en_US]=ClearIPtables     Exec=gksudo /home/cymbal/bin/cleariptables.sh     Comment[en_US]=Flush iptables filters     Name=ClearIPtables     Comment=Flush iptables script     Icon=nm-device-wired      Whenever I click on the desktop shortcut, I will be prompted to enter the password and the script will run. Question: Clicking on the desktop shortcut prompts me for the password. As there is a _sudo -i_ in the script, will I be prompted again for the password?


title: Can I use KdirStat over SSH?

text: I have a headless server running Centos 5.9. I can only SSH into it, is it possible to use KdirStat or a similar tool to get a graphical view of disk usage?


title: How to move EFI and boot partitions?

text: I am in the midst of moving these two partitions from sda5 and sda6 to sda1 and sda2 respectively. This is to allow me to have a contiguous space for the root file system to grow. The following is what I have done so far:   * Create partition sda1 for EFI System with `gdisk`   * Create partition sda2 for boot with `gdisk`   * Copy content on sda5 to sda1 with `dd`   * Copy content on sda6 to sda2 with `dd`   * Remove boot flag on the old EFI System sda5 with `parted` The following is what I have now (`# parted -l`):               Number  Start   End    Size    File system  Name                  Flags      1      1049kB  211MB  210MB   fat16        EFI System            boot      2      211MB   735MB  524MB   ext4         Microsoft basic data      4      200GB   250GB  50GB      5      250GB   250GB  210MB   fat16        EFI System Partition      6      250GB   251GB  524MB   ext4      7      251GB   481GB  230GB                                      lvm      Upon reboot, the boot menu that I was presented with is still tied to what is inside the old EFI System partition in sda5, despite turning off its boot flag. How to proceed further from here?


title: Allow User To Access Other User's Home Directory

text: I have a Fedora server. I would create an SFTP user account which is allowed to access other user's home dir. Is it possible? For example               user1 -> /home/user1     user2 -> /home/user1      user2 can access the system in SFTP. I create the user2 with group generic- group and chrooted it: (in my /etc/ssh/sshd_config)               AllowUsers user1 user2     Match Group generic-group       ChrootDirectory %h       ForceCommand internal-sftp       AllowTcpForwarding no       AllowAgentForwarding no       X11Forwarding no      When I try to access in SFTP the system as user2, in the /var/log/secure:               Jan 31 11:46:24 perseo sshd[30073]: fatal: bad ownership or modes for chroot directory component "/home/user1/"      I also tried this different rule:               Match Group sftpusers             ChrootDirectory /sftp/%u             ForceCommand internal-sftp      and               mount --bind /sftp/user2/ /home/user1      with no success.


title: Regular expression in Bash to validate IP-address

text: In my Python script i have a regular expression for searching IP-addresses like 0.0.0.0-255.255.255.255 in a file, it looks like this:               [1-2]{0,1}[0-9]{0,1}[0-9]{1}\.[1-2]{0,1}[0-9]{0,1}[0-9]{1}\.[1-2]{0,1}[0-9]{0,1}[0-9]{1}\.[1-2]{0,1}[0-9]{0,1}[0-9]{1}      Now i need to have the same in a Bash script. So i changed it like this:               [1-2]\{0,1\}[0-9]\{0,1\}[0-9]\{1\}\.[1-2]\{0,1\}[0-9]\{0,1\}[0-9]\{1\}\.[1-2]\{0,1\}[0-9]\{0,1\}[0-9]\{1\}\.[1-2]\{0,1\}[0-9]\{0,1\}[0-9]\{1\}      Works almost fine but for some reason it filters addresses like "1000.0.0", "2323.23.23.2323" and so on. Why is that so.


title: Control how linux deletes files

text: What exactly happens when an application deletes a file? Is there any way to control this behavior? Basically I want to `shred` instead of `rm` in all cases, but of course applications do not make calls to `rm`, I am guessing they interact directly with the kernel?? Would I have to modify the kernel to implement this feature?


title: Eye-FI SD Card not working with inbuilt card reader

text: I am tring to get my cardreader to work with and eye-fi SD card. My System is as follow:               #uname -a     Linux computer 3.2.0-0.bpo.2-amd64 #1 SMP Thu Mar 15 20:46:44 UTC 2012 x86_64 GNU/Linux          Debian Squeeze          lspci -nn     ...     02:00.0 System peripheral [0880]: JMicron Technology Corp. SD/MMC Host Controller [197b:2382] (rev 80)     02:00.2 SD Host controller [0805]: JMicron Technology Corp. Standard SD Host Controller [197b:2381] (rev 80)     02:00.3 System peripheral [0880]: JMicron Technology Corp. MS Host Controller [197b:2383] (rev 80)          ### AT BOOT     mmc0: no vmmc regulator found     Registered led device: mmc0::     mmc0: SDHCI controller on PCI [0000:02:00.0] using DMA     ### AFTER I INSERT THE CARD     mmc0: error -84 whilst initialising SD card     mmc0: error -84 whilst initialising SD card     mmc0: error -84 whilst initialising SD card     mmc0: error -84 whilst initialising SD card      Using the card reader for "normal" SD and SDHC cards seems to work fine. They get registered as devices in /dev/ and can be mounted. Sadly this is not true for the Eye-Fi Cards (I have tried 2 different models) with the inbuilt card reader. Using the provided USB SD Card Reader and inserting them works and they are mountable etc. I have tried different methods to get them to run. 1)               Creating a file /etc/modprobe.d/sd.conf     options sdhci debug_quirks=0x40      2)               Creating a file /etc/modprobe.d/sd.conf     options sdhci debug_quirks=1      3) Removing a firewire driver               modprobe -r firewire_ohci      So to sum it up. Normal cards work in the reader but the eye-fi cards don't :( Does anyone have another idea I could checkout?


title: How to ssh on multiple ipaddress and get the output and error on the local *nix machine?

text: command="ls -lrt;uname -a;uname -o"     for i in 10.38.227.229 10.38.164.103     do     ssh auto21@$i "$command 2>&1" >> log     #ssh -n auto21@$i "$command" 2> >> log     done      i am trying multiple things but nothing seems to work i get the remote output of only the first ip in the log file


title: Capture complete process structure/stack

text: There are a lot of java processes running on the server, generally, we capture the PIDs of the java processes using command 'ps -ef | grep java'. In general, the java processes have a lot of jars in their structure like the following               java -DCORDYS_INSTALL_DIR=/opt/abcd/clouprod01 \          -cp "/opt/abcd/clouprod01/scp.jar:/opt/abcd/clouprod01/scp.jar:/usr/lib/mysql-connector-java-5.1.22-bin.jar::/usr/lib/mysql-connector-java-5.1.22-bin.jar: com.eibus.tools.admin.cmc" \          -DProcessName=ABCD      In the above java process, there are a few parameters which are passed as arguments to the java process like "-DProcessName=ABCD". In my case, for a few java processes, there are almost 50 jar files which get loaded when the java process starts. As a result of that, the result of the ps command is not showing the full structure/stack of the java process. The results are coming like               java -DCORDYS_INSTALL_DIR=/opt/abcd/clouprod01 -cp "/opt/abcd/clouprod01/scp.jar:/opt/abcd/clouprod01/scp.jar:      Can anyone help us in tracing the full structure/stack of the java process using either the `ps` command or any other command?


title: Can conky float over maximized windows?

text: My idea is to use a minimized conky window on the desktop to show basically CPU and memory data all the time. Is this possible with Conky?


title: Run a sh file on machine boot up

text: I am quite new to linux and want to know what to be done to launch a .sh file on machine startup basically i have a server machine with linux OS on it and want to run some jboss application when system restart/crashes **Update** I added `S99jBossServers` in rc2.d with link to `/etc/rc.d/init.d/jBossServers.sh` and have given full permission(777) to `jBossServers.sh` the content in `jBossServers.sh` is as follows               #!/bin/sh     #     # chkconfig: 2345 80 30      # description:      #          RETVAL=0          start () {         /root/batch/startSikkimCA.sh         /root/batch/startSikkimSp.sh     }          stop () {         /root/batch/stopSikkimCA.sh         /root/batch/stopSikkimSp.sh         RETVAL=$?     }     case "$1" in         start)             start             ;;         stop)             stop             ;;         restart)             start             ;;         *)             start     ;;             RETVAL=$?     esac     exit $RETVAL      I am not sure whether its correct or not but the 2 paths been refered in > start() and stop() are correct But still the application doesnt start on machine's restart


title: UID mapping with rsync

text: I'm migrating files between servers and have to map UIDs (add 500) and GIDs. As I'd like to have it done in one single pass, is there a way to execute a command for each file rsync copies?


title: Some applications cover my top bar in dwm

text: Recently, Google Chrome has been taking 100% screen space and has been covering my top bar. Its never done this before. I tried reinstalling and nothing changed. I can post a screencap if anyone needs, but I assume its pretty straightforward what it looks like. I can still `Alt` \+ `Drag` to move the window and see the top bar. But chrome keep maximizing. Any ideas?


title: Can I use a third-party repository intended for an older version of Ubuntu?

text: I'm using Ubuntu 11.10 but some repositories i have been using don't support new version of Ubuntu. So, is there any danger in using, say, Ubuntu 10.10 ("Koala") repository for Ubuntu 11.10? May I, also, use some Debian repository for my Ubuntu?


title: How come my rtl8188cus device cannot connect?

text: I have a Edimax EW-7811Un usb wifi adapter, which uses a Realtek 8188cus chipset internally. I can use wicd to perform a network scan with the adapter, and it lists the networks correctly. But when I attempt to connect to these networks, it gets to the validating authentication stage then stops, bringing me back to the previous stage of "Not connected". After it fails to connect, I cannot scan again unless I remove the adapter and put it back in. The device is not faulty, as it works on Windows, it advertises Linux support on the box, and the drivers it uses are the rtl8192cu drivers, which are in the kernel since version 3.0


title: /etc/shadow date of last password change—UTC or local time?

text: `man 5 shadow` gives the following description of the third field in each line: > The date of the last password change, expressed as the number of days since > Jan 1, 1970. > > The value 0 has a special meaning, which is that the user should change her > pasword the next time she will log in the system. > > An empty field means that password aging features are disabled. Does this refer to times in UTC or the local timezone? In particular, if I want to calculate comparable numbers using something like `$(( $(date +%s) / 86400 ))`, do I need to pass `date` the `-u` option?


title: GNOME 3 Ctrl+Alt+D (show desktop)

text: I recently upgraded my system to GNOME 3. In previous versions of GNOME, the key combination `Ctrl+Alt+D` would hide all open windows and show the Desktop. This shortcut was eliminated from GNOME 3 along with the concept of a Desktop. The Desktop metaphor does, however, exist in GNOME 3 "fallback mode" (which I am using). I would like to reinstate the `Ctrl+Alt+D` keyboard shortcut. I know at least two ways of creating key combinations in GNOME. One is through System Settings > Keyboard > Shortcuts, and the other is through `gconf-editor` > apps > metacity. From either of these environments, I can pair a command with the key combination `Ctrl+Alt+D`. The problem is that I don't know what command will trigger a "Show Desktop" event. Could someone enlighten me?


title: Is it possible to make seek() operations on a named pipe return successful?

text: Is there any way to make it so that when programs try to perform `seek()` operations on a named pipe it will come back successful (but act as if the pipe was an empty file) instead of 'Illegal seek'? I have every last little bit of logging on my system stored in an sqlite database, I dont have files anywhere. However there are a few programs that have trouble with this. There are 2 specific cases;   * A program wants to write to a log file which syslog-ng has created as a named pipe and is reading from. The program wants to perform a `seek()` for some reason and then fails.   * A program (such as denyhosts or fail2ban) wants to read from a log file which syslog-ng has created as a named pipe and is writing to. The program wants to performs a `seek()` on it and fails. Ideally I'd just like these seeks to behave as if the named pipe were just an empty file. I cant see any reason why a program writing a log would need to perform a seek anyway, it should just open the file for append and start writing. I can see why a program reading would want to seek, so that it could resume from its last position, and so I would like it to behave as if the file were empty (like it had been truncated). So is there some option that can be set on named pipes to get them to behave this way? If not is there a mode that can be set when syslog-ng opens the pipe to have it behave this way (I'm open to making code changes)? Or am I up a creek?


title: Shrink a Linux guest .vdi in VirtualBox?

text: I've seen instructions for shrinking the .vdi image for a Windows guest machine in VirtualBox 4.1.8. However, it used a tool to write zeroes to free space in the .vdi (nullfile-1.02.exe) that is for Windows only. The page did say you should find a zerospace.c to do so in a Linux guest, but I can't find such a file any where on the Internet. Does anyone here have experience shrinking VirtualBox Linux guests?


title: linking problems when installing python module and dependencies as non-root

text: I want to install a certain (non-public, numerical) python module on a remote (Debian squeeze) system on which I do not have root (or sudo) privileges. As the python-dev package was not installed, I compiled and locally installed python 2.7 (using ./configure --prefix=$HOME/rt). I similarly installed numpy, scipy and tinyarray by using the --user option of setup.py, as these are required. Afterwards, I installed the module, which did not present any problems. However, upon importing the module in python, I get the following message: > RuntimeWarning: The installed SciPy does not use UMFPACK. Instead, SciPy > will use the version of SuperLu it is shipped with. Performance can be very > poor in this case. Indeed the performance turned out to be poor. Upon some further research it turned out that the module supports use of both umfpack and MUMPS. Both would be acceptable, but on different system, I found MUMPS to have slightly better performance. I have had no success with installing either. Regarding umfpack, I did not find any information on how to install it other than a scipack for scipy which does not seem to exist anymore. So I attempted to install MUMPS. from the INSTALL file of the module: > # Build configuration > > The setup script has to know how to link against LAPACK & BLAS, and, > optionally, MUMPS. By default it will assume that LAPACK and BLAS can be > found under their usual names. MUMPS will be not linked against by default, > except on Debian-based systems when the package `libmumps-scotch-dev` is > installed. > > All these settings can be configured by creating/editing the file > `build.conf` in the root directory of the distribution. This configuration > file consists of sections, one for each dependency, led by a [dependency- > name] header and followed by name = value entries. Possible names are > keyword arguments for `distutils.core.Extension` (For a complete list, see > the third table from top of `this document > <http://docs.python.org/distutils/apiref.html>`_). The corresponding values > are whitespace-separated lists of strings. > > The two currently possible sections are [lapack] and [mumps]. The former > configures the linking against LAPACK _AND_ BLAS, the latter against MUMPS > (without LAPACK and BLAS). > > Example `build.conf` for linking against a self-compiled MUMPS, `SCOTCH > <http://www.labri.fr/perso/pelegrin/scotch/>`_ and `METIS > <http://glaros.dtc.umn.edu/gkhome/metis/metis/overview>`_::               [mumps]     libraries = zmumps mumps_common pord metis esmumps scotch scotcherr mpiseq         gfortran      > Example `build.conf` for linking with Intel MKL.::               [lapack]     libraries = mkl_intel_lp64 mkl_sequential mkl_core mkl_def     library_dirs = /opt/intel/mkl/lib/intel64     extra_link_args = -Wl,-rpath=/opt/intel/mkl/lib/intel64      > The detailed syntax of `build.conf` is explained in the `documentation of > Python's configparser module > <http://docs.python.org/3/library/configparser.html#supported-ini-file- > structure>`_. I compiled MUMPS and rebuilt the module, using a build.conf like this:                  [mumps]        libraries = zmumps mumps_common pord        library_dirs = /*path_to_mumps_compilation*/lib /*path_to_mumps_compilation*/libseq        include_dirs = /*path_to_mumps_compilation*/include        extra_link_args = -Wl,-rpath=/*path_to_mumps_compilation*/lib      upon reinstalling the module and importing in python, I get an import error: > /*path_to*/_mumps.so: undefined symbol: mumps_get_mapping upon examining _mumps.so, it seems the symbol is indeed undefined. This is the linking command of _mumps.so that was used during installation:                   gcc -pthread -shared build/temp.linux-i686-2.7/kwant/linalg/_mumps.o -L/u/fphys/iw386/rt/lib -lmumps_common -lzmumps -lpord -lmetis -lesmumps -lscotch -lscotcherr -lmpiseq -llapack -lblas -o build/lib.linux-i686-2.7/kwant/linalg/_mumps.so -Wl,-rpath=/u/fphys/iw386/rt/lib      Note that mumps_common is loaded and mumps_get_mapping is not undefined in libmumps_common.a:                   $ nm -g rt/lib/libmumps_common.a |grep mumps_get_mapping         00000000 T mumps_get_mapping      I am not quite sure about what a "tentative symbol" is. Does this also mean undefined? I then tried also installing scotch and metis by building them from source (as is suggested in the example in the INSTALL file) and using this build.conf:                   [mumps]          libraries = zmumps mumps_common pord metis esmumps scotch scotcherr mpiseq gfortran          library_dirs = /u/fphys/iw386/rt/lib          include_dirs = /u/fphys/iw386/rt/include          extra_link_args = -Wl,-rpath=/u/fphys/iw386/rt/lib      where all the libraries have been moved to /u/fphys/iw386/rt/lib and all the header files to /u/fphys/iw386/rt/include The error message upon importing has now changed to > _mumps.so: undefined symbol: for_write_seq_lis for_write_seq_lis seems to be a fortran-related method. However, the gfortran library file that I used was the one provided by the system via the gfortran package. I would rather like to avoid attempting to build gfortran and gcc and their dependencies from source. Any help would be appreciated.


title: Not sure what the value in a log message in auth log means?

text: I have the following log line item in my auth.log file.               [TimeStamp] [server] sshd[####]: Received disconnect from [IP Address]: 11: disconnected by user      Obviously this is a disconnect log from an ssh session. I know what it all means except for the 11. What does this value indicate? Also is the form of this log message documented somewhere?


title: How to write a pre-mount startup script?

text: I want to create a bootup script that runs before the root filesystem `/` has been mounted as I want to use `dm-cache` to cache it. The script is supposed to contain cache setup commands. Where would I need to put such a script and what format does it need to have? I cannot find any useful documentation by googling. Running Fedora 17, Kernel 3.9.10.


title: Force local DNS resolution for external hosts

text: **My Environment:** * _OS:_ * Angstrom Linux **DNS:** Bind **Current Scenario:**   1. User connects to my private offline network.   2. User tries to access google.com, and my box is on a private network therefore they connection unavailable error. **Example Desired Scenario:**   1. User connects to my private offline network.    2. User tries to access google.com or any other external host in their browser and they get redirected to my splash page. The idea is that if my machine looses internet connectivity, the end user will still be able to hit google.com or any other external site and get redirected to my splash/portal page. Any thoughts or feedback on how this can be achieved would be greatly appreciated.


title: Does SerNet compile Samba 4 with CUPS support? (How to tell in general?)

text: I have SerNet Samba 4.0.9 installed on CentOS 6.4. How can I tell if it was compiled with CUPS support?


title: Ubuntu : after upgrade, wire network is unstable

text: Yesterday I have upgraded to Ubuntu 13.04. After I upgrade, I have a serious problem with network (I use wire network): my network is unstable. After a short time using it, it often disconnects. It means the connected sign on taskbar is normal, but I can not browse the internet anymore. The only solution that I have is unplug network, and plug again, and network runs smoothly again. I don't know why this happen and I google but no answer. I'm using laptop with core i5, and network card is onboard. Here is my network card info after I run command : `sudo lshw -C network`               *-network                           description: Wireless interface            product: AR9285 Wireless Network Adapter (PCI-Express)            vendor: Atheros Communications Inc.            physical id: 0            bus info: pci@0000:03:00.0            logical name: wlan0            version: 01            serial: d0:df:9a:e2:81:c7            width: 64 bits            clock: 33MHz            capabilities: pm msi pciexpress bus_master cap_list ethernet physical wireless            configuration: broadcast=yes driver=ath9k driverversion=3.8.0-19-generic firmware=N/A latency=0 link=no multicast=yes wireless=IEEE 802.11bgn            resources: irq:17 memory:c0500000-c050ffff       *-network            description: Ethernet interface            product: AR8151 v2.0 Gigabit Ethernet            vendor: Qualcomm Atheros            physical id: 0            bus info: pci@0000:04:00.0            logical name: eth0            version: c0            serial: e8:9a:8f:b9:af:57            size: 100Mbit/s            capacity: 1Gbit/s            width: 64 bits            clock: 33MHz            capabilities: pm msi pciexpress vpd bus_master cap_list ethernet physical tp 10bt 10bt-fd 100bt 100bt-fd 1000bt-fd autonegotiation            configuration: autonegotiation=on broadcast=yes driver=atl1c driverversion=1.0.1.1-NAPI duplex=full ip=192.168.1.100 latency=0 link=yes multicast=yes port=twisted pair speed=100Mbit/s            resources: irq:49 memory:c0400000-c043ffff ioport:2000(size=128)      And here is my laptop information:               System Information             Manufacturer: TOSHIBA             Product Name: Satellite L755             Version: PSK1YL-006001             Serial Number: 9B077988W             UUID: 2690FBA0-D81A-11E0-9FD1-E89A8FB9AF57             Wake-up Type: Power Switch             SKU Number: PSK1YL-006001             Family: Intel_Mobile      Please help me about this issue.


title: Why is my Yellow Dog keyboard layout wrong?

text: I just installed Yellow Dog on my PowerBook G4, and it worked, and noticed my mac keyboard. Then, suddenly, the layout went wrong. Most keys don't do anything, and I have letters instead of arrow keys. I logged off to see if it helps, but then I couldn't even log on again (have to type my username). I'm writing this on OSX. Is there any way to get the layout back? P.S. I just rebooted a second time, and everything works - I'd still like to know what happened though...


title: Use SSH to connect to a Windows OS in Linux

text: sorry,I reedit it.. In Windows machine ,I installed Ubuntu in my oracle vm virtualBox. In Ubuntu, if I want to connect to another Linux machine, I will write a command line in bash, like:               $ ssh username@ip      But if I want to connect to my Windows machine, that way doesn't work! So how can I connect to a Windows machine using `ssh` in a Ubuntu OS(that's in my vm virtualBox)? @bodhi.zazen thank your answer.And after I install openssh for window,when I use $ ssh username@ip ,there is a wrong as follow:               root@lime-VirtualBox:/home/lime# ssh sikaiwei@192.168.1.103                                  ****USAGE WARNING****          This is a private computer system. This computer system, including all     related equipment, networks, and network devices (specifically including     Internet access) are provided only for authorized use. This computer system     may be monitored for all lawful purposes, including to ensure that its use     is authorized, for management of the system, to facilitate protection against     unauthorized access, and to verify security procedures, survivability, and     operational security. Monitoring includes active attacks by authorized entities     to test or verify the security of this system. During monitoring, information     may be examined, recorded, copied and used for authorized purposes. All     information, including personal information, placed or sent over this system     may be monitored.          Use of this computer system, authorized or unauthorized, constitutes consent     to monitoring of this system. Unauthorized use may subject you to criminal     prosecution. Evidence of unauthorized use collected during monitoring may be     used for administrative, criminal, or other adverse action. Use of this system     constitutes consent to monitoring for these purposes.               sikaiwei@192.168.1.103's password:      Permission denied, please try again.     sikaiwei@192.168.1.103's password:      Permission denied, please try again.     sikaiwei@192.168.1.103's password:      Permission denied (publickey,password,keyboard-interactive).      And in my Windows machine,I reedit the C:\Program Files (x86)\OpenSSH for Window/etc/sshd_config like that:               PermitRootLogin yes     PasswordAuthentication yes      But the same error still exist... When I connect my ubuntu using "ssh" in my Windows machine,the error               Permission denied (publickey,password,keyboard-interactive)      still exist...


title: In what situations would a user not let the shell record his command into history?

text: If I add `export HISTCONTROL=ignorespace` in `.bashrc`, bash won't record any commands which have whitespace before them into history. But I do not understand under what situations it will be useful. Can anyone give some examples?


title: How to output string completions to stdout?

text: Some of the `git` commands have many options, and it would often be useful to search through them for the one I need - I was just looking for the option which controls the `TAB` width in `git-gui`, but there are about 200 completions for `git config`. An obvious workaround is to copy all the completions into an editor and search through them, but I'd rather do               [something] | grep tab      There are no `man` or `info` pages for `compgen`, `help compgen` doesn't even explain its own options, and there's no auto-complete for `compgen` (how's that for irony?). PS: `compgen -A` doesn't work. PPS: This is not a question about `git-gui` \- The solution to the tab width question was elsewhere. PPPS: This is _not_ about auto-completing commands, only _command parameters_.


title: brace expansion other commands besides mkdir?

text: Found this nifty lifehacking gem to create multiple directories: http://unix.stackexchange.com/a/640/7768 I was wondering if there are other commands support brace expansion?


title: Restricting access to files on an external drive

text: I was wondering how to restrict access to a specific drive in Unix on the Mac. I was thinking to do this in Terminal where I create a file like this `mkfile 6k secure_access`. And where secure_access will be on the external drive and will only allow a specific user to be allowed to access the drive, thereby preventing other users from accessing it.


title: How can I create a terminal window with one tab per long-running script that I can individually kill with ctrl-C and restart?

text: I am working on an application that requires running many long running scripts, some of which I want to restart from time to time. Currently, I am trying to use `gnome-terminal` to solve this problem, so I have created a startup script that looks like:               #!/bin/bash -e     cd `hg root`          gnome-terminal \       --tab \         --working-directory=$PWD \         --title run-server \         -e ./bin/run-server.sh \       --tab \         --working-directory=$PWD \         --title run-client \         -e ./bin/run-client.sh \          # etc.      This creates the window and set of tabs that I want, so initially, everything looks great. The problem is that when I hit ctrl-C in the first tab to kill the server, it closes the tab. What I want to happen is for `./bin/run- server.sh` to die and then I should be able to press up and then enter (because it should be the last thing in my history) to start it off again. Is there a way to do this using `gnome-terminal` or equivalent on Ubuntu?


title: Apache won't read file which are being actively written

text: I want to show a log via a webpage. Every 0.5 seconds a script replaces the data in the log with the newest measurements. When this script is running and updating the file I cannot see the file in the browser. When I stop the script I, so It is not being updated, I can see the file in my browser. I guess Apache is the problem. But I cannot find out where it resides. How can I read a file in the browser while it is being written?


title: Why is vim offering me spelling suggestions instead of using the completefunc?

text: I am trying to set up vim for writing email. I have a plugin to provide autocompletion of email addresses (notmuch abook ). If I do `:set completefunc` it tells me it is `CompleteAddressBook` as expected. However, when I hit `Tab` I get what appear to be spelling suggestions from a word dictionary. I do have `spell` set, but I'm confused as to how to get past spell to get `completefunc` used. You can see my vimrc in case there is something weird in there. Ideas for debugging steps welcome.


title: Command to get cpu cores in LINUX IA64

text: I tried `cat /proc/cpuinfo` but there is no "cpu cores" it works on LINUX though `cat /proc/cpuinfo | grep "cpu cores"` Help me get a command for "cpu cores" in LINUX IA64


title: Gnome 3 gnome-control-center empty

text: I recently installed GNOME 3 on my Mint installation. I finally cracked under pressure from my friends to upgrade back to GNOME 3 (I actually went Unity > GNOME 3 > Mint) I've customized it to my liking, but there's still one thing bugging me. Whenever I click "System Settings" from my menu, nothing happens. Then, when I try to load "gnome-control-center" from terminal, I get the System Settings window, but with no capplets. I get no errors from the terminal either. Any pointers (No C jokes please) on this?


title: Syncronising Calendar and Contacts between Thunberbird and Android using Linux Software

text: I am looking for software to sync my Calendar and my Contacts between Thunderbird, my Android phones and probably other clients like KDEs Kalendar and Kontacts. I want to have both parts available offline (cached) at least for Thunderbird and for Android. Google is out of question for obvious security and privacy reasons (can't be trusted). Which Server software and which way could give me the most success? Does anyone have partial working solutions with some experience on the stability of the solution? How about the security aspect while syncing across unsecure networks (public hotspots for example)? Tried so far: calendarserver (calendar works) radicale (calendar and adressbook work, but not for android, also lost my adressbook thanks to the sogo extension)


title: Logging all input and output in zsh on demand

text: Is there any way to activate/deactivate the logging of **all input and output** on a zsh session? I am using oh-my-zsh with a customized prompt with colors, etc. and I would like to preserve all of these as possible (so that I can later open the log file in Emacs or less and have them re-parse the **ansi color escape codes** ) Does zsh provide any functionality to facilitate this type of logging? Later on, what would be the best way to visualize the log files in **Emacs** (or some other editor) and have it properly parse all the **ansi color escape codes**?


title: How search for a file beginning with either a or z and ending with a or z?

text: I attempted `find -name 'a*' 'z*' '*a' '*z'` but it gave me the error code `find: paths must precede expression: z*` I know how to find files starting with a though z, or ending with a-z, but not starting with specific letters.


title: Why is Unix still used if Linux is based off of it, and Linux is free?

text: Also, it seems that Linux has a much friendlier user interface. Has Unix been trying to "keep up"?


title: What does the syntax of these echo commands mean?

text: I tried to use a copied script, which includes the following command               echo "rc  $2" > $WORKDIR/out.dat      I can guess it tries to output some contents to file out.dat. But what does `rc $2` mean? It also includes               echo "PWD" >> $WORKDIR/env.txt      Why does it use `>>` here instead of `>`?


title: Which order does find command use to print out

text: What order does the `find` command use to print out a list of files? Is this order different across different Linux distributions or versions?


title: Can't process stdout with pipe as it comes

text: I'm running tshark on a fifo, and the following is a bare example of a loop that prints the output of tshark **as it comes** :               tshark -i $fifo | while read line; do         echo $line     done      The problem appears when I add filters to tshark. This example prints all `$line`s only after tshark exits (IP address is hidden):               tshark -i $fifo -T fields -e text -R '         ip.src == **.**.***.**          &&         http.response.code == 200       &&         http.content_encoding == "gzip" &&         http.content_type contains "text/html"     ' | while read line; do         echo $line     done      I have tried in other forms with no luck:               while read line; do         echo $line     done < <(tshark ...)          while read line; do         echo $line     done <<<"$(tshark ...)"      Even grep prints the lines only after tshark ends:               tshark ... | grep .      I have tried running tshark without a pipe and the lines are printed correctly as they come. Why is the command after the pipe being feeded only after tshark exits? **Additional details:** `| tee` works, but I get everything printed again when tshark exits, so it is not a good deal.


title: Deleting all C comments with sed

text: I am trying to write a script that will delete all comments and everything in between inside C files in my current directory. I've been using `sed`, and this is what I have so far:               sed -i '/ * [^()] */d' *.c This works when the comments are on the same line as an asterisk or backslash. However it doesn't work when there is a commented line without a slash or asterisk. I know sed goes line by line, I just don't know how to tell it to keep deleting until it sees a `*/`.


title: Login site using cURL

text: I am trying to login from cURL command line with the command curl --data "username=user&password=pass&submit=Login" http://www.ip.com:8080/LoginApplication/Login.jsp And after that trying to access inner page using               curl http://www.ip.com:8080/LoginApplication/Success.jsp      But I am getting redirected to error page because of not logged in. What I am missing in my first command so that it can maintain the session? I have my website locally hosted


title: Why might an external Hard Disk Run super slow?

text: I have an external Western Digital HDD (1gig) which is running very slow, 0.5 - 1mb per second. This is on a Mac Pro running the latest OS with all the patches. The HDD is connected via USB directly to the computer (i.e. no hub or anything.) Also I ran a disk diagnostic on it which comes up clean. The deeper diagnostic takes too long to finish.   * could it be a hardware problem in the HDD?   * could I need a different cable?   * any other diagnostic steps that you might suggest? Additional info I got from the OS. Does that tell you anything (me not)               ext HDD 1021:            Product ID:   0x1021       Vendor ID:    0x1058  (Western Digital Technologies, Inc.)       Version:  20.21       Serial Number:    888881563550353537363230       Speed:    Up to 480 Mb/sec       Manufacturer: Western Digital       Location ID:  0xfa200000 / 2       Current Available (mA):   500       Current Required (mA):    2       Capacity: 1 TB (1,000,202,043,392 bytes)       Removable Media:  Yes       Detachable Drive: Yes       BSD Name: disk2       Partition Map Type:   GPT (GUID Partition Table)       S.M.A.R.T. status:    Not Supported       Volumes:     EFI:       Capacity: 209.7 MB (209,715,200 bytes)       BSD Name: disk2s1       Content:  EFI     ExternalHD:       Capacity: 999.86 GB (999,858,069,504 bytes)       File System:  HFS+       BSD Name: disk2s2       Content:  Apple_HFS       Volume UUID:  FFFFFEB2-42F8-3510-85F4-12632D99D19B


title: How do I mount a UFS disk in read-write mode?

text: I have a system drive that has filled up to the last sector, so that it doesn't boot anymore. The file system is UFS (it's an old Freenas 0.7 installation), but since UFS write support doesn't appear to be included in any linux distro I figured I get a live CD of FreeBSD to mount it. The problem is that all the live CDs I try, be it FreeBSD, FreeNAS or Nas4free, none of them seem to be able to mount a UFS file system. From what I've read, this is what I'm supposed to do:               mount -t ufs -w -o ufstype=ufs2 /dev/wd0 /mnt/rescue      But this only yields:               mount: no mount helper program found for ufs: No such file or directory      And if you look in `/sbin` you see only the following (non-mount related files omitted):               mount_cd9660     mount_ext2fs     mount_ffs     mount_msdos     mount_udf      Which I assume all are the helpers mount is referring to. All the different live CDs I've tried have the same repertoire of helpers. I thought UFS was the default file system in FreeBSD, so I feel that I'm missing something fundamental here.


title: Problems with the locale; can't make Arch Linux use UFT-8

text: **Note:** The real problems behind this are presented here, as per a recommendation on meta. This question should be closed as a non-reproducible off-topic because its main problem is solved by correcting a typo. * * * Hi fellows, I have tried to follow various official tutorials and questions and supposed solutions (a few only appliying to, say Debian based distros), none of which worked. Adding things like `LANG="pt_PT.UFT-8"` in `~/.bashrc` didn/t work either, although it quiets the `man` warning (but generated a few warnings like `bash: can't set $LC_CTYPE (...)` loading the shell after login):               man: can't set the locale; make sure $LC_* and $LANG are correct      My `locale.conf` file, which BTW has experienced a lot of combinations of `LC*` and `LANG*` variables:               LANG="pt_PT.UFT-8"     LANGUAGE="pt_PT.UFT-8"      The result of some other commands:               [jmcf125@jmcf125-Toshiba-Arch ~]$ locale     locale: Cannot set LC_CTYPE to default locale: No such file or directory     locale: Cannot set LC_MESSAGES to default locale: No such file or directory     locale: Cannot set LC_ALL to default locale: No such file or directory     LANG=pt_PT.UFT-8     LC_CTYPE="pt_PT.UFT-8"     LC_NUMERIC="pt_PT.UFT-8"     LC_TIME="pt_PT.UFT-8"     LC_COLLATE="pt_PT.UFT-8"     LC_MONETARY="pt_PT.UFT-8"     LC_MESSAGES="pt_PT.UFT-8"     LC_PAPER="pt_PT.UFT-8"     LC_NAME="pt_PT.UFT-8"     LC_ADDRESS="pt_PT.UFT-8"     LC_TELEPHONE="pt_PT.UFT-8"     LC_MEASUREMENT="pt_PT.UFT-8"     LC_IDENTIFICATION="pt_PT.UFT-8"     LC_ALL=          [jmcf125@jmcf125-Toshiba-Arch ~]$ locale -a     locale: Cannot set LC_CTYPE to default locale: No such file or directory     locale: Cannot set LC_MESSAGES to default locale: No such file or directory     locale: Cannot set LC_COLLATE to default locale: No such file or directory     C     POSIX     en_US.utf8     pt_PT.utf8     [jmcf125@jmcf125-Toshiba-Arch ~]$ localectl        System Locale: LANG=pt_PT.UFT-8            VC Keymap: pt-latin9           X11 Layout: pt      `locale.gen` (no comments):               en_US.UTF-8 UTF-8     pt_PT.UTF-8 UTF-8      `locale-gen` has always returned:               Generating locales...       en_US.UTF-8       pt_PT.UTF-8     Generation complete.      I have also tried `uft8` instead of `UFT-8` (that was part of the Ubuntu solution I used back then), with no good results (although I didn't try it in many places). Besides, the keyboard on X is not `pt-latin9`, even if I do `loadkeys pt- latin9` and related commands, although that's not my main problem right now. That is another question. The current problem is that Non ASCII characters are not displayed right (not in the tty, much less in X). For example, if I click the key for c cedilla, I get a majuscule `A` with a trema, and I can delete am additional character of the prompt with `Backspace`! I suspect this is because the TTY expects 2 bytes to be 2 characters, and allows for an extra backspace. While `ls` gives a question mark per byte of the character (example: `Transfer??ncias`), `Tab` completion gives `Transferências/` on X and something else (other non ASCII character) on a TTY. I hope you can help me, this is really annoying and I don't know what else to do. Even while writing this question, I mistyped `'` for `/` almost every time!


title: Bash scripting: Associated Array only recognizes one value when several given

text: This lines of a Bash (4.0) Script > >     klang=([string_0]='element_0' [string_1]='element_1' > [string_2]='element_2') >     echo "${klang[*]}"     # should output the all set elements >     echo "${#klang[*]}"    # should output the number of set elements >   returns (for some reason): > >     element_2 >     1 >   There are no other commands set in this script and I am really new in Bash scripting. What happened to the other elements (`Element_0` and `Element_1`)? This really worked perfectly with indexed arrays and numbers and everything, but doesn't work with text - well except for one element which is a bit less than I asked for… Where did I miss something?


title: Start a song from a specific time in rhythmbox using command line

text: I would like to start a song from my terminal, starting from the first minute. i.e.: the command will run the _music.mp3_ starting from the minute 1. I am able to run a music with                rhythmbox music.mp3       However it is starting from 0. How to do it for starting from minute 1?


title: How to remove only the content of directories?

text: I'm in a folder: `/var/myfolder`. Inside there are some other folders like: `/var/myfolder/A/` `/var/myfolder/B/` ``/var/myfolder/C/` etc. Inside each there are some files with random names. How do I remove all the files from all the folders inside `/var/myfolder`? The structure (all the directories, eg., A, B, C etc., inside `/var/myfolder`) should remain intact.


title: How can I connect to my RPi NFS server using version 4?

text: I've set my Raspberry Pi up as an NFS server, but I cannot connect to it with NFS version 4. However, version 3 works. From my Kubuntu 13.04 client:               $ sudo mount -t nfs -o proto=tcp,port=2049,vers=4 192.168.1.91:/export /mnt/pi -v     mount.nfs: timeout set for Tue Sep 17 09:47:26 2013     mount.nfs: trying text-based options 'proto=tcp,port=2049,vers=4,addr=192.168.1.91,clientaddr=192.168.1.7'     mount.nfs: mount(2): Permission denied     mount.nfs: access denied by server while mounting 192.168.1.91:/export     $ sudo mount -t nfs -o proto=tcp,port=2049,vers=3 192.168.1.91:/export /mnt/pi -v     mount.nfs: timeout set for Tue Sep 17 09:47:31 2013     mount.nfs: trying text-based options 'proto=tcp,port=2049,vers=3,addr=192.168.1.91'     mount.nfs: prog 100005, trying vers=3, prot=6     mount.nfs: trying 192.168.1.91 prog 100005 vers 3 prot TCP port 35976      From the server, it seems that NFS version 4 is compiled in the kernel.               $ rpcinfo -p        program vers proto   port  service         100000    4   tcp    111  portmapper         100000    3   tcp    111  portmapper         100000    2   tcp    111  portmapper         100000    4   udp    111  portmapper         100000    3   udp    111  portmapper         100000    2   udp    111  portmapper         100024    1   udp  51953  status         100024    1   tcp  42383  status         100003    2   tcp   2049  nfs         100003    3   tcp   2049  nfs         100003    4   tcp   2049  nfs         100227    2   tcp   2049         100227    3   tcp   2049         100003    2   udp   2049  nfs         100003    3   udp   2049  nfs         100003    4   udp   2049  nfs         100227    2   udp   2049         100227    3   udp   2049         100021    1   udp  41873  nlockmgr         100021    3   udp  41873  nlockmgr         100021    4   udp  41873  nlockmgr         100021    1   tcp  35095  nlockmgr         100021    3   tcp  35095  nlockmgr         100021    4   tcp  35095  nlockmgr         100005    1   udp  60943  mountd         100005    1   tcp  44936  mountd         100005    2   udp  52342  mountd         100005    2   tcp  56312  mountd         100005    3   udp  57888  mountd         100005    3   tcp  35976  mountd      Server logs at `/var/log/messages` are unchanged for both attempts. Server logs at `/var/log/syslog` are unchanged for unsuccessful v4 attempts, but are appended for successful v3 attempts, as follows.               Sep 17 21:48:27 raspberrypi rpc.mountd[24098]: authenticated mount request from 192.168.1.7:1021 for /export (/export)     Sep 17 22:09:12 raspberrypi rpc.mountd[24098]: authenticated mount request from 192.168.1.7:790 for /export (/export)     Sep 17 22:09:51 raspberrypi rpc.mountd[24098]: authenticated mount request from 192.168.1.7:1002 for /export (/export)      Oddly enough, it seems like the port is changing, despite me specifying 2049? Contents of server's `/etc/export`               /export       192.168.1.0/24(rw,fsid=0,insecure,no_subtree_check,async,crossmnt)      N.B. this was originally posted at the Raspberry Pi Stackexchange site two weeks ago, but I'm trying here since I haven't had a decent response. I'll delete the other if I get a good response here. ==EDIT== Contents of `/etc/default/nfs-common` on the server:               # If you do not set values for the NEED_ options, they will be attempted     # autodetected; this should be sufficient for most people. Valid alternatives     # for the NEED_ options are "yes" and "no".          # Do you want to start the statd daemon? It is not needed for NFSv4.     NEED_STATD=          # Options for rpc.statd.     #   Should rpc.statd listen on a specific port? This is especially useful     #   when you have a port-based firewall. To use a fixed port, set this     #   this variable to a statd argument like: "--port 4000 --outgoing-port 4001".     #   For more information, see rpc.statd(8) or http://wiki.debian.org/SecuringNFS     STATDOPTS=          # Do you want to start the idmapd daemon? It is only needed for NFSv4.     NEED_IDMAPD=yes          # Do you want to start the gssd daemon? It is required for Kerberos mounts.     NEED_GSSD=no


title: OpenVPN port forwarding without router forwarding?

text: I would like to setup an OpenVPN server with port forwarding on my VPS, because I can not forward ports in my home router. The general question is, if it is even possible to bypass router port forwarding with a VPN connection?


title: What is the difference between lhome and home, and is it causing my SSH key authentication to fail?

text: I have RHEL running on a system with my account having the root privilege. My home directory is in `/lhome/myusername`. If I try to add any user their home directory is created in `/home/newuser`. What is the difference between `lhome` and `home`? Also I was trying to setup a ssh connection using cygwin from my windows 7 PC. Even though I followed all the steps in this tutorial, ssh still asks for my password. Does this have anything to do with my home directory being in lhome?


title: SELinux and Trusted OS - can SELinux be confined to hardware level root?

text: I am exploring on SE Linux and while doing so i found it as an example of Trusted OS. Is it really an example of Trusted OS stack like TrouSerS ? SELinux as per my understanding modifies the Linux Kernel by using LSM. Can it be really used to identify hardware level information and labeling so as to facilitate on lines of Trusted Operating System ?


title: Monitor disk health using smartd (in smartmontools) on a high availability software RAID 1 server

text: I have a server with three identical SATA/600 3TB drives: `/dev/sda`, `/dev/sdb`, `/dev/sdc`. The drives are partitioned, using GPT with three partitions each:   * 1 MB: Reserved partition for boot loader   * 1 GB: RAID1 /dev/md0 ( ext2 ( /boot ) )   * 3 TB: RAID1 /dev/md1 ( encrypted volume ( LVM ( volume group ( Swap, /, /etc, /home ... ) ) ) ) One of the three drives is a hot spare and the other two are active in the RAID sets. It works fine and I am able to boot after disconnecting any single HDD. I want to use smartd (part of smartmontools) to monitor the health of the drives and report errors to syslog (which I monitor using logcheck). This server should have as high availability as possible, but it is acceptable that performance is lowered during tests. Here is the output of `smartctl -a /dev/sda`:               smartctl 5.41 2011-06-09 r3365 [x86_64-linux-3.2.0-4-amd64] (local build)     Copyright (C) 2002-11 by Bruce Allen, http://smartmontools.sourceforge.net          === START OF INFORMATION SECTION ===     Device Model:     WDC WD30EZRX-00MMMB0     Serial Number:    WD-WMAWZ0412093     LU WWN Device Id: 5 0014ee 2b19fbdcd     Firmware Version: 80.00A80     User Capacity:    3,000,592,982,016 bytes [3.00 TB]     Sector Sizes:     512 bytes logical, 4096 bytes physical     Device is:        Not in smartctl database [for details use: -P showall]     ATA Version is:   8     ATA Standard is:  Exact ATA specification draft version not indicated     Local Time is:    Fri Sep 27 15:37:25 2013 CEST     SMART support is: Available - device has SMART capability.     SMART support is: Enabled          === START OF READ SMART DATA SECTION ===     SMART overall-health self-assessment test result: PASSED          General SMART Values:     Offline data collection status:  (0x82) Offline data collection activity                         was completed without error.                         Auto Offline Data Collection: Enabled.     Self-test execution status:      (   0) The previous self-test routine completed                         without error or no self-test has ever                          been run.     Total time to complete Offline      data collection:        (50280) seconds.     Offline data collection     capabilities:            (0x7b) SMART execute Offline immediate.                         Auto Offline data collection on/off support.                         Suspend Offline collection upon new                         command.                         Offline surface scan supported.                         Self-test supported.                         Conveyance Self-test supported.                         Selective Self-test supported.     SMART capabilities:            (0x0003) Saves SMART data before entering                         power-saving mode.                         Supports SMART auto save timer.     Error logging capability:        (0x01) Error logging supported.                         General Purpose Logging supported.     Short self-test routine      recommended polling time:    (   2) minutes.     Extended self-test routine     recommended polling time:    ( 255) minutes.     Conveyance self-test routine     recommended polling time:    (   5) minutes.     SCT capabilities:          (0x3035) SCT Status supported.                         SCT Feature Control supported.                         SCT Data Table supported.          SMART Attributes Data Structure revision number: 16     Vendor Specific SMART Attributes with Thresholds:     ID# ATTRIBUTE_NAME          FLAG     VALUE WORST THRESH TYPE      UPDATED  WHEN_FAILED RAW_VALUE       1 Raw_Read_Error_Rate     0x002f   200   200   051    Pre-fail  Always       -       0       3 Spin_Up_Time            0x0027   148   148   021    Pre-fail  Always       -       9575       4 Start_Stop_Count        0x0032   100   100   000    Old_age   Always       -       95       5 Reallocated_Sector_Ct   0x0033   200   200   140    Pre-fail  Always       -       0       7 Seek_Error_Rate         0x002e   200   200   000    Old_age   Always       -       0       9 Power_On_Hours          0x0032   099   099   000    Old_age   Always       -       820      10 Spin_Retry_Count        0x0032   100   253   000    Old_age   Always       -       0      11 Calibration_Retry_Count 0x0032   100   253   000    Old_age   Always       -       0      12 Power_Cycle_Count       0x0032   100   100   000    Old_age   Always       -       93     192 Power-Off_Retract_Count 0x0032   200   200   000    Old_age   Always       -       65     193 Load_Cycle_Count        0x0032   196   196   000    Old_age   Always       -       12824     194 Temperature_Celsius     0x0022   119   116   000    Old_age   Always       -       33     196 Reallocated_Event_Count 0x0032   200   200   000    Old_age   Always       -       0     197 Current_Pending_Sector  0x0032   200   200   000    Old_age   Always       -       0     198 Offline_Uncorrectable   0x0030   200   200   000    Old_age   Offline      -       0     199 UDMA_CRC_Error_Count    0x0032   200   200   000    Old_age   Always       -       0     200 Multi_Zone_Error_Rate   0x0008   200   200   000    Old_age   Offline      -       0          SMART Error Log Version: 1     No Errors Logged          SMART Self-test log structure revision number 1     Num  Test_Description    Status                  Remaining  LifeTime(hours)  LBA_of_first_error     # 1  Short offline       Completed without error       00%       787         -     # 2  Extended offline    Completed without error       00%       727         -          SMART Selective self-test log data structure revision number 1      SPAN  MIN_LBA  MAX_LBA  CURRENT_TEST_STATUS         1        0        0  Not_testing         2        0        0  Not_testing         3        0        0  Not_testing         4        0        0  Not_testing         5        0        0  Not_testing     Selective self-test flags (0x0):       After scanning selected spans, do NOT read-scan remainder of disk.     If Selective self-test is pending on power-up, resume after 0 minute delay.      It seems offline testing is supported. When I issue `smartctl -o on`, `smartctl -c` shows that `Offline data collection status` has been set to `(0x82)`. If I issue `smartctl -o off` the same value becomes `(0x02)`. I have set up smartd to start up with the server by setting `start_smartd=yes` in `/etc/default/smartmontools`. How would you recommend that I configure smartd by editing `/etc/smartd.conf` for this server? Please describe each parameter you use and why you use it the way you do. I will add my current set up as an answer. Feel free to use it as a base and improve it in your own answer. A better description using the same set up would be an improvement too!


title: When connecting with GNU Screen (patched version) RPi reprompts for password in kind of loop

text: I'm sorry this is a repost of my question on raspberrypi.stackexchange.com, but I didn't get an answer there, so I thought I could post it here. If not, please suggest some other way to get help. I have a Raspberry Pi (running Raspian) and want to connect to it with a console cable. I succeeded - and I tried twice, because it had worked before, but malfunctioned the second time (this is a follow-up on a previous question on raspberrypi.stackexchange.com) - and after these two times I waited for a few minutes and then, it suddenly didn't work anymore. Now, when I connect with screen (`sudo screen /dev/cu.PL[some long number] 115200`) I can see the password prompt, but within a few milliseconds a new one appears, in some kind of loop. A screen shot illustrates it best, I think: ![enter image description here](http://i.stack.imgur.com/o5NOn.png) It doesn't stop echoing these two lines, and it happens far two quick to even read it without making a screenshot, let alone typing a username and password.


title: permission denied on scripts in ~/bin

text: I set some additional locations to the `PATH` environment variable in my `~/.bashrc` so that these are included/sourced in logins and non-interactive scripts that are scheduled with `cron`. I've noticed though that on one system the `PATH` is modified correctly, but none of the scripts within will run despite ownership and permissions being set correctly (as far as I can tell).               $ ls -l     total 756     -rw-r-xr-x 1 slackline slackline    300 Sep  6 07:35 backup     -rwxr-xr-x 1 slackline slackline    978 Dec 30 10:28 bbc_mpd     -rwxr-xr-x 1 slackline slackline 355483 Nov 29 07:31 get_iplayer     -rwxr-xr-x 1 slackline slackline    110 Sep  6 07:35 rsync.albums     -rwxr-xr-x 1 slackline slackline    114 Sep  6 07:35 rsync.climbing     -rwxr-xr-x 1 slackline slackline    108 Sep  6 07:35 rsync.films     -rwxr-xr-x 1 slackline slackline    125 Sep  6 07:35 rsync.mixes     -rwxr-xr-x 1 slackline slackline    117 Sep  6 07:35 rsync.pics     -rwxr-xr-x 1 slackline slackline    117 Sep  6 07:35 rsync.torrents     -rwxr-xr-x 1 slackline slackline     95 Sep  6 07:35 rsync.work      The contents of one of my scripts, which synchronizes a directory to my NAS to back it up:               $ cat ~/bin/rsync.work      #!/bin/bash     source ~/.keychain/$HOSTNAME-sh     /usr/bin/rsync -avz /mnt/work/*  readynas:~/work/.      which fails to run when called:               $ rsync.work     bash: /home/slackline/bin/rsync.work: Permission denied      but works when preceeded with `bash -x` :               $ bash -x /home/slackline/bin/rsync.work     + source /home/slackline/.keychain/kimura-sh     ++ SSH_AUTH_SOCK=/tmp/ssh-P3GL1A3Juwhe/agent.4209     ++ export SSH_AUTH_SOCK     ++ SSH_AGENT_PID=4210     ++ export SSH_AGENT_PID     + /usr/bin/rsync -avz /mnt/work/android /mnt/work/arch /mnt/work/classes /mnt/work/doc /mnt/work/linux /mnt/work/lost+found /mnt/work/nc151.tar /mnt/work/nc152now-11.rar /mnt/work/personal /mnt/work/ref /mnt/work/scharr 'readynas:~/work/.'     sending incremental file list          sent 1,176,907 bytes  received 19,786 bytes  30,296.03 bytes/sec     total size is 27,852,538,230  speedup is 23,274.59     $ set -x ; ~/bin/rsync.work ; set +x     + /home/slackline/bin/rsync.work     bash: /home/slackline/bin/rsync.work: Permission denied     + set +x     $ set -x ; bash -x ~/bin/rsync.work ; set +x     + bash -x /home/slackline/bin/rsync.work     + source /home/slackline/.keychain/kimura-sh     ++ SSH_AUTH_SOCK=/tmp/ssh-P3GL1A3Juwhe/agent.4209     ++ export SSH_AUTH_SOCK     ++ SSH_AGENT_PID=4210     ++ export SSH_AGENT_PID     + /usr/bin/rsync -avz /mnt/work/android /mnt/work/arch /mnt/work/classes /mnt/work/doc /mnt/work/linux /mnt/work/lost+found /mnt/work/nc151.tar /mnt/work/nc152now-11.rar /mnt/work/personal /mnt/work/ref /mnt/work/scharr 'readynas:~/work/.'     sending incremental file list          sent 1,174,755 bytes  received 19,786 bytes  39,165.28 bytes/sec     total size is 27,852,538,230  speedup is 23,316.52     + set +x      My `~/.bashrc` has the following line in it.               $ grep PATH ~/.bashrc     # Additions to system PATH     PATH="/home/slackline/bin:$PATH:/usr/local/stata/:/usr/local/stattransfer/"     export PATH      And I can run the `rsync` command at the command line myself (so it's not a case of permission being denied on the SSH connection).               $ /usr/bin/rsync -avz /mnt/work/*  readynas:~/work/.     sending incremental file list          sent 1,176,723 bytes  received 19,786 bytes  32,781.07 bytes/sec     total size is 27,852,538,230  speedup is 23,278.17      (Backup is obviously up to date). The version of Bash installed is:               $ eix -Ic bash     [I] app-admin/eselect-bashcomp (1.3.6@08/29/13): Manage contributed bash-completion scripts     [I] app-shells/bash (4.2_p45@08/16/13): The standard GNU Bourne again shell     [I] app-shells/bash-completion (2.1@08/28/13): Programmable Completion for bash     [I] app-shells/gentoo-bashcomp (20121024@08/28/13): Gentoo-specific bash command-line completions (emerge, ebuild, equery, repoman, layman, etc)     Found 4 matches.      The permissions on the directory (and its structure) are:               $ ls -l ~/ | grep bin     drwxr-xr-x  2 slackline slackline 4096 Dec 30 10:29 bin     $ stat -c"%n (%U) %a" / /home /home/slackline /home/slackline/bin     / (root) 755     /home (root) 755     /home/slackline (slackline) 755     /home/slackline/bin (slackline) 755      And an `strace` shows               $ strace rsync.work     strace: Can't stat 'rsync.work': No such file or directory     $ echo $PATH     /home/slackline/bin:~/bin:/usr/local/bin:/usr/bin:/bin:/opt/bin:/usr/x86_64-pc-linux-gnu/gcc-bin/4.8.2:/usr/games/bin:/usr/local/stata/:/usr/local/stattransfer/:/usr/local/stata/:/usr/local/stattransfer/     $ ls -l ~/bin/ | grep work     -rwxr-xr-x 1 slackline slackline     95 Sep  6 07:35 rsync.work     $ rsync.work      bash: /home/slackline/bin/rsync.work: Permission denied      I can't work out what's going wrong here and would be grateful of any thoughts/ideas on how to trouble shoot this. EDIT : Tidied up the various edits made in response to questions to hopefully read a bit more coherently and make it easier to follow what I'd tried and how it fits in with Mark Plotnick's solution.


title: SSH accesss between CentOS and Vmware installed Ubuntu

text: I am here to request the Linux lads about using the SSH type remote access between my CentOS (Host) and VMWare installed Ubuntu. I am not new to Linux but I am completely new with practical experience of SSH. Any help would be appreciated.


title: How to show the percentage progress of script execution in Unix?

text: Suppose you run some script such as a perl or tcl. For example, `$ ./script.sh; ./script.pl; source script.tcl`. It takes some time to get executed and return to prompt. How to display the percentage of execution meanwhile the execution? Below you can find an example UI. It displays the execution time taken for the script at the end.               1% Completed the exectuion of script.pl     2% Completed the exectuion of script.pl     . . . .     100% Completed the the exectuion of script.pl          Ex: Execution time for script.pl is :50 Seconds


title: Fedora 15 Gnome Shell Pauses on certain wireless networks

text: Whenever I connect to my girlfriend's wireless network, gnome shell will "pause" randomly. Gnome shell quits updating or drawing. The clock is set to use seconds, and will pause for anywhere from 1 to 15 seconds (no render updates, then suddenly jumps). X seems to still be running- when these pauses happen, any text I type will appear when gnome is unpaused and the mouse cursor is very responsive. During these pauses, I can also switch to a different terminal (Ctrl+Alt+F2) and work normally. This does not happen on any other wireless networks. I have not tested connecting to the AP over ethernet. Any ideas on what could be causing this? AP is a Verizon licensed Actiontec MI424-WR Rev.D               [~]$ lspci | grep -i net     03:00.0 Network controller: Intel Corporation Centrino Ultimate-N 6300 (rev 35)     [~]$ lspci -vv -s 03:00.0     03:00.0 Network controller: Intel Corporation Centrino Ultimate-N 6300 (rev 35)         Subsystem: Intel Corporation Centrino Ultimate-N 6300 3x3 AGN         Control: I/O- Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B- DisINTx+         Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx-         Latency: 0, Cache Line Size: 64 bytes         Interrupt: pin A routed to IRQ 52         Region 0: Memory at ded00000 (64-bit, non-prefetchable) [size=8K]         Capabilities: <access denied>         Kernel driver in use: iwlwifi         Kernel modules: iwlwifi     [~]$ modinfo iwlwifi (http://pastie.org/3455752)      [Edit]               --- 192.168.1.1 ping statistics ---     109 packets transmitted, 107 received, 1% packet loss, time 108140ms     rtt min/avg/max/mdev = 0.817/5.932/96.705/14.555 ms      No noticeable changes in ping times during a "pause" event. [Edit 2] Nothing in dmesg or /var/log/messages [Edit 3, answers for Kaptk2] WEP encryption, AP does DHCP, I am assuming Wireless N because the AP and card are both modern, but cannot confirm that. PS How do I confirm that? `iw dev wlan0 station dump` does not have the needed info. [Edit 4, more on the AP]               [~]$ iw wifi0 scan ssid VL440     BSS 00:1f:90:e2:73:17 (on wlan0) -- associated         TSF: 198981120700 usec (2d, 07:16:21)         freq: 2462         beacon interval: 100         capability: ESS Privacy ShortPreamble SpectrumMgmt ShortSlotTime (0x0531)         signal: -41.00 dBm         last seen: 99 ms ago         Information elements from Probe Response frame:         SSID: VL440         Supported rates: 1.0* 2.0* 5.5* 6.0 9.0 11.0* 12.0 18.0          DS Parameter set: channel 11         Country: US     Environment: Indoor/Outdoor                 Channels [1 - 11] @ 27 dBm         Power constraint: 0 dB         ERP: <no flags>         Extended supported rates: 24.0 36.0 48.0 54.0          WMM:     * Parameter version 1                  * u-APSD                  * BE: CW 15-1023, AIFSN 3                  * BK: CW 15-1023, AIFSN 7                  * VI: CW 7-15, AIFSN 2, TXOP 3008 usec                  * VO: CW 3-7, AIFSN 2, TXOP 1504 usec


title: pxe boot: problems with /etc/resolv.conf

text: I'm pxe booting a node (Ubuntu 11.10). The image of the node is created with debootstrap. Works great. Everything is loaded. When I login to the node I see that /etc/resolv.conf is empty. In the base image it's empty also but I expected the ubuntu boot process to fill it with a nameserver. When, on the node, I do `sudo service networkinging {start,restart}` nothing changes to `etc/resolv.conf`. When I do a `dhclient` I get: `RNETLINK answers: File exists` but `/etc/resolv.conf` then contains the correct nameserver from my dhcp-server.   * The linuxrc I use can be found on github.    * (Part) of the bootscreen can be found on imgur. I'd rather not add static entries to /etc/network/interfaces because I don't know if all the nodes have the same configuration. I'd rather have this more dynamic. If I'd add eth0 with a dhcp option to /etc/network/interfaces it works. What am I doing wrong? Why doesn't ubuntu fill the /etc/resolv.conf on boot? Is there a network-manager kind of package for the commandline without too many dependencies?


title: Xorg ignoring wine application

text: A wine application (Anarchy online, great game try it some time) is behaving very strangely. While rendering correctly, Xorg isn't picking up on it's existence, and because of this the game only refreshes it's image when another application requests that portion of the screen to be updated. For example, I will get maximum framerate if I move the window, or go into the compiz cube, while placing a terminal with top running in it behind the game will make that portion of the screen render at 3 fps (In the video I will link it's running `top -d 1.0` hence the 1 fps) whereas a quickly updating window shows the game at a more reasonable framerate. In the video I have uploaded you can see this strange behavior, as the output from the game and the `top` combine to basically split the game between fast fps and slow fps in real-time. Video of Xorg/wine issue (AFAIK can only be opened in totem and VLC, recordmydesktop is bugged) Wine bug report Does anyone know how to fix this problem? Quick xorg config file? Recompile wine? I'll settle for a cheap trick (Other than putting a looping terminal behind the game every time, that really drains CPU) Edit: Turned out it was a d3d bug, fixable by compiling 1.2.2 instead


title: zsh alias expansion

text: Is it possible to configure zsh to expand global aliases during tab completion? For example, I have the common aliases:               alias -g '...'='../..'     alias -g '....'='../../..'      but when I type for example `cd .../some<tab>` it won't expand to `cd .../something` or `cd ../../something`. Consequently, I frequently won't use these handy aliases because I can't tab complete where I want to go.


title: How do you derive the passphrase from hexadecimal wep key?

text: I have a hexadecimal WEP key in the setting of my router. When I try to connect, the system asks me for the WEP _passphrase_. **How can I derive it from my _hexadecimal_?** This is what I have:               84:12:7D:13:4D:08:31:89:A4:AF:97:07:21      What is the way to get it? Thanks a lot.


title: Multiple MODULEPATH entries in .modulesbeginenv

text: I'm switching between paths/code projects. At each place I have different modules. To handle this there is a setup script that modifies what to use. This is handled with the tool 'module'. **NOTE:** `modules` is a package for managing the environment allowing it to be reconfigured so that various applications are present on the `$PATH` or not. Problem is that each time a module path is updated a new entry is added to the file `~/.modulesbeginenv`               #!/user/bin/env tcsh          module unuse $path1     module use $path2          module add project_module      This short example adds two lines to `~/.modulebeginenv` at each call. First `MODULEPATH='paths'` without `$path1` and then `MODULEPATH='paths'` with `$path2`. It seems strange to me that the change is appended instead of updated. Is there any configuration to control this or any other way to solve it?


title: Get the last minute dated lines from list

text: If I have an input file with a list of users and their dates they were last signed in, how can I select with a `sort | awk` function the last minute lines? The dates are written in a `+%H:%M:%S` format. Example:               George 12:00:15      Max    12:01:03      Kate   10:32:54      Adam   08:21:47      Andrea 12:00:10      Current date is `12:01:04` Outcomes of an if function would be 1st, 2nd and 5th lines


title: Is getline in awk command safe to use?

text: I got weird comments on posting an `awk` answer on SO which uses the `getline` function. Here is the link to that answer. After posting my answer, a user came up with the below comment,(I don't criticize him.) > Not a good solution, it will join lines regardless of content and not > process more lines if needed. And you should avoid using getline. It states that we should avoid the `getline` function in `awk`. So my questions are,   * Is it safe to use `getline` function in awk?    * In what circumstances should we use `getline` in what cases shouldn't we?   * If this function produces unexpected results then why don't we file a bug report?


title: Is it secure to connect remotly to Mysql using shell?

text: I have created a shell script to connect to a DB and do some queries:               #/!bin/bash     ...     ...     mysql -h remote -u root --password='pw' MatchingDB      some SQL queries       My question is : Is this connection considered as Secured connection, Can any attacker sniff any query I send to the remote DB or maybe change the queries I have sent ?


title: du cannot access file - No such file or directory error

text: I have lots of subfolders inside a particular folder which in turn contains lots of smaller files. They are created programmatically and so I do not know how many of them are there inside. I decided to remove all these sub-folder and files and so I issued the command,               rm -rf foldername/      However, the rm command is taking so much time to execute which I believe is perfectly normal since it has to unlink all the files. But, I decided to check if the size of this folder is getting reduced by issuing the command,               du -sh foldername/      However, the above command gives me the error as,               du: cannot access `foldername/file': No such file or directory      Why is this error happening?


title: Error in compiling file using gcc: "/bin/sh: g++: command not found"

text: I want to compile a c++ program in Fedora Linux, but the program isn't compiled correctly. I got the following error:               /bin/sh: g++: command not found     make[1]: [*.o] Error 127      make[1]: Leaving directory      Why?


title: Best Practices for Configuring/Reading Sensor Devices

text: I have a gadget with a number of environmental sensors attached via an I2C bus, and would like to be able configure and read these sensors via an unprivileged application. Unfortunately, there doesn't appear to be a consistent way of doing this, and I was wondering what the prevailing practices were. To take a specific example: The ISL29023 is an ambient light sensor chip which has a kernel driver. In kernel 3.10.x, this device issues its reports as an input device with the input code `ABS_MISC`. The current measurement can also be read out of sysfs, alongside a pile of other entries that let you configure the chip's measurement parameters. (No entry is created under `/dev`.) If you're running as root, this is fine, but I don't want applications or servers running as root if they don't have to. The way I've been handling this so far is to create a udev rule which runs `/bin/chmod` and `/bin/chown` on the sysfs entries to change them to be writeable to members of a certain group (say, "ambilux"). Then I create a user who is a member of the ambilux group, and run the app as that user. This approach works, but messing around in sysfs this way seems fraught with peril, and was wondering if there was some superior approach that I've been missing.


title: Why does SPACE sometimes not work with more (or less)

text: Usually with `|more` I press space to get another screenful. But with some commands space just does nothing, and I need to actually keep doing SPACE- ENTER to scroll forward a screen at a time. Both `more` and `less` behave the same. On this machine this command shows both behaviours:               php -i |more;tree -A |more      With PHP I need to press ENTER after each space; with `tree` I just press SPACE and it scrolls. I've tried a few tricks, such as `2>&1` and using bash, but no luck, e.g.               bash -c "php -i 2>&1;tree -A" | more      Joining the commands like that means SPACE-ENTER is needed for the whole output. So I'm wondering if PHP is outputting some control character that upsets `more`? I've tried another machine, over SSH, and `php -i` does not have this behaviour. (I have `LESS` set to `-FRX`. However I've cleared that variable and the behaviour is the same.) This is just a minor irritant, so I'm not going to start pulling the two systems apart looking for the difference... just wondered if it rang a bell with anyone.


title: Starting GNU Parallel in background?

text: Is it possible to start GNU Parallel in the background, or somehow, send it to the background? I want to do this so that I can use two commands that run `parallel` at the same time. And why dont I execute everything in one parallel command? Two reasons, 1. parallel slows down after a while, 2. because I want to separate it so I can stop execution of one group without stoping everythnig


title: How can I bind together several wifi adapters into one internet connection?

text: I would like to get around an unnecessary and extremely tight (20k) speed cap per wifi client on a wifi network providing internet. Each client passes through a captive portal that requires just clicking a button for 24 hours of use. What are some basic recipes for configuring a Linux box with four wifi adapters to combine them into a single 80k link that is transparent to applications, so for example if I go to speedtest.com in a browser, it will read 80k? Secondly, is there any way of doing this with only one wifi adapter, but simulate four by connecting to the wifi network with four different Mac addresses?


title: Can't print pdf file with lpr

text: I am currently using Arch linux. I am trying to print a pdf file for the command line, it is easier that way as I need to print several range of pages. Just for testing I issue a command to print a text file:               lpr a.txt      And it prints ok. Now I want to print the pdf file:                lpr -P HP_LaserJet_2300_series       -o page-ranges=80-81       -o media=a4       -o sides=two-sided-long-edge       -o scaling=110      "Introductory and Intermediate Algebra - Aufmann 4th.pdf"      When I issue `lpq` this is the result:               HP_LaserJet_2300_series is ready     Rank    Owner   Job     File(s)                           Total Size      1st     alber   321     Introductory and Intermediate A   32868352 bytes      So the file is in the queue but is not printing and there are no processing jobs on the printer either. I then access CUPS web interface. I look at state of the pending jobs and the following message appears:               stopped  "Exception: /var/spool/cups/d00321-001      (file position 32580806): unknown token while reading object (PDF)"


title: Compare users out of an array with /etc/shadow file

text: I want to check for all users who do not have a password set. For example, a user with the following entry in `/etc/passwd`               test01::15164: ...*       has no password set. I would like to list all such users.               declare -a liste=(test 01 test02)     for a in `echo ${liste[@]}`     do         for b in `cat /etc/shadow`         do             if [[ "$a" == "$b" ]]             then                 echo $a             fi         done     done      The code doesn't give any output or errors **Solution** The entry in the shadow file witout a password are usertest01 & tecusertest01               declare -a liste=(usertest01 usertest 02 tecusertest01 tecusertest02)          for sdw in `awk -F: '$2 == ""' /etc/shadow`                  do                          user=`echo "$sdw" | awk -F: '{print $1}'`                          echo "$user"                          echo  "${liste[@]}" | grep "$user" > /dev/null                          if [ $? -eq 0 ]                             then                                          echo "Human user"                                          echo "$user"  | passwd "$user" --stdin                                  else                                          echo "Technical User"                          fi                  done      **Output**               usertest01     Human user     usertest01     Changing password for user usertest01.     passwd: all authentication tokens updated successfully.     tecusertest01     Technical User


title: Basic syslog confusion

text: When an application logs using syslog does it mean that it stores the logs somewhere under /var/log? Or can it be elsewhere as well?


title: How to read user input in pipe?

text: Let's assume I have a file named `confirmation.sh` with the following content:               #!/bin/bash          echo -n "Are you sure [Y/n]? "     read line     case "$line" in         n|N) echo "smth"             ;;         y|Y) echo "smth"             ;;     esac      and I want to run this script in the following way:               cat confirmation.sh | sh      I see `Are you sure [Y/n]?` and script is interrupted. What's the problem? Thanks!


title: nc: bind failed: Address already in use

text: I am trying to execute `nc` command from a script , my script is executing `nc` command on different ports of Destination using the same source port. **e.g:**               nc -p 8140 -z -v -n 10.X.X.9 9090     nc -p 8140 -z -v -n 10.X.X.9 9091     nc -p 8140 -z -v -n 10.X.X.9 9092     nc -p 8140 -z -v -n 10.X.X.9 9093     and so on ...      After the 1st nc execution , for the remaining of all the lines I am getting below mentioned error message.               nc: bind failed: Address already in use     nc: bind failed: Address already in use     nc: bind failed: Address already in use      Is there any way of avoiding this situation. Please help.


title: How to copy three files at once instead of one file at a time in bash shell scripting?

text: I am running my shell script on `machineA` which copies the files from `machineB` and `machineC` to `machineA`. If the file is not there in `machineB`, then it should be there in `machineC` for sure. So I will try to copy file from `machineB` first, if it is not there in `machineB` then I will go to `machineC` to copy the same files. In `machineB` and `machineC` there will be a folder like this `YYYYMMDD` inside this folder -               /data/pe_t1_snapshot      So whatever date is the latest date in this format `YYYYMMDD` inside the above folder - I will pick that folder as the full path from where I need to start copying the files - so suppose if this is the latest date folder `20140317` inside `/data/pe_t1_snapshot` then this will be the full path for me -               /data/pe_t1_snapshot/20140317      from where I need to start copying the files in `machineB` and `machineC`. I need to copy around `400` files in `machineA` from `machineB` and `machineC` and each file size is `2.5 GB`. Earlier, I was trying to copy the files one by one in `machineA` which is really slow. Is there any way, I can copy "three" files at once in `machineA` using threads in bash shell script? Below is my shell script which copies the file one by one in `machineA` from `machineB` and `machineC`.               #!/usr/bin/env bash          readonly PRIMARY=/export/home/david/dist/primary     readonly FILERS_LOCATION=(machineB machineC)     readonly MEMORY_MAPPED_LOCATION=/data/pe_t1_snapshot          PRIMARY_PARTITION=(0 548 272 4 544 276 8 556 280 12 552 284 16 256 564 20 260 560 24 264 572) # this will have more file numbers around 200          dir1=$(ssh -o "StrictHostKeyChecking no" david@${FILERS_LOCATION[0]} ls -dt1 "$MEMORY_MAPPED_LOCATION"/[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9] | head -n1)     dir2=$(ssh -o "StrictHostKeyChecking no" david@${FILERS_LOCATION[1]} ls -dt1 "$MEMORY_MAPPED_LOCATION"/[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9] | head -n1)          ## Build your list of filenames before the loop.      for n in "${PRIMARY_PARTITION[@]}"     do         primary_files="$primary_files :$dir1"/t1_weekly_1680_"$n"_200003_5.data     done          if [ "$dir1" = "$dir2" ]     then         find "$PRIMARY" -mindepth 1 -delete         rsync -avz david@${FILERS_LOCATION[0]}"${primary_files}" $PRIMARY/ 2>/dev/null         rsync -avz david@${FILERS_LOCATION[1]}"${primary_files}" $PRIMARY/ 2>/dev/null     fi        So I am thinking instead of copying one file at a time, why not just copy "three" files at once and as soon these three files are done, I will move to another three files in the list to copy at same time? I tried opening three putty instances and was copying one file from those three instances at the same time. All the three files were copied in ~50 seconds so that was fast for me. And because of this reason, I am trying to copy three files at once instead of one file at a time. Is this possible to do? If yes, then can anyone provide an example on this? I just wanted to give a shot and see how this is working out. @terdon helped me with the above solution but I wanted to try copying three files at once to see how it will behave. **Update:-** Below is the simplified version of the above shell script. It will try to copy files from `machineB` and `machineC` into `machineA` as I am running the below shell script on `machineA`. It will to try copy file numbers which are present in `PRIMARY_PARTITION`.               #!/usr/bin/env bash          readonly PRIMARY=/export/home/david/dist/primary     readonly FILERS_LOCATION=(machineB machineC)     readonly MEMORY_MAPPED_LOCATION=/data/pe_t1_snapshot          PRIMARY_PARTITION=(0 548 272 4 544 276 8 556 280 12 552 284 16 256 564 20 260 560 24 264 572) # this will have more file numbers around 200          dir1=/data/pe_t1_snapshot/20140414     dir2=/data/pe_t1_snapshot/20140414          ## Build your list of filenames before the loop.      for n in "${PRIMARY_PARTITION[@]}"     do         primary_files="$primary_files :$dir1"/t1_weekly_1680_"$n"_200003_5.data     done          if [ "$dir1" = "$dir2" ]     then         # delete the files first and then copy it.         find "$PRIMARY" -mindepth 1 -delete         rsync -avz david@${FILERS_LOCATION[0]}"${primary_files}" $PRIMARY/         rsync -avz david@${FILERS_LOCATION[1]}"${primary_files}" $PRIMARY/     fi


title: Merging /usr/bin and /usr/sbin into /bin (GNU/Linux)

text: I've read quite a number of discussions about people wanting to merge /bin and /sbin into /usr/bin. The same cannot be said for doing it the other way around. Is there any technical reason why one would not want to merge /usr/bin and /usr/sbin into /bin, or is it mainly a personal preference/design choice?


title: error while executing make commad in ubuntu terminal

text: While trying to install the `som_pak-3.1-NAcMoS.tar.gz` file, I've used the below commands:               $ tar xvf som_pak-3.1-NAcMoS.tar.gz     $ cd som_pak-3.1     $ cp makefile.unix makefile     $ make     $ cd ..     $ ln -s som_pak-3.1 $NACMOS_HOME/som_pak      But while executing the `make` command I'm getting the following error: > _*_ missing separator (did you mean TAB instead of 8 spaces?). Stop.   * Can anybody tell me the reason for the error?   * Is there any packages need to include with this?


title: "Error inserting microcode" on new install of Fedora 15

text: I started getting an error that looked like this the other day, and I Googled the problem but couldn't find the solution (probably because I don't quite to know what to Google), so I reinstalled the OS, but the error continues. What is the problem, and how can I go about fixing it? ![Fedora 15 boot error](http://i.stack.imgur.com/N1qN4.jpg) The `modprobe` error near the end is: > modprobe: FATAL: Error inserting microcode > (/lib/modules/2.6.40.6-0.fc15.i686/kernel/arch/x86/kernel/microcode.ko): > Invalid argument > > udev-work[520]: '/sbin/microcode_ctl -Qu' unexpected exit with status 0x000f At the moment, my CMOS battery has died and my BIOS is running with the default settings (whether this would make any difference, im not sure).


title: OpenBSD NFS server with Linux NFS clients -- file size limit?

text: I've set up an NFS server on OpenBSD 4.9. The client is Arch Linux x86-64. The mount has no problems with small files but when trying to read large files (in the example, an 7.4G iso file) it will simply freeze. Any program that tries to read from it seems to just get stuck. For example I tried               hexdump -n 100 big.iso      and it ends up doing nothing. And I end up having to kill hexdump and I always have to force an unmount on the NFS mount. I'm mounting it as so on Linux:               sudo mount -t nfs -o noatime,intr,vers=3 192.168.1.50:/home/shared /mnt      The OpenBSD /etc/exports file is as so:               /home/shared -alldirs -ro -mapall=remote -network=192.168.1.0 -mask=255.255.255.0      And I've checked and making a small text file in the shared directory can be be read from Linux. And the small text file and big iso file have the same permissions and owners. Has anyone else had this problem? According to the man pages, OpenBSD's nfs server should implement NFSv3.


title: Executable symbolic link results in "command not found"

text: I created a symbolic link (yesterday) like this:               sudo ln -s bin/python /usr/bin/prj-python      When I run:               prj-python file.py      I get:               prj-python: command not found      When I try creating the link again, I get: > ln: creating symbolic link `/usr/bin/prj-python': File exists Why is that happening? My `$PATH` is: > > /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/opt/real/RealPlayer