title: Grub with two hard drives

text: I am trying to install Mint14 on my machine having two hard drives : Samsung SSD PM830 SATA : 128 Gb ( sda ) - Windows 7 (i want to keep this) ST9500423AS ATA : 500 Gb ( sdb ) - Install Linux During installation i partitioned sdb into 150Gb and 350Gb and installed Linux on 350Gb partition. During the process,I noticed that installer is running "grub install sdb". But after reboot , Grub screeen doesnt appear and just boot up Windows. How to fix this issue?


title: How to convert JPG files to one JPG file

text: I have several JPG files from a PDF file, so concatenating the JPG files need to be "under each other". How can I do this?


title: Is it a good practice to have different users for different contexts?

text: I'm a software developer and I have a new laptop with Ubuntu. I plan to set up this laptop as a development workstation where I'll do my professional work (for my company) and also I'll develop some personal/home software. I want to have my professional stuff (applications, software libraries, configurations, etc.) separate (as much as possible, in terms of tydiness, for example, unity launchers, application settings, apps at startup, broswer settings, etc. If I switch from one user to another it has to look like different environments) from my personal stuff. So I think having separate users for separate contexts: one user for professional work and another user for personal work (and a guest user too). But I'll have two users for only one person (only I use this laptop). It's not a big problem, but, is it a good practice to have different users for different contexts? Is there a better way to solve this issue?


title: Applying and linking all settings/binaries of one user to another user in Linux

text: In a linux machine, we may have to compile our programs with respect to that linux machine. Now, if we already have some other users (not root. A typical user.) who have already compiled many programs for this machine, is it possible to do something like this? For instance, user oldGuy got mpirun, python, and several other programs in his home directory, and he can invoke "mpirun" or any other binaries in his directory without having to type "./mpirun". Bash knows which binary he is referring to. He also has various other settings done. Now, suppose we have a new user called newGuy. If in our server, oldGuy already has compiled all the binaries that newGuy wanted, instead of having the newGuy wasting his time compiling programs that oldGuy already has and set everything correctly, can the newGuy "inherit" some binaries, settings, etc. from oldGuy? For example, oldGuy can simply invoke "mpirun" right from Bash, can newGuy do anything in order to be on the same page (all identical settings) with oldGuy right away, without having to compile the programs and set other settings, etc?


title: keyboard lockup after hold ctrl key

text: With Fedora 17 I have a PS/2-connected keyboard. If I hold just the left `CTRL` key down for a period (say 5 seconds) then the whole keyboard locks up. The USB-connected mouse still works and I can navigate menus, etc. I can logout and then the keyboard works for login. While locked up I cannot use `CTRL`-`ALT`-`2`, etc., to switch to a different virtual terminal. Anyone seen similar symptoms and/or have a clue as to the cause and/or a cure?


title: Mounting Directory - Connection Refused

text: I am trying to mount a Directory from my server to my local machine. This is because I want to edit the directory and execute the files without having the manually push the files to the server after each edit. I am using NFS and currently getting: 'Connection refused' when I try to mount from a machine on the same network. My server ip is 192.168.0.12.   My local machine ip is 192.168.0.2. And in `/etc/exports` I have:               /mnt/export 192.168.0.0/24(rw,async,no_subtree_check)     /mnt/export *(rw)      where `/mnt/export` is the directory I want to mount and I have `chmod 777 -r` the directory On my local machine I execute this command:               mount 192.168.0.12:/mnt/export /Desktop/tes      But get this error:               can't mount /mnt/export from 192.168.0.12 onto /Desktop/tes:     Connection refused      Does anyone have any idea to where I am going wrong?


title: redirect sound (microphone) via ssh, how to telephone via ssh?

text: **How can I redirect the microphone of one computer to listen to it on another computer via ssh? Which is the right device or which is the right command line?** Some years ago it was easy and fun to redirect sound from a remote microphone to a local computer or vice versa – it was an easy telephone. There are some instructions for it, but none of them seem to work on newer computers/linux distros. I don’t even have a `/dev/audio` on my computer (Fedora 17). I think that it may have something to do with pulse audio. Or don’t I need pulse audio for this simple telephone? Which is the right device? I can see all my sound devices when I start `alsamixer` and press the F6 key. But I don’t know which are the devices in my `/dev` tree.


title: RHEL 5 Server running with 8 core. Load is always 0 or 1. but RAM (8GB) always occupied

text: I am seeing load is `0` or `1` since a few weeks on my RHEL5 server with 8 cores.   But RAM always fully occupied. I am trying to debug the issue. How can we diagnose where memory is going?


title: Can sudo to user but 'run command as' is denied?

text: I was wondering how to run a command as another user from a script without password. `sudo -l` return: `(root) NOPASSWD: /bin/su - someuser` There is no problem to sudo as `someuser`. Command `sudo su - someuser` works without password. But every time I try to execute command as this user I'm prompted for password. I tried both: ` sudo su -c pwd someuser sudo -u someuser pwd` Are there any alternatives? What is the cause of the problem? I don't have root access.


title: What distribution still supports the 2.6.x kernel?

text: I'm trying to use a _Khepera III_ robot. The documentation says I need a Linux OS with kernel 2.6.x. An Ubuntu 8 image was provided at the website. When I created a virtual machine with that image, I tried to install the packages I need for using Kheperra III but I couldn't. I tried also to install the updates but I couldn't since this version of Ubuntu is not supported anymore. What Linux OS still supports kernel 2.6.x and allows me to install modern packages?


title: What driver is being used by a wireless usb adapter?

text: I've installed Linux Mint 16 on a netbook I'm trying to pump more life into. I'm currently stuck with configuring the wireless as the computer uses a USB wireless adapter (rt5370 from Ralink) due to its own wireless interface being hard blocked (the fn key is broken). The connection is protected by WPA. I installed the linux driver and I'm able to scan for networks nearby. However, when I try to:               $ wpa_supplicant -B -i ra0 -DWext -c /etc/wpa_supplicant.conf      I get:               ra0: Unsupported driver 'wext'      I've tried different drivers and none of them work. I've also tried finding out what driver the wireless adapter uses (in theory it should be rt5370sta which is what I installed) to no avail. Tried lsusb, lspci -k and lsmod but none of them list the driver I need to be using. Does anyone know whether I'm asking the right question or if the problem lies somewhere else? I was confident this was it as `iwlist ra0` does work and `/etc/wpa_supplicant.conf` is configured as per the instructions over here:   * https://www.linux.com/learn/tutorials/374514-control-wireless-on-the-linux-desktop-with-these-tools I tried wifi-radar, which gets stuck on the same issue (ends up completely unresponsive and I have to reboot computer in order to start it up again; killing the process doesn't work). Computer has no internet access but I can use Keryx to update or install packages. Any help with figuring this out in order to get the internet working is very much appreciated!


title: Problem with Angstrom USB driver

text: I am connecting a Huawei E3131B USB 3G modem to my Beaglebone Black running Angstrom. When I connect it directly, the USB acts funny. Sometimes it picks up the modem, sometimes it dissapears from lsusb after a while (and loses power), and sometimes it does not pick it up at all. I need to make sure that it will have a stable connection with my board every time I start up. How do I go about doing this? The problem occurs even if I don't hotplug. One way I have got it to work is connecting it through a USB hub. When connected through the hub, it seems to work fine, but I cannot always have the hub present...


title: How can we revisit screen command?

text: Screen command is a command we use to ensure that the command is not interrupted. Well, internet connection is interrupted. So I want to go back. I typed `screen` and go to a new screen. What about if I want to visit the previous screen, where I ran the command?


title: Attempts to get DHCP lease on unplugged ethernet interface / delays boot

text: When I boot up (or restart networking, as show below) my Debian system, it attempts to get a DHCP lease on my network interface that is unplugged, as you'll see below, it succeeds fine on the wireless later; unfortunately it delays boot by around a minute.               root@**HOSTNAME**:~# cat /etc/network/interfaces      # This file describes the network interfaces available on your system     # and how to activate them. For more information, see interfaces(5).          # The loopback network interface     auto lo     iface lo inet loopback          # The primary network interface     auto eth0     allow-hotplug eth0     iface eth0 inet dhcp          auto wlan0     iface wlan0 inet dhcp         wpa-ssid **THE-NETWORK-NAME**         wpa-psk **THE-PASSPHRASE**     root@**HOSTNAME**:~# /etc/init.d/networking restart     [warn] Running /etc/init.d/networking restart is deprecated because it may not re-enable some interfaces ... (warning).     [....] Reconfiguring network interfaces...Internet Systems Consortium DHCP Client 4.2.2     Copyright 2004-2011 Internet Systems Consortium.     All rights reserved.     For info, please visit https://www.isc.org/software/dhcp/          Listening on LPF/wlan0/**WIRELESS-MAC-ADDR**     Sending on   LPF/wlan0/**WIRELESS-MAC-ADDR**     Sending on   Socket/fallback     DHCPRELEASE on wlan0 to **DHCP-IP-ADDR** port 67     Internet Systems Consortium DHCP Client 4.2.2     Copyright 2004-2011 Internet Systems Consortium.     All rights reserved.     For info, please visit https://www.isc.org/software/dhcp/          Listening on LPF/eth0/**WIRED-MAC-ADDR**     Sending on   LPF/eth0/**WIRED-MAC-ADDR**     Sending on   Socket/fallback     DHCPRELEASE on eth0 to **DHCP-IP-ADDR** port 67     Internet Systems Consortium DHCP Client 4.2.2     Copyright 2004-2011 Internet Systems Consortium.     All rights reserved.     For info, please visit https://www.isc.org/software/dhcp/          Listening on LPF/eth0/**WIRED-MAC-ADDR**     Sending on   LPF/eth0/**WIRED-MAC-ADDR**     Sending on   Socket/fallback     DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 7     DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 7     DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 7     DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 10     DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 12     DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 10     DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 8     No DHCPOFFERS received.     No working leases in persistent database - sleeping.     Internet Systems Consortium DHCP Client 4.2.2     Copyright 2004-2011 Internet Systems Consortium.     All rights reserved.     For info, please visit https://www.isc.org/software/dhcp/          Listening on LPF/wlan0/**WIRELESS-MAC-ADDR**     Sending on   LPF/wlan0/**WIRELESS-MAC-ADDR**     Sending on   Socket/fallback     DHCPDISCOVER on wlan0 to 255.255.255.255 port 67 interval 6     DHCPDISCOVER on wlan0 to 255.255.255.255 port 67 interval 14     DHCPREQUEST on wlan0 to 255.255.255.255 port 67     DHCPOFFER from **DHCP-IP-ADDR**     DHCPACK from **DHCP-IP-ADDR**     bound to **WIRELESS-IP-ADDR-FROM-DHCP** -- renewal in 597 seconds.     done.      I'm probably neglecting something really obvious, but right now I'm stumped. Any ideas?


title: Trying to change GID on AIX server

text: I am trying to change GID on Unix server "AIX". I want to change `mygroupname:!:79002:` from group GID from `79002` to `79003`. I have permission to use sudo `/usr/bin/chgroup`. I have tried everything, but I am still not able to change it.


title: How to disable ctrl+wheel font resize in konsole/yakuake

text: Which is quite annoying when I mistouch touchpad with two fingers.


title: Why doesn't cups detect my canon selphy USB printer

text: I recently upgraded my system to a fresh install of Linux Mint 16. I was hoping that would support my Canon Selphy CP770, since that is claimed to be supported by the new version of Gutenprint. However, the system isn't detecting it, and the printer config has no option to add a USB printer.               pts/0:0:~>lsusb     Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub     Bus 004 Device 006: ID 058f:6362 Alcor Micro Corp. Flash Card Reader/Writer     Bus 004 Device 002: ID 046d:c018 Logitech, Inc. Optical Wheel Mouse     Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub     Bus 001 Device 009: ID 03f0:6411 Hewlett-Packard PhotoSmart C8100 series     Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub     Bus 003 Device 004: ID 04a9:31aa Canon, Inc. SELPHY CP770     Bus 003 Device 002: ID 058f:9254 Alcor Micro Corp. Hub     Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub               pts/0:1:~>sudo /usr/lib/cups/backend/usb     DEBUG: Loading USB quirks from "/usr/share/cups/usb".     DEBUG: Loaded 67 quirks.     DEBUG: list_devices     DEBUG: libusb_get_device_list=9     DEBUG2: Printer found with device ID: MFG:HP;MDL:Photosmart C8100 series;CMD:MLC,PCL,PML,DW-PCL,DESKJET,DYN;1284.4DL:4d,4e,1;CLS:PRINTER;DES:L2526A;SN:MY79JD701404YH;S:038008C4840010210078cb0000041bd800346b8006447b8006444b8001b48b8006445b8001d;Z:0102,05000009316a81013241013241013241013241013241,0620,070000000000000000000000000000,0b000000000000000098129841000098b798f4000098ba98f9000098b898e7000098b798f9000098b798d8,0c0; Device URI: usb://HP/Photosmart%20C8100%20series?serial=MY79JD701404YH&interface=1     direct usb://HP/Photosmart%20C8100%20series?serial=MY79JD701404YH&interface=1 "HP Photosmart C8100 series" "HP Photosmart C8100 series" "MFG:HP;MDL:Photosmart C8100 series;CMD:MLC,PCL,PML,DW-PCL,DESKJET,DYN;1284.4DL:4d,4e,1;CLS:PRINTER;DES:L2526A;SN:MY79JD701404YH;S:038008C4840010210078cb0000041bd800346b8006447b8006444b8001b48b8006445b8001d;Z:0102,05000009316a81013241013241013241013241013241,0620,070000000000000000000000000000,0b000000000000000098129841000098b798f4000098ba98f9000098b898e7000098b798f9000098b798d8,0c0;" ""


title: How to start to use httpd with socket activation (systemd)?

text: The apache httpd server is seldom needed on one of our small servers, so it would be nice to start it via socket activation by systemd (and later stopped it when no traffic occurred for some time). Is this possible and if so, how?


title: How to copy files within a remote server?

text: I would like to copy files in an remote server from one directory (in the remote server) to another (also in the same remote server). I tried this:               scp -r myacc@remote.server:/folder_a/*myfiles* ../folder_b      This did no give any error message, but it did not work. I also tried this:               scp -r myacc@remote.server:/folder_a/*myfiles* myacc@remote.server:/folder_b      which gave an error message: > Permission denied, please try again. Permission denied, please try again. > Received disconnect from : 2: Too many authentication failures for myacc > lost connection How to copy files within a same server from one directory to another?


title: processor(s) statistics that is one day old

text: I already know how to use `grep -w cpu /proc/stat` in order to get the cpu stats and identify the user mode. Percentage wise, I just divide it my the total time from the `/proc/uptime`. However, how can I get it for the last 24 hours. I know the `find -mtime m` and I was thinking it could be used since `/proc/stat` is a folder after all..


title: Drag and drop files with cURL

text: I know that curl supports file upload e.g. here. Is it possible to upload files to site which has HTML5 Drag and Drop box for file uploading


title: why is setting a variable before a command legal in bash?

text: I've just encountered several answers such as to parsing a delimited text file... that use the construct:               while IFS=, read xx yy zz;do         echo $xx $yy $zz     done < input_file      where the `IFS` variable is set before the `read` command. I've been reading through the bash reference but can't figure out why this is legal. I tried               $ x="once upon" y="a time" echo $x $y      from the bash command prompt but got nothing echoed. Can someone point me to where that syntax is defined in the reference that allows the IFS variable to be set in that way? Is it a special case or can I do something similar w/ other variables?


title: what yum repo do I need for nfs-utils

text: I downloaded yum but have 0 repos. What yum repo do I need for nfs-utils so I can do this tutoial: http://www.techrepublic.com/blog/linux-and-open-source/set-up-easy-file- sharing-with-nfs-on-linux/#.


title: Convert Unix timestamp into human-readable format on AIX

text: I need to convert unix timestamp (number of seconds since 1970, e.g. 1381260225 is Tue Oct 8 19:23:45 GMT 2013) into a standard human-readable format. I could get some answers by googling but those were not a suitable solution for me because I don't use Linux, I use an AIX 6.1 machine with ksh88. **AIX does not have GNU utilities.**


title: ssh X forwarding not working on computers outside LAN when ControlMaster is set to auto

text: I can connect to machines on my local LAN using `ssh -X` or `ssh -Y` and X forwarding works. However, when trying to connect to machines outside my LAN, X forwarding fails. I have narrowed down the problem to these lines in my `~/.ssh/config` file:               ##  Enable auto completion even when needing a password     ## as long as one connnection to the server has been established.     Host *       ControlPath ~/.ssh/master-%r@%h:%p       ControlMaster auto      This is the output of `ssh -vY` when my `~/.ssh/config` file contains _only_ the lines above:               $ ssh -vYp 1234 terdon@123.456.78.9     OpenSSH_6.2p2 Debian-6, OpenSSL 1.0.1e 11 Feb 2013     debug1: Reading configuration data /home/terdon/.ssh/config     debug1: /home/cchapple/.ssh/config line 3: Applying options for *     debug1: Reading configuration data /etc/ssh/ssh_config     debug1: /etc/ssh/ssh_config line 19: Applying options for *     debug1: auto-mux: Trying existing master     debug1: mux_client_request_session: master session id: 14     Last login: Tue Oct 15 20:12:24 2013 from foo.bar.net     terdon@server $ echo $DISPLAY          terdon@server $      Note that there is no line about requesting X11 forwarding, compare to the output below, apparently these option override the `-Y` or `-X` flag. If the `~/.ssh/config` file is empty, the output of the command above includes (I am not showing the entire thing because it is very long and I think irrelevant, let me know if it is needed):               debug1: Requesting X11 forwarding with authentication spoofing.     debug1: Sending environment.     debug1: Sending env LANG = en_US.UTF-8      And X forwarding is successful:               terdon@server $ echo $DISPLAY     localhost:11.0      I tried               Host *       ControlPath ~/.ssh/master-%r@%h:%p       ControlMaster auto       X11Forwarding yes      and               X11Forwarding yes     Host *       ControlPath ~/.ssh/master-%r@%h:%p       ControlMaster auto      But both give me this error:               Bad configuration option: X11Forwarding      ### System information:               $ lsb_release -icd     Distributor ID: LinuxMint     Description:    LMDE Cinnamon Edition     Codename:       debian     $ uname -a     Linux oregano 3.10-2-amd64 #1 SMP Debian 3.10.5-1 (2013-08-07) x86_64 GNU/Linux     $ ssh -V     OpenSSH_6.2p2 Debian-6, OpenSSL 1.0.1e 11 Feb 2013      How can I allow X forwarding and keep the configuration options I have?


title: What is the meaning of cut's -d and -f options

text: How can this pipeline be explained:               cat /etc/passwd | cut -d : -f 9 2>&1 | sort | uniq 2>&1 | wc -l      I'm learning Unix by myself and I don't really get it. What does `cut -d : -f 7 2>&1` means here?


title: bootloader configuration with GPT, RAID1, and LVM

text: Using the GUID Partition Table and RAID 1, the bootloader (syslinux or GRUB) is not able to boot into the machine, which was installed with Arch Linux. First off, there are two drives identical drives setup to use software RAID level 1. The two drives are partitioned as follows:   * `sd[ab]1` as `md2`   * `sb[ab]2` as `md1`   * `sb[ab]3` as `md0` Then the md0 is set to VolGroupArray and then split using LVM, one as `/` (root) and the other as `/home`, `md1` is set as the SWAP, and `md2` is set as `/boot`. Running the following command `grub-install --target=i386-pc --recheck --debug /dev/md2` the subsequent error occurs.               /usr/bin/grub-bios-setup warning: Embedding is not possible. GRUB can only be installed in this setup by using blocklists. However, blocklists are UNRELIABLE and their use is discouraged..     /usr/bin/grub-bios-setup error: will not proceed with blocklists      My questions:   * Should I not install GRUB on a RAID partition?    * What type of filesystem should the boot partition be?    * What are blocklists?    * What is good/bad about the partition scheme listed above?  Is it feasible to create a single partition on `sda` and `sdb` (`/dev/sda1` and `/dev/sdb1`) mirror to that with RAID1 (`/dev/md0`) and then install LVM on `md0`, then create a boot, home, root, and swap partitions on the LVM? With this schema can GRUB or syslinux boot a RAID LVM boot partition? Why or why not?


title: Drag windows with right mouse button in Linux Mint KDE

text: I like how you can drag a window with the cursor anywhere in the window by pressing `Alt` + left mouse.   1. Is it possible to drag a window by pressing and holding just the right mouse button?   2. Minimize window pressing right mouse + left mouse   3. Close window by pressing right mouse + middle mouse **N.B. This is all without holding down any keys on the keyboard.**


title: How to manage multiple panel layouts for different display setups in KDE?

text: I use my laptop in 3 display setups:   * laptop only   * laptop + monitor   * laptop + projector For each one I use different screen setup and panel layout. It's quite boring to modify layout after each display setup change. As I can use ARandr to create display setups and save them into executable, is there something similar to do same with KDE panels?


title: rsync failing to choose the correct target directory

text: I'm trying to write a short shell script which also handles copying a file called `webcam.jpg` into a date coded subdirectory. I'm using rsync for this as it automatically creates a directory if it doesn't already exist. Everything works fine when I use:               rsync -a webcam.jpg ./$(date +%Y-%m-%d)/$(date +%Y-%m-%d_%H-%M).jpg      But when going one directory deeper, rsync starts throwing errors, and I really don't have a clue why. I'm typing:               rsync -a webcam.jpg ./saved_images/$(date +%Y-%m-%d)/$(date +%Y-%m-%d_%H-%M).jpg      and my output is:               rsync: change_dir#3 "/var/www/tmp/test//./saved_images/2013-07-07" failed: No such file or directory (2)     rsync error: errors selecting input/output files, dirs (code 3) at main.c(677) [Receiver=3.0.9]     rsync: connection unexpectedly closed (9 bytes received so far) [sender]     rsync error: error in rsync protocol data stream (code 12) at io.c(605) [sender=3.0.9]      I see the relevant error in the first line, but why is rsync trying to access this `test//./saved_images` directory in the first place? What's wrong with `test/saved_images/`?


title: How to concat file and a line on-fly?

text: I would like to send to the stdout entire file + extra line. How to do this nicely? So far I did:               for LINE in $(cat $INPUT_FILE)     do       echo $LINE     done     echo $EXTRA_LINE      How to do this bash way (for real)?


title: Pass two (piped) shell commands as a parameter to a shell function

text: I have defined the following shell functions:               success() {       printf "[\033[32mSUCCESS\033[0m]\n"     }          failure() {       printf "[\033[31mFAILURE\033[0m]\n"     }          try() {       result=$($* 2>&1)       if [ $? -ne 0 ]; then         failure         echo $result         exit 1       fi       success     }      This allows me to silently execute any command, capturing all the output, and display a `SUCCESS` or `FAILURE` message. Only if the command fails, the command output is displayed for debugging:               try rm -r $tmp      But I just realized that it's limited to a single command, and fails miserably for a command piped to another with `|`:               try git archive --format=tar HEAD | tar xf - -C $tmp      Because `try` is executed only on the `git` command, and then the output of `try` is piped to `tar`, instead of the output of `git`. **Is it possible to pass the two commands`git ... | tar ...` as a single parameter to `try`**, capturing the output of both, and check if both `git` and `tar` returned `0`? Any other consideration maybe, to achieve my goal?


title: How to create merged input (stdin) for a program

text: Consider such script:               echo a     echo b     echo c      It will produce 3 lines and now I can run it like this:               abc_script | real_program      `real_program` will get in its input those 3 files. However, there is a problem for a user, instead of just calling `abc_script`, she/he has to remember to redirect the output to the `real_program`. So how to move this redirection to the script? Something like this (the script):               echo a | echo b | echo c | real_program      This does not work, it is only an illustration what I would like to do -- hide calling of `real_program` inside the script. * * * _For the record: in my case the input consists of some file, additional extra lines. So I have:_               cat $input_file     echo $extra_line      _Not just a,b,c._


title: Decimal conversion number of the form x.xx to 0x.xx, sed?

text: I have a file of the form               ...     num  0.12 num num      num 25.53 num num     num  7.82 num num     ...      and I want to convert the 2nd field of each line adding a "0" at the numbers >= 0 and < 10 so the output will have the form:               ...     num 00.12 num num     num 25.53 num nnum       num 07.82 num num     ...      I tried with               sed 's/ 7./07./2'      but it is not white space sensitive so it replaces any occurance of "7."


title: WiFi / WLAN: WPA2 authentication appears to be successful, but dhclient won't get a response

text: I'm trying to use a USB WiFi adapter to connect to a wireless router. I assume the adapter is brought to life with the correct driver, because `# iwconfig` gives some reasonable output:               wlan0     IEEE 802.11bg  ESSID:"MYNET"                 Mode:Managed  Frequency:2.462 GHz  Access Point: 00:1C:4A:A6:8F:0E                  Bit Rate=54 Mb/s   Tx-Power=20 dBm                  Retry  long limit:7   RTS thr:off   Fragment thr:off               Encryption key:off               Power Management:on               Link Quality=70/70  Signal level=-40 dBm                 Rx invalid nwid:0  Rx invalid crypt:0  Rx invalid frag:0               Tx excessive retries:0  Invalid misc:49   Missed beacon:0      Also, I assume that the authentication between the router and my adapter was successful, because `# wpa_cli status` says _"COMPLETED"_ :               Selected interface 'wlan0'     bssid=00:1c:4a:a6:8f:0e     ssid=MYNET     id=0     mode=station     pairwise_cipher=CCMP     group_cipher=TKIP     key_mgmt=WPA2-PSK     wpa_state=COMPLETED     address=00:0d:0b:35:ca:14      **Question 1:** With information like this, am I correct to assume that my adapter runs fine as interface _wlan0_ , and that the router has accepted my key and is ready and willing to establish a connection? I am not having any WPA2 authentication issues? Now, to use _wlan0_ , it needs an ip address, and the router is set up as a DHCP server, with DHCP addresses ranging from 192.168.2.100 to 192.168.2.199. As far as I understand the DHCP negotiation process, dhclient should work with the defaults, i.e. it broadcasts at 255.255.255.255, and the router should answer as 0.0.0.0, finally issuing an available address. Hoewever, `# dhclient wlan0 -v`, just gives up after a while:               Internet Systems Consortium DHCP Client 4.2.2     Copyright 2004-2011 Internet Systems Consortium.     All rights reserved.     For info, please visit https://www.isc.org/software/dhcp/          Listening on LPF/wlan0/00:0d:0b:35:ca:14     Sending on   LPF/wlan0/00:0d:0b:35:ca:14     Sending on   Socket/fallback     DHCPDISCOVER on wlan0 to 255.255.255.255 port 67 interval 3     DHCPDISCOVER on wlan0 to 255.255.255.255 port 67 interval 6     DHCPDISCOVER on wlan0 to 255.255.255.255 port 67 interval 15     DHCPDISCOVER on wlan0 to 255.255.255.255 port 67 interval 8     DHCPDISCOVER on wlan0 to 255.255.255.255 port 67 interval 8     DHCPDISCOVER on wlan0 to 255.255.255.255 port 67 interval 10     DHCPDISCOVER on wlan0 to 255.255.255.255 port 67 interval 11     No DHCPOFFERS received.     No working leases in persistent database - sleeping.      **Question 2:** (Probably the harder part to answer?) Why is the broadcast DHCPDISCOVER not getting a proper reply, i.e. a DHCPOFFER? **Some more info and hints on possible gotchas I may or may not be running into:**   * The router does _not_ use MAC filtering.   * Using a static ip outside the router's DHCP range (192.168.2.70), I was able to connect and even get into the router's html configuration tool at 192.168.2.1.   * The box I'm trying to connect from has a wired interface (eth0). Any chance that the DHCP client request from wlan0 is not sent over the air in order to establish a DHCP ip connection on 192.168.2.0, but into my wired subnet (192.168.1.0/255.255.255.0)? There's no DHCP server on the wired subnet, so the DHCP request may just end up being lost in 192.168.1.0/24? How would I debug and rule out something like this?   * The box has Debian wheezy (7.0) installed. Having used the box in a wired subnet with static ip addresses, I may have forgotten to change a configuration somewhere that may be needed for dhclient to work.


title: Minimal MTA that delivers mail locally (for cron)?

text: On my laptop, I have set up a cron that performs a weekly job. If there is something to report, I would like to get an e-mail for it. Right now I am using KMail as MUA which is able to read mail from the Maildir directory at `~/.local/share/local-mail`. Thus, I want local mail to be delivered to that folder (with a Maildir structure). I was hoping that a dead simple program already exist that has a `sendmail` interface (such that `echo "$REPORT" | mail -s "$SUBJECT" "$ME"` can work with it). Installing exim or forwarding mail to my remote mailserver is considered overkill. The question Simplest way of forwarding all mail from server? seems to target remote forwarding which does not suit my needs (I need local delivery). This old Gentoo thread ended up in crafting an old script in Perl. Surely there must exist a well-thought, dead-simple program? Any recommendations? I am using Arch Linux.


title: Installing the JMeter CA certificate for HTTPS recording

text: I got stuck in between while installing the JMeter CA certificate for HTTPS recording in the Firefox browser. I have followed the steps and successfully been able to generate the `ApacheJMeterTemporaryRootCA.crt` file but later on while installing I got the error message > Failed to decode the file. Either it is not in PKCS #12 format, has been > corrupted, or the password you entered was incorrect. when I entered the password as "password" without quotes following the instructions as mentioned.


title: How to find out if PWD contains spaces or non-English letters?

text: I created an environment variable:               WD=`pwd`      How can I check if it contains spaces or non-English letters?


title: How do I use the OpenDNS servers for wlan0 in Aptosid?

text: How do I use the OpenDNS servers for wireless networks in Aptosid? All the methods I've found are either specific to other distros, specific to eth0 or they just don't work with Aptosid or wpa_gui.


title: CONFIG_LOCALVERSION (CentOS 6.5)

text: I am in `/boot` as "root". I edit `config-2.6.32-431.el6.x86_46` and added my name to `CONFIG_LOCALVERSION="John"` But when I type `uname -r` is just shows the version, but not my name at the end. Am I editing the wrong config file?


title: Will my programs installed in Ubuntu be usable by another distro in a dual-boot set-up?

text: I am interested in setting up my machine so that I can try different distributions of Linux. I want to always be running Ubuntu (10.04.3), but would then try other distros in a dual-boot setting. Since the file hierarchy will be similar, I am wondering if the programs that I install and the settings in Ubuntu will work on the 2nd/test distro side?    If so, does it make sense to mount `/opt`, `/usr` `/etc` `/var` each on a separate partition so that I can then mount the same files in the corresponding folders the 2nd/test distro side? Is it worth it to try to use these files in both systems simutaneously? Or is it easier just to change settings and re-download programs in each system? If yes, why? If no, why not?    I am speculating that it will depend heavily on the distro, so if that is the case, then answer the question for:   * Linux Mint, and   * all other Debian based distros. (ie, "would this work for all Debian based systems?" -- I am not looking for an answer for each one.) * * * Update by OP:   1. It was dumb to suggest moving /etc to a separate partition: According to the Ubuntu documentation, the root partition must always contain /etc or else you can't boot.


title: MySQL Failing Randomly

text: I have a problem with my MySQL database. consider this scenario:               [/] remorseful:root> mysql     ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)     [/] remorseful:root> mysql     Welcome to the MySQL monitor.  Commands end with ; or \g.     Your MySQL connection id is 1     Server version: 5.1.73-cll MySQL Community Server (GPLv2)          Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.          Oracle is a registered trademark of Oracle Corporation and/or its     affiliates. Other names may be trademarks of their respective     owners.          Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.          mysql> quit;     Bye     [/] remorseful:root> mysql     ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)     [/] remorseful:root> mysql     ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)     [/] remorseful:root> mysql     Welcome to the MySQL monitor.  Commands end with ; or \g.     Your MySQL connection id is 1     Server version: 5.1.73-cll MySQL Community Server (GPLv2)          Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.          Oracle is a registered trademark of Oracle Corporation and/or its     affiliates. Other names may be trademarks of their respective     owners.          Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.          mysql>       As you can see, the first mysql connection failed while the second attempt succeeded. Afterwards, I tried again, first and second mysql connetion failed while the third attempt succeeded. Note that the attempts and failures happen at random. Please help!


title: understanding the default value of IFS

text: In my GNU bash version 4.2.8, IFS has a default value of space, tab and line feed by default:               usr@T42 ~ $ echo -n "$IFS" | hexdump -C     00000000  20 09 0a                                          | ..|     00000003     usr@T42 ~ $       Is there a reason for such default IFS? In addition, which utilities use IFS besides bash built-in `read`?


title: What are your favorite command line features or tricks?

text: Share your command line features and tricks for Unix/Linux. Try to keep it shell/distro agnostic if possible. Interested in seeing aliases, one-liners, keyboard shortcuts, small shell scripts, etc.


title: Trying to achieve fake transparency in Urxvt - can only get a black background?

text: I'm trying to achieve a (fake) transparent gray background in my URxvt (rvxt- unicode) terminal emulator. Doing this using composite transparency works as it should, but I can't get it to work using "fake" transparency! In my `.Xdefaults` I enter the following:               *foreground: #AAAAAA     *background: #151515     URxvt*transparent: true     URxvt*shading: 33 And no matter what color I enter, I end up with a _black_ , transparent background. Even if I were to enter the hex code for white, I'd get a black background. As I said, with true transparency I get the correctly colored background, but for purposes of using w3img preview in Ranger FM, I need to use fake transparency instead in my terminal.


title: How can I monitor CPU usage by user?

text: I need to monitor CPU usage by users of two servers' (Ubuntu and CentOS). For example:               user1     5%     user2    10%     ...      Is there a tool similar to `top` or `htop` that can do that?


title: 'ip addr' command shows 'UP' even there is no address associated with that interface

text: I would like to understand what is meant by an network interface up? Because `ip addr` or `ifconfig` command shows an interface as up even when there is no IP associated with it. for example on RHEL7 :               [root@IDCDVAM887 ~]# ifconfig ens256     ens256: flags=6211<UP,BROADCAST,RUNNING,SLAVE,MULTICAST>  mtu 1500             ether 00:50:56:9e:19:5b  txqueuelen 1000  (Ethernet)             RX packets 229406  bytes 59265584 (56.5 MiB)             RX errors 0  dropped 229454  overruns 0  frame 0             TX packets 0  bytes 0 (0.0 B)             TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0      (or)               [root@IDCDVAM887 ~]# ip addr show ens256     5: ens256: <BROADCAST,MULTICAST,SLAVE,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast master bond0 state UP qlen 1000     link/ether 00:50:56:9e:19:5b brd ff:ff:ff:ff:ff:ff      What is the real use of showing as UP when the interface doesn't have IP at all? I believe when there is no IP, there could be no communication on that? Then what is the use of it?


title: How to SSH into a specific directory?

text: I frequently login to a server, then cd into a specific directory. Is it possible to simplify these two commands into one?               ssh bob@foo       cd /home/guest      I'd like to avoid changing anything on 'foo' if possible, as I'll have to clear it with the server administrator. I use bash, but I am open to answers in other shells.


title: Remove all the new lines in a text file using sed

text: I would like to remove all the new lines in my text file with `sed`, I use this code:               sed -i-o 's/\n//g' mytext.txt      but nothing changes. I must be missing something... That is the content of my mytext.txt file: 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3


title: Uploading a file over FTPS

text: As the title says, I need to automatically upload an excel file to a FTPS server. Right now I'm using curl but if there is a better option out there, I'm all ears. What I have so far:               curl -k --data-binary --ftp-ssl -T "/path/to/file.xlsx" ftp://user:pass@www.web.com      This will create an entry on the server but the Excel file will be blank. Which is obviously not the intended result.


title: Install kernel-devel of specific version in fedora 19

text: So I have different "installed" kernel versions from the running kernel version, on my fedora 19 machine. To give a more clear idea, here is my terminal output:                [user@home ~]$ uname -r      3.10.3-300.fc19.x86_64       [user@home ~]$ rpm -qa | grep kernel-devel      kernel-devel-3.10.6-200.fc19.x86_64      kernel-devel-3.10.4-300.fc19.x86_64      When I install Nvidia drivers, it gives me this error that the installed and the running versions are not the same. I want to remove the currently installed 3.10.6-200 and 3.10.4-300 versions, and install the running version ( 3.10.3-300)instead. I don't know how to go about doing it. Any help will be appreciated!!


title: Reading apache error logs from php

text: I have apache2 logs at :`/var/log/apache2/error.log` which has permission:               -rw-r----- 1 root adm 127140 Mar 20 12:54 /var/log/apache2/error.log      for the sake of accessing from php I changed the ownership and group e.g               -rwxrwxrwx 1 www-data www-data 127140 Mar 20 12:54 /var/log/apache2/error.log      But still I am not able to access the logs as shown below. _test.php_               <?php      var_dump(exec("/usr/bin/tail -n 10 /var/log/apache2/error.log",$x),$x);     ?>      _output_               string(0) "" array(0) { }       My question is how to alter permission to give php process to at-least read the apache logs ? A secure/standard way to access these logs will be much appreciated . I see following error in error.log               /usr/bin/tail: cannot open `/var/log/apache2/error.log' for reading: Permission denied      This questions is already asked but solution does not fit in linux environment


title: weird problem with 64 bit install and memory

text: I have a laptop with 8gb of RAM in two 4Gb slots, the processor is 64 bit compatible. However when I try to install 64 bit version of Linux (I tried, mint, arch, manjaro), it refuses to load the kernel and it will not boot up from a live cd or live usb. However, I can install 32 bit linux. Another thing to note is that memtest86+ freezes after 0.01 seconds, so I thought maybe there could be a RAM problem, so I removed one stick. Memtest86+ still crashes although it is a different type of crash (the screen turns strange colors and computer reboots). But here is the funny part, I can actually boot up the 64 bit distros from live media with only one slot of RAM, although it still would not actually let me install them, I can get around half way through installation process before it dies. Also I cannot boot into the previously installed 32 bit distro with only one stick of RAM... O and one more thing, on my 32 bit manjaro install I tried installing a PAE compatible kernel which also would not boot.. So what is going on here? Is it dodgy RAM, or something else dodgy? Thanks in advance. Edit: this is one quarter of the output of > cat /proc/cpuinfo               processor   : 0     vendor_id   : GenuineIntel     cpu family  : 6     model       : 37     model name  : Intel(R) Core(TM) i5 CPU       M 560  @ 2.67GHz     stepping    : 5     microcode   : 0x4     cpu MHz     : 1199.000     cache size  : 3072 KB     physical id : 0     siblings    : 4     core id     : 0     cpu cores   : 2     apicid      : 0     initial apicid  : 0     fdiv_bug    : no     f00f_bug    : no     coma_bug    : no     fpu     : yes     fpu_exception   : yes     cpuid level : 11     wp      : yes     flags       : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe nx rdtscp lm constant_tsc arch_perfmon pebs bts xtopology nonstop_tsc aperfmperf pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 cx16 xtpr pdcm pcid sse4_1 sse4_2 popcnt aes lahf_lm ida arat dtherm tpr_shadow vnmi flexpriority ept vpid     bogomips    : 5320.06     clflush size    : 64     cache_alignment : 64     address sizes   : 36 bits physical, 48 bits virtual     power management:


title: What happens in Bash after calling exit?

text: I understand that when I call exit, it is an alias for logout. Sometimes, just for fun, when I need to remove myself from a session I will type `exit && 1`. Now what happens after the `exit` has been executed. Where does the `1` go? Typing 1 into bash yields (obviously) this: `1: command not found`. I'm not asking why 1 doesn't work. I'm asking where does the 1 go after calling exit? 1 is just an example, replace it with any other command. But typing `exit &&&&&&& 1` yields a syntax error. So the right hand must be evaluated. **Disclaimer** : This is a question in which interests me. There is not particular reason for this question besides the fact that I am curious about what happens.


title: Using break command as argument to function

text: What about use so solution? Functions run in loop (cycle?). In that loop - I have another function wuch also uses loop. When second function get NO answer from user - it send `break 2` to stop loop and proceed main script actions. Function uses variables wich set in file. So, is it good idea use variables as parameters for functions?


title: Loop through the lines of two files in parallel

text: The object of the script I'm making is to compare two series of files. The file names are themselves stored into two separate files, one path per line. My idea is to have two `while read` loops, one for each list of file names, but how can I mix the two loops together?               while read compareFile <&3; do           if [[ ! $server =~ [^[:space:]] ]] ; then  #empty line exception         continue      fi            echo "Comparing file - $compareFile"      if diff "$compareFile" _(other file from loop?_) >/dev/null ; then          echo Same      else           echo Different      fi      done 3</infanass/dev/admin/filestoCompare.txt      I need to be able to compare files from two different lists at the same time through two while read loops... Is this even possible?


title: Extract lines containing PAT1 but not PAT2 with sed

text: I want to extract the lines containing PAT1 but not PAT2 from a file. For example, with PAT1='dog', PAT2='cat', and the following input:               1 cat chicken     2 bird dog apple     3 dog orange cat     4 cat juice coffee     5 cow milk dog      I want the following output:               2 bird dog apple     5 cow milk dog


title: Count number of lines with a certain value in a column for all files in directory recursively

text: I have 40 files in a directory and I want to count the number of times there is a line with a "2" in the first column in each file individually. I am trying something like this, but it prints out the total sum from each file and I want the individual sums:               find . -type f -print0 | xargs -0 awk '($1=="2"){++count} END {print count}'      Just to make it clear this is an example: FILE_1               2   345     123     4     2   4567    2344    6     3   2345    657     87     6   234     345     6      FILE_2               1   12  436 7     2   54  86  8     2   23  48  0     2   098 0   8     8   98  9   0      PRINT:               FILE_1 2     FILE_2 3      What I'm actually getting: PRINT:               5       Thanks for your help!


title: How to remove "You have mail" welcome message

text: When I open up my terminal it says "you have mail", anyone has any idea of why? I am running OS X, but since it too is based on Unix and relies on files such as bashrc, bash_profile etc. I thought somebody here might know, and I'm not sure it's a platform specific problem!


title: Why did my "d" break when I screwed up a bind?

text: I was swapping some readline settings in my .bashrc earlier today and mistyped the following (bind since it's not in .inputrc): `bind "mark-symlinked-directories on"` I forgot to put a `set` in there before `mark-symlinked-directories`, the end result of which was that my "d" key stopped working in the terminal. Lame. Some messing around with other bindings indicated that whatever the first letter of the last "word" was would be unusable, i.e., `bind "page-completions off"` messed up c `bind "visible-stats on"` messed up s `bind "completion-query-items 42"` messed up i My question is why? What is `bind` doing that renders those keys useless, and why _that_ specific key?


title: Find an archive and extract it in the directory where it is located

text: I want to find a tar file which is presented in any directory and un-archive it in a one line command. I am able to find it separately from home directory. but only can extract it from directory where it is located. How can I do both in a single line using pipe? `find -name any.tar ; tar xf any.tar` I tried with this.. I can able to find this `any.tar` file from any directory separately. And `tar xf` is also extracting the file sparately but only in the dir where `any.tar` is located. I want run both command in a single line which can find the `any.tar` and extract it when the command is compiled from home directory. I am entirely new to Unix please help me out.Thank you.


title: Is there a basic tutorial for grep, awk and sed?

text: I've been a Linux user for a while, and I've a pretty decent understanding of most the common command line utilities. However, ones that come up and up again in relation to programming are `grep`, `awk`, and `sed`. About the only thing I've used grep for is piping stuff into it to find files in log files, the output of `ps` etc. I haven't used `awk` or `sed` at all. Are there any good tutorials for these utilities?


title: /etc/rc.d/postgres start vs rc.d postgres start

text: What's the difference between those two commands?               /etc/rc.d/postgres start      and               rc.d postgres start      Aren't those interchangeable? I tried starting PostgreSQL using the latter, but it only works with the first one. I'm using Sys V init on Arch Linux.


title: Usage of dash (-) in place of a filename

text: For a command, if using `-` as an argument in place of a file name will mean STDIN or STDOUT.   1. But in this example, it creates a file with the name `-`:              echo hello > -      How can I make `-` in this example mean STDOUT?   2. Conversely, how can I make `-` mean a file named `-` in examples such as:              cat -


title: Weird executabe behaviour

text: I have a server machine with ubuntu 9.10. I am trying to put in place an executable, which turns out to be the latest flashplayer (debugger version). Somehow the file appears as present and executable, but when launching it the console indicates that the files does not exist:               $ pwd     /home/rodrigo/t_fplayer     $ ls -lh     total 12M     -rwxr-xr-x 1 rodrigo rodrigo 12M 2011-07-09 11:35 flashplayerdebugger     $ ./flashplayerdebugger     -bash: ./flashplayerdebugger: No such file or directory     $ ldd flashplayerdebugger            not a dynamic executable      Using the same executable (copied via ssh) in my local machine works fine. Any idea of what is going on? What can explain this behaviour? Any idea how to fix this?


title: Which sed version is not GNU sed 4.0?

text: I'm trying to figure out which version of `sed` that I've got on BusyBox 1.18.3. The `\--version` output is cryptic.               $ sed --version     This is not GNU sed version 4.0      The following code is from the relevant `sed.c`.                   /* Lie to autoconf when it starts asking stupid questions. */     if (argv[1] && !strcmp(argv[1], "--version")) {         puts("This is not GNU sed version 4.0");         return 0;     }      This is the header:               /*      * sed.c - very minimalist version of sed      *      * Copyright (C) 1999,2000,2001 by Lineo, inc. and Mark Whitley      * Copyright (C) 1999,2000,2001 by Mark Whitley <markw@codepoet.org>      * Copyright (C) 2002  Matt Kraai      * Copyright (C) 2003 by Glenn McGrath      * Copyright (C) 2003,2004 by Rob Landley <rob@landley.net>      *      * MAINTAINER: Rob Landley <rob@landley.net>      *      * Licensed under GPLv2, see file LICENSE in this source tree.      */      There is also a list of "supported features and commands in this version of sed". It looks like a special `sed`, but how is it special? Is it custom-made for BusyBox, or does it come from another source? How should I refer to this `sed`, e.g. in SE questions?


title: Where do I put the private ssh key?

text: I have set up a key pair and they work fine if I use the `-i <privateKey>` switch. Where should I put the private key such that I can just type `ssh my.remote.host` without using `-i`? I tried putting it in `~/.ssh` on my local machine but I get prompted for a password with it there still.


title: How can I use caps lock to change language in VIM

text: Can I use capslock for changing languages in VIM instead of `Ctrl` + `6` in case of "keymap=russian-jcukenwin"? How can I do it? Maybe something like mapping it in the `$VIMRC` file? How can I map capslock, is it possible?


title: RAID 5 with 4 disks fails to operate with one failed disk?

text: I found a question about mdadm spare disks which almost answers my question, but it isn't clear to me what is happening. We have a RAID5 set up with 4 disks - and all are labeled in normal operation as `active/sync`:                   Update Time : Sun Sep 29 03:44:01 2013               State : clean       Active Devices : 4     Working Devices : 4      Failed Devices : 0       Spare Devices : 0      ...               Number   Major   Minor   RaidDevice State        0     202       32        0      active sync   /dev/sdc        1     202       48        1      active sync   /dev/sdd        2     202       64        2      active sync   /dev/sde         4     202       80        3      active sync   /dev/sdf      But then when one of the disks failed, the RAID stopped working:                   Update Time : Sun Sep 29 01:00:01 2013               State : clean, FAILED       Active Devices : 2     Working Devices : 3      Failed Devices : 1       Spare Devices : 1      ...               Number   Major   Minor   RaidDevice State        0     202       32        0      active sync   /dev/sdc        1     202       48        1      active sync   /dev/sdd        2       0        0        2      removed        3       0        0        3      removed             2     202       64        -      faulty spare   /dev/sde        4     202       80        -      spare   /dev/sdf      What is really going on here?? The fix was to reinstall the RAID - luckily I can do that. Next time it'll probably have some serious data on it. I need to understand this so I can have a RAID that wont fail because of a single disk failure. **EDIT:** I realized I didn't list what I expected vs. what happened. I expect that a RAID5 with 3 good disks and 1 bad will operate in a degraded mode - 3 active/sync and 1 faulty. What happened was a spare was created out of thin air and declared faulty - then a new spare was _also_ created out of thin air and declared sound - after which the RAID was declared inoperative. **UPDATE** This is the output from `blkid`:               $ blkid     /dev/xvda1: LABEL="/" UUID="4797c72d-85bd-421a-9c01-52243aa28f6c" TYPE="ext4"      /dev/xvdc: UUID="feb2c515-6003-478b-beb0-089fed71b33f" TYPE="ext3"      /dev/xvdd: UUID="feb2c515-6003-478b-beb0-089fed71b33f" SEC_TYPE="ext2" TYPE="ext3"      /dev/xvde: UUID="feb2c515-6003-478b-beb0-089fed71b33f" SEC_TYPE="ext2" TYPE="ext3"      /dev/xvdf: UUID="feb2c515-6003-478b-beb0-089fed71b33f" SEC_TYPE="ext2" TYPE="ext3"       The TYPE and SEC_TYPE are interesting as the RAID has XFS, not ext3.... Logs for a mount attempted on this disk - which resulted in the end result listed earlier, as every other mount did - has these log entries:               Oct  2 15:08:51 it kernel: [1686185.573233] md/raid:md0: device xvdc operational as raid disk 0     Oct  2 15:08:51 it kernel: [1686185.580020] md/raid:md0: device xvde operational as raid disk 2     Oct  2 15:08:51 it kernel: [1686185.588307] md/raid:md0: device xvdd operational as raid disk 1     Oct  2 15:08:51 it kernel: [1686185.595745] md/raid:md0: allocated 4312kB     Oct  2 15:08:51 it kernel: [1686185.600729] md/raid:md0: raid level 5 active with 3 out of 4 devices, algorithm 2     Oct  2 15:08:51 it kernel: [1686185.608928] md0: detected capacity change from 0 to 2705221484544     Oct  2 15:08:51 it kernel: [1686185.615772] md: recovery of RAID array md0     Oct  2 15:08:51 it kernel: [1686185.621150] md: minimum _guaranteed_  speed: 1000 KB/sec/disk.     Oct  2 15:08:51 it kernel: [1686185.627626] md: using maximum available idle IO bandwidth (but not more than 200000 KB/sec) for recovery.     Oct  2 15:08:51 it kernel: [1686185.634024]  md0: unknown partition table     Oct  2 15:08:51 it kernel: [1686185.645882] md: using 128k window, over a total of 880605952k.     Oct  2 15:22:25 it kernel: [1686999.697076] XFS (md0): Mounting Filesystem     Oct  2 15:22:26 it kernel: [1686999.889961] XFS (md0): Ending clean mount     Oct  2 15:24:19 it kernel: [1687112.817845] end_request: I/O error, dev xvde, sector 881423360     Oct  2 15:24:19 it kernel: [1687112.820517] raid5_end_read_request: 1 callbacks suppressed     Oct  2 15:24:19 it kernel: [1687112.821837] md/raid:md0: read error not correctable (sector 881423360 on xvde).     Oct  2 15:24:19 it kernel: [1687112.821837] md/raid:md0: Disk failure on xvde, disabling device.     Oct  2 15:24:19 it kernel: [1687112.821837] md/raid:md0: Operation continuing on 2 devices.     Oct  2 15:24:19 it kernel: [1687112.821837] md/raid:md0: read error not correctable (sector 881423368 on xvde).     Oct  2 15:24:19 it kernel: [1687112.821837] md/raid:md0: read error not correctable (sector 881423376 on xvde).     Oct  2 15:24:19 it kernel: [1687112.821837] md/raid:md0: read error not correctable (sector 881423384 on xvde).     Oct  2 15:24:19 it kernel: [1687112.821837] md/raid:md0: read error not correctable (sector 881423392 on xvde).     Oct  2 15:24:19 it kernel: [1687112.821837] md/raid:md0: read error not correctable (sector 881423400 on xvde).     Oct  2 15:24:19 it kernel: [1687112.821837] md/raid:md0: read error not correctable (sector 881423408 on xvde).     Oct  2 15:24:19 it kernel: [1687112.821837] md/raid:md0: read error not correctable (sector 881423416 on xvde).     Oct  2 15:24:19 it kernel: [1687112.821837] md/raid:md0: read error not correctable (sector 881423424 on xvde).     Oct  2 15:24:19 it kernel: [1687112.821837] md/raid:md0: read error not correctable (sector 881423432 on xvde).     Oct  2 15:24:19 it kernel: [1687113.432129] md: md0: recovery done.     Oct  2 15:24:19 it kernel: [1687113.685151] Buffer I/O error on device md0, logical block 96     Oct  2 15:24:19 it kernel: [1687113.691386] Buffer I/O error on device md0, logical block 96     Oct  2 15:24:19 it kernel: [1687113.697529] Buffer I/O error on device md0, logical block 64     Oct  2 15:24:20 it kernel: [1687113.703589] Buffer I/O error on device md0, logical block 64     Oct  2 15:25:51 it kernel: [1687205.682022] Buffer I/O error on device md0, logical block 96     Oct  2 15:25:51 it kernel: [1687205.688477] Buffer I/O error on device md0, logical block 96     Oct  2 15:25:51 it kernel: [1687205.694591] Buffer I/O error on device md0, logical block 64     Oct  2 15:25:52 it kernel: [1687205.700728] Buffer I/O error on device md0, logical block 64     Oct  2 15:25:52 it kernel: [1687205.748751] XFS (md0): last sector read failed      I dont see xvdf listed there...


title: Fastest way to create a file of 1MM unique nanosecond timestamps

text: My current (slow) example is this:               for i in {1..1000000}; do echo "$(date +%s)$(date +%N)"; done > 1m-example.txt      Hopefully there's a better way. It's crazy slow.


title: How to use an optional argument?

text: I'm writing this script to work as a fast draft. It opens my text editor with date and time, so I can insert some draft text to save quickly. **1.** At first I'd like to append the date and time at the beginning of the file instead of at the end, as `>> $file` does. But I guess that it is not so easy, so this is not my priority. **2.** I defined an argument `$1`. If I have only few words to insert I believe that it is better to run `draft "foo foo"` instead of opening the editor to write just few words. Well, it is working but with the argument the last line is not necessary. So I'd like to make it a conditional line. If I pass no argument, then open editor; else none. Any help to improve my script?               #!/bin/bash     file=rascunho     folder=/home/$USER/     #linha=$(wc -l < $file)     content=$1     #rm $folder$file     printf "\n\n" >> $file     #echo " " >> $file     echo "------< $(date "+%b %d, %Y - %H:%M:%S") >------" >> $file     echo "$1" >> $file     exec leafpad  $file


title: Use /etc/aliases for outgoing mail relayed by postfix with local domain

text: I'm using Ubuntu 12.04 with postfix configured as satellite system that relays outgoing mail to Gmail. For sake of example, my registered domain is example.com I want root cronjobs' error output to be mailed to my real david@example.com inbox. I have this relay working correctly. But these root cronjobs are set by default to email to root@example.com which isn't a real email address. I have in my `/etc/aliases`:               root: david@example.com      example.com isn't listed in postfix's main.cf's `mydestination` so postfix doesn't think this mail is local. It bypasses processing via `/etc/aliases` and tries to send to root@example.com. A workaround is adding `MAILTO=david` at the top of each cron file. But there are many. Another workaround is to setup root@example.com as a real inbox that forwards to david@example.com. Is there a better way? I.e. is there a way to relay emails that have local domains but still process their addressee with `/etc/aliases`?


title: Is it possible to do Android development on a MIPS computer?

text: On a computer with a MIPS architecture (e.g. a Lemotoe Yeeloong), running GNU/Linux, is it possible to install and run the necessary tools for developing Android apps for deployment on smartphones?


title: Install Linux without USB or DVD?

text: I was wondering if there was a way to install Crunchbang on to my spare 1TB partition without using a USB or DVD while booted in Windows? I've Googled this plenty of times, but it usually just comes up for Ubuntu which wouldn't work for Crunchbang.


title: How to compile linux kernel and debug with gcc and BOCHS?

text: I have download bochs 2.6 sourcecode and installed with gdb-stub configuration. I would like to debug linux-kernel 1.0 or 2.0 or 3.0 which sourcecode downloaded from http://www.kernel.org/ with gcc and Bochs. How to compiled the kernel sourcecode and debug it?


title: smartctl retest bad sectors

text: I got a notification today that my drive was going to fail in 24 hours. The 'Reallocated_Sector_Ct' was already around 3000 and it has since risen to over the last few hours 4004. However, I turn my case on its side a few weeks ago, and tried turning it back upright. Since then, the 'Reallocated_Sector_Ct' hasn't risen, even though currently there's a lot of disk activity as I'm tar/zipping my important data to another drive. I know having a hard disk not being able to read on it's side is a concern, but if placing the hard drive upright seems to fix the issue for the moment, at least I don't have to panic as much. Is there a way I can run a retest on those "bad sectors", and remark them as good if they pass the test? I'd like to see how many "really" bad sectors there are after a retest with the box upright (of course I'll do this after my backup is complete). I'm using Debian if that makes any difference.


title: What's the story behind command file's suggestion?

text: While I'm reading `file(1)` I noticed this in the man page (emphasis mine): > When adding local definitions to /etc/magic, make sure to preserve these > keywords. Users depend on knowing that all the readable files in a directory > have the word “text” printed. **Don't do as Berkeley did and change “shell > commands text” to “shell script”.** What's the story behind this sentence? I guess `Berkeley` refers to `BSD (Berkeley software distribution)` but Google didn't give enough information about this. Link to `file(1)` http://man7.org/linux/man-pages/man1/file.1.html Some digging around shows that this statement was added 27 years ago link               Don't do as one computer vendor did \- change ``shell commands text''     to ``shell script''.      and later changed to current statement link               Don't do as Berkeley did \- change ``shell commands text''


title: postfix: different file name format for Maildir messages

text: I am using `postfix` with maildir format. The filenames of messages stored in maildir look something like this:               1386021659.27745_1.alpha:2,S      I understand the first part is epoch time, not sure about the rest. But I would like to have some human friendlier name, such as               2013-12-18__120502.sender_or_subject_of_the_message:2,S      I need to manipulate the individual messages/files often (this is the reason why I am using maildir in the first place). Having some more descriptive filename would help. Can I set this in `postfix`?


title: "df -h" and "fdisk -l" in amazon server

text: When you do a `df -h` you can see:               Filesystem Size Used Avail Use% Mounted on     /dev/xvda1 7 . 9G 1.7G 6.2G 22% /      But, when you do `fdisk -l` you see:               Disk /dev/xvda1: 26.8 GB, 26843545600 bytes     255 heads, 63 sectors/track, 3263 cylinders     Units = cylinders of 16065 * 512 = 8225280 bytes     Sector size (logical/physical): 512 bytes / 512 bytes     I/O size (minimum/optimal): 512 bytes / 512 bytes     Disk identifier: 0x00000000      Can someone help?


title: What's the difference between "==" and "=~"?

text: Given a string and a hash returned by `openssl`, why using `==` doesn't match them correctly but `=~` does? Background question: How can I force a script to use more resources?


title: Disable bootlog daemon by kernel configuration instead of editing /etc/default/bootlogd

text: I asked a similar question How to disable the boot log daemon by editing the init script? But this does not help me because I am unable to retain the changes in any file after I reboot as I asked here Unable to retain any root created files and folders after warm reboot in linux   So not able to do anything with /etc/default/bootlgd etc. One of the reasons this is happening I think is because in my case every thing is in volatile memory. So Is there any parameter which can be set in kernel configuration so that the bootlg Daemon never start? After doing this configuration I shall build and then run with these settings.


title: Kali (former BackTrack) installing dropbox

text: It might sound weird, but I've created a persistent (ext4) Kali live USB* and I'd like to install Dropbox on it (and maybe even Firefox). Since it's based on a very old Ubuntu version I thought this would be a great place to ask this question.   * Kali is delivered with IceWeasel browser, but I'd rather use Firefox.   * I'm using Kali for testing purposes and I need the screenshots to be stored in my Dropbox, thus I want it to be installed on the persistent partition. How can I install Dropbox (and Firefox) on a custom location? I've tried Apt- get/aptitude but I cannot choose a location as far as I can see. Thanks in advance. *I did not find a way to install Kali on an USB losing the "live" and "amnesia" part except the partition I create and pressing `tab` followed by typing "persistent" The guide I've used was in Dutch so here's a snippet of the terminal command I've used to get the persistent working after using Gparted to format the drive: > mkdir /mnt/usb > > mount /dev/sdb2 /mnt/usb > > echo "/ union" >> /mnt/usb/persistence.conf > > umount /mnt/usb


title: My ubuntu background is totally black, even after opening programs such as terminal

text: My Ubuntu background is totally black when I log in. I can open the terminal, write command so that i open other programs, but I am unable to see any of it. ![enter image description here](http://i.stack.imgur.com/JTFwu.png)


title: Can't login into the desktop

text: I can't login into my account "Magicbox". `xserver` keeps kicking me out of there. I'm not sure what's the issue, but I reinstalled `xserver`, and it had no effect. Any advice? SPECS:   * Asus Eee PC X101CH   * 990 MB of memory   * 320 GB HD (I think)   * Magic Box 18 LTS with LXDE (i686)   * Kernel 3.11.6


title: Unhighlight Last Search in 'less'

text: When you use a `/` forward search or a `?` backward search in less, all instances of the file get highlighted. After I've found the instance of the word I'm looking for, what is the most correct way to unhighlight something? Currently I just press `/` then mash gibberish into the input field. No results = no highlights! I'm looking for something akin to vim's `:nohl` feature, in less.


title: FTP files from one remote server to another

text: I am trying to find out how I can transfer files from one directory/server to another directory/server? What I need to consider is that I should transfer files that are created TODAY only. i.e. the folder will look like this:               04/20/2012 <n files>     04/14/2012 <m files>      and if I am running the job today, the script should transfer only the `n` files that were created today. Can anyone please help me out how I should do this?


title: How to tell if SSH'd into machine?

text: Is it possible to tell if a terminal is SSH'd into a machine ? some kind of command to do this for me and execute something if I am SSHd?


title: wifi failed to start with Arch Linux on laptop

text: I just installed Arch Linux. Wifi worked fine for me on installation but as soon as I rebooted, I received failure messages when trying to connect to my router. When trying to access my router through wifi-menu, I receive:               Job for netctl@wls1\x2d2WIRE740.service failed. See 'systemctl status netctl@wls1\x2d2WIRE740.service and journalctl -xn' for details.      systemctl status netctl@wls1\x2d2WIRE740.service says:               Loaded: loaded (/usr/lib/systemmd/system/netctl@.service; static)     Active: inactive (dead)     Docs: man:netctl.profile(5)      journalctl -xn says:               -- Unit netctl@wls1\x2d2WIRE740.service has begun starting up.     Jan 01 06:40:43 termin01 network[2002]: Starting network profile 'wls1-2WIRE740' ...     Jan 01 06:40:43 termin01 network[2002]: The interface of network profile 'wls1-2WIRE740' is already up     Jan 01 06:40:43 termin01 systemd[1]: netctl@wls1\x2d2WIRE740.service:main process exited. code=exited, status=1/FAILURE     Jan 01 06:40:43 termin01 systemd[1]: Failed to start Automatically generated profile by wifi-menu.


title: Installing Linux Mint 15 on HP PROOBOOK 4740S

text: I have a problem. I'm trying to install Linux Mint on my laptop. I tried everything to install it in UEFI mode from disk but it wont start; it always says "reading error." Then I tried with a USB. Everything goes well till the moment when it says "installation cannot continue: Grub loader can't be installed." What should I do to install Linux Mint, and have dual boot when my computer starts?


title: How Do You Pass VGA/VESA Modes with GRUB2?

text: One of my machines has a 3 TB HD setup to triple boot into Mint 14 (Ubuntu 12.10 variant), Slackware 14.1 and Arch Linux. The HD is formatted using the GPT/Guid system. The Grub2 technically "belongs" to the Linux Mint install but is used to triple boot all 3 systems. Setting it up about 1 year ago was an extremely painful procedure and required 2-3 days of wrestling with it, and tweaking it, to allow it to recognize the Slackware and Arch installs; it always recognized the Mint Linux install easily. I need to be able to pass VGA/VESA modes to Slackware and Arch. I use Slackware and Arch from the command line and therefore console resolution and font size are important factors.


title: Lightweight X11 alternative available?

text: Is there any lightwight X11 alternative suited for old systems? (Say, 1GHz and 256-314MB RAM)


title: Find and use the path of a file?

text: I'm trying to find the path of a file and move it. When I try `realpath`, it is not useful. For example : I want to move the file `All Hail the Generalist - Vikram Mansharamani - Harvard Business Review.html` Using `realpath`:               realpath 'All Hail the Generalist - Vikram Mansharamani - Harvard Business Review.html     /home/x/Downloads/All Hail the Generalist - Vikram Mansharamani - Harvard Business Review.html But I can't do :               mv /home/x/Downloads/All Hail the Generalist - Vikram Mansharamani - Harvard Business Review.html /home/ I need something like that :               mv  /home/x/Downloads/All\ Hail\ the\ Generalist\ -\ Vikram\ Mansharamani\ -\ Harvard\ Business\ Review.html


title: /lib/modules/2.6.37.6/build missing in linux puppy? what should I do?

text: I am new to linux as of yesterday. I'm using linux puppy to try to get the most out of a 10 year old, slow laptop. I installed it fine, no problems there, but as soon as I try to use my usb dongle's install CD, the problems start. The CD included support for linux as well as windows, so I copied the linux files off the CD and, through the console, ran the install.sh file to easy install the driver. All seemed to be going well until... I get the following error:               make: *** /lib/modules/2.6.37.6/build: No such file or directory. Stop.      and then displays an Error 2 message. This is the only web-result I could find with any information on it but I don't understand how I should correct this: http://murga- linux.com/puppy/viewtopic.php?t=76975 (something about missing kernel header files). I must stress, I only have limited experience in C and even less in C++. Could anybody suggest a fix? I have already tried using the windows .inf driver information file with the ndiswrapper utility that came with the network setup wizard. This detects my wireless network but does not connect. Maybe I'm just configuring it wrongly but I don't think so? Any ideas?


title: Switch keyboard layout programmaticaly

text: I use three different layouts and looking code to change layout programmaticaly from `.bashrc` function.


title: Where to look for problems logging in via ssh

text: For the past two mornings I have been unable to log into (establish an ssh connection) to an Amazon EC2 instance running the Bitnami node stack (based on Ubuntu) for several minutes. After a few minutes of retrying I was able to log in via ssh. None of my browsers (on OSX) seems to want to use Java to load AWS's own web based console so I was unable to test if the problem is on my own machine. The instance was listed as running in AWS console throughout and upon logging in. There was no high CPU usage (looked using `top`) or fill disk (`df -k` lists 27% usage). I would like to know where to start looking in the logs to find out why I was unable to log in. For clarity, I am logging in using terminal on OSX 10.8.5


title: ls behaves differently under strace

text: I don't know how to debug this situation: 1) I try to execute:               ls /home/user      2) ls blocks and does not print anything. I assume it is because /home/user contains /home/user/sshfs_files, which is an sshfs-mounted directory, but the network went down on my machine (the network is up again but I guess the SSH connection has been lost). 3) As i wanted to be sure that the sshfs-mounted directory was the cause of this hang up, i tried the same command under strace:               strace -o /tmp/log ls /home/user      4) And the ls actually worked ! So now the situation is that ls works under strace but blocks on its own. How is it even possible? How to explain this situation? How can I see where ls block if it doesn't block under strace? Thanks!


title: PATH environment variable in linux

text: I want to know how the standard environment variables given by the linux OS like PATH, HOME are set automatically. In which file are these read from. There should be some file from which these variables are set when a particular user login.


title: self-recovering ssh tunnel over non-100% connection

text: I want to setup permanent ssh-tunnel for port forwarding to machine behind firewall. The connection is between university network (very reliable) and commercial microwave metropolitan connection to a company (outages for a few minutes/several months max), and I want the connection to recover automatically after it fails. I recall ther were some ssh wrappers featuring heartbeat failure detection, but I am curiously not able to google those up now. Which of them would you recommend?


title: zsh syntax highlighting for files

text: I use `zsh-syntax-highlighting` package and it colorize all files with the same color as directories (path). I think one should have possibility to customize these colors or at least use `$LS_COLORS` as default. However it seems that I can change only one variable:               ZSH_HIGHLIGHT_STYLES[path]='fg=blue,bold'      Am I missing something?


title: rsync: skip files for which I don't have permissions

text: I'm using `rsync -rlptD` to copy a directory from another user. There are a few files (I have no way of knowing these in advance) which I don't have permission to copy. Is there a way have rsync ignore these. The trouble is that if rsync return non-zero my bash -x script will exit.


title: XEN Bootloader or Kernel error bootloader isn't executable / cannot locate kernel when using XM create

text: I am currently using Xen for installing VM guests however whenever we run               xm create -c /etc/xen/ks.test.cfg      we get;               Using config file "/etc/xen/ks.test.cfg".     Error: Bootloader isn't executable      The contents of ks.test.cfg are as follows;               # Configuration file for the Xen instance ks.test, created     # by xen-tools 3.8 on Thu Jan 31 16:18:09 2013.     #          #     #  Kernel + memory size     #     bootloader = '/usr/lib/xen/boot/hvmloader'     memory      = '512'          #     #  Disk device(s).     #     root        = '/dev/sda1 ro'     disk        = [                       'file:/home/xen/domains/ks.test/disk.img,sda1,w',                   ]               #     #  Hostname     #     name        = 'ks.test'          #     #  Networking     #     vif         = [ 'ip=**.**.***.***,mac=**:**:**:**:**:**' ]          #     #  Behaviour     #     on_poweroff = 'destroy'     on_reboot   = 'restart'     on_crash    = 'restart'      Please note, I purposely *'d out the ip & mac.


title: Is there a terminal app that allows filenames to be clickable?

text: Is there a terminal emulator (extension or app) that does link resolution for local paths? In particular when I see things like:               /home/sam/.gem/ruby/1.8/gems/actionpack-2.3.2/lib/action_controller/benchmarking.rb:68:in `perform_action_without_rescue'     /home/sam/.gem/ruby/1.8/gems/activesupport-2.3.2/lib/active_support/core_ext/benchmark.rb:17:in `ms'     /home/sam/.gem/ruby/1.8/gems/activesupport-2.3.2/lib/active_support/core_ext/benchmark.rb:17:in `ms'      I would like to be able to click on:               /home/sam/.gem/ruby/1.8/gems/actionpack-2.3.2/lib/action_controller/benchmarking.rb      To open the file.


title: Why doesn't Ubuntu use capabilities on ping?

text: After running,               $ ls -l /bin/ping     -rwsr-xr-x 1 root root 34740 Nov  5  2012 /bin/ping      I wonder, why doesn't Ubuntu use capabilities (i.e. raw sockets) rather than setuid?


title: Is there a standard symbolic link to the current users home directory?

text: The shell can expand `~` to your home directory. `$HOME` usually has the same deal, but often you want to refer to the current users home directory from a context that may not support such expansion. I have had config files where `$HOME` works but `~` doesn't and vice versa. I would guess that fuse could provide something along these lines, something like `/var/myself` -> `$HOME` With that I could place values in config files to point to things like `/var/myself/backdrops/pornography/wtf/yarly.jpg` Is there something like this already? If not, are there good reasons for there not being something like this?


title: How to prevent a specific instance of xterm from title changes?

text: If you start `xterm` from the command line giving it a title with the `-T` option               xterm -T "my window title"       the window title is likely to be overwritten via escape sequences for the shell prompt, other programs' output, etc. Is there any way to prevent the initial title from being overridden?


title: Trying to use an old PC for home theater PC

text: I'm trying to use some fairly old hardware (purchased ~2000) to have hooked up to my tv full time and I'm looking for advice on which distro to use. Hardware Specs:   * Pentium 4 1.9 GHz   * 765 mB RAM   * NV11 [GeForce2 MX/MX 400] Graphics Card   * more available if needed, not sure what else to list though Machine Requirements:   * Capable of streaming music/video (a functional browser)   * Easy install   * Able to play out to a large screen (~30 inches)   * Capable of playing DVD's/music from harddrive.   * Extras that would be nice: ssh support, able to run as a LAMP, able to run as a File Server.  Based on my machine requirements and hardware specs, is this possible? Which distro would you recommend? I would ideally use Ubuntu Server+GUI but I've been having trouble with the install and I think it may be due to the aging hardware.


title: An easy bash completion tutorial?

text: I want to learn how to write bash completion scripts. Which tutorial would you recommend for a newbie?


title: How to make a custom bash tab completion?

text: I want to make tab completion to complete on specific programs in path although there maybe other possible completion in path. For example, if I type `mpl` and `tab`, it should complete to mplayer though there might be other programs in the path starting with `mpl`. I know of bash alias builtin for `~/.bashrc` but thats not what I'm looking for.


title: How to copy a debootstrap (chroot) directory to another computer?

text: I created an installation of Debian in a subdirectory using debootstrap on computer A. Now I would like to transfer this installation to computer B which has a local connection but no global internet access. It was therefore easier to create the directory on computer A. However when I try to use ssh to copy recursively the directory, I get "error" messages like               wheezy/dev/zero: not a regular file     wheezy/dev/ptmx: not a regular file      I'm not familiar with those kind of files. I guess they are related to the kernel running on computer A. Is this right? Can I either transmit those files with scp/tar (I could not find a suitable option), or recursively copy the distribution "normal" files and then re- generate those special files with some command on computer B?


title: Kali Linux Live USB boots into text mode. Unable to Start the GUI

text: I am booting kali Linux from the USB. But it boots me into Kali login prompt. When I provide the credentials for root. It gives me root prompt.root@kali. Any pointers please on how to boot into GUI mode using live USB. ![enter image description here](http://i.stack.imgur.com/n6O85.png) ![enter image description here](http://i.stack.imgur.com/s1G7F.png)


title: Why doesn't SLES 10.3 has /dev/shm?

text: It's strange that on all of our Linux systems there is a separated filesystem: /dev/shm. But there isn't any on SLES 10.3 machines, because it's just a directory on them. **My question:** Can someone provide an offical source what states that SLES 10.3 doesn't use a separated /dev/shm?


title: does anybody know this window manager

text: I am connecting to a cluster with the window manager as in the picture. Does anybody know which WM it is? It does not have even a menu I can open like in twm![enter image description here](http://i.stack.imgur.com/OYlHy.png)


title: Find & Delete directories in .zip files

text: Question 1 : In many .zip archive files I would like to delete directories anwsering to a name pattern. In a "normal" directory I used :               find . -type d -name "pattern" -mtime +30| xargs rm -r      Is it possible to find/delete these directories without having to unzip the .zip files? If I do have to unzip I have to zip them again after deleting those files, which I would like to avoid. I saw a few topics which advised to mount .zip files to use shell commands. Could it work for me too ? (I'm quite new to the Unix World). Question 2 : i did like Mark said and put everything in a loop. It works fine but without asking for anything i get in the terminal for each deleted file/folder a line : "deleting: blabla.txt". How is it possible to get these lines in a log file ? Just adding >> ${logFile} after the command line would be enough ?


title: Non-blocking bash command

text: Let's say I have a bash script with the following:               #!/bin/sh     gedit     rm *.temp      When I execute it using `sh ./test.sh`, `gedit` pops-up but the `rm` part does not run until after I close `gedit`. I want the script to continue running even if `gedit` isn't closed; like the `gedit` isn't blocking the bash execution. The example I gave is just an example (putting the `rm` first won't work in a real situation).


title: How to take down a static network interface when not connected?

text: I have 2 network interfaces:   * eth0 for LAN connection   * wlan2 for wireless connection I have set them static in the `/etc/network/interfaces` file. The problem is that I rarely have both connected at the same time and if the LAN is not connected, wlan2 doesn't work until I take down the eth0 manually with `ifconfig`. Why does this happen? I would like that when one interface is not connected it will be turned off automatically. How can I do that? Here's the interfaces file:               auto eth0     iface eth0 inet static     address 192.168.1.130     netmask 255.255.255.0     network 192.168.1.0     dns-nameservers 8.8.8.8 8.8.4.4     up route add default gw 192.168.1.10 eth0     down route del default gw 192.168.1.10 eth0          auto wlan2     iface wlan2 inet static     wpa-ssid "dlink"     wpa-key-mgmt WPA-PSK     wpa-psk wpapass          address 192.168.1.150     netmask 255.255.255.0     network 192.168.1.0     dns-nameservers 8.8.8.8 8.8.4.4     up route add default gw 192.168.1.20 wlan2     down route del default gw 192.168.1.20 wlan2      NetworkManager.conf               [main]      plugins=ifupdown,keyfile          [ifupdown]      managed=true


title: How to change the name an encrypted full-system partition is mapped to

text: My system is fully encrypted with `dm-crypt` and `LVM`. I recently moved the encrypted partition from `/dev/sda5` to `/dev/sda2`. My question is: how can I change the name the encrypted partition is mapped to from `sda5_crypt` to `sda2_crypt`? I can boot the system all right. But the prompt I get at boot time says `(sda5_crypt)` though the `UUID` maps to `/dev/sda2`:                 Volume group "vg" not found       Skipping volume group vg     Unlocking the disk /dev/.../UUID  (sda5_crypt)     Enter passphrase:      I tried to live-boot, decrypt `sda2`, activate `vg`, `chroot` to `/dev/vg/root` and run `update-grub2` but to no avail. Merely editing `/etc/crypttab` doesn't work either.


title: Upgrade Gnome 3.4 to 3.8 in debian 7

text: I need to upgrade gnome 3.4 to 3.8 in debian7 (with gnome-classic). How?


title: How can I access GPIO pins from CentOS 6.4?

text: I have a single board computer with 8 GPIO pins that I would like to access from user space on my CentOS 6.4 installation. I see the GPIO pins mentioned in the 'dmesg' output, but the /sys/class/gpio directory does not exist. Is there a special driver I need, or is my kernel just not new enough (2.6.32-358.el6.i686)? The SBC model is Advantech PCM-9389 in case that matters. GPIO mentioned in dmesg:                   pci 0000:00:1f.0: quirk: [io  0x0800-0x087f] claimed by ICH6 ACPI/GPIO/TCO         pci 0000:00:1f.0: quirk: [io  0x0500-0x053f] claimed by ICH6 GPIO


title: How to identify faked mail origin?

text: Today while setting up a mail server using postfix, I practiced to use `sender_canonical_maps` option, and noticed that it can change outgoing mail "sender" to appear like someone else. When Gmail picked up the mail, it showed the fake sender as the origin. If mail sender can be easily faked, as an Email end-user, how do I distinguish between fake sender and real sender?


title: Where does MySQL store its databases on Debian?

text: Our system crashed and we're trying to recover our data. The disc is fine, but the OS is gone, so I'm trying to get at the actual MySQL database files. Does anybody know where to look for them in a Debian Linux server?


title: Why does procmail send a copy of an inbound message to sender if it encounters an exit code?

text: I have a very simple procmail process that takes an inbound email and redirects it to a script:               LOGFILE=/home/foo/procmail-log     VERBOSE=yes     MAILDIR=/var/spool/mail/foo     DEFAULT=/var/spool/mail/foo     SHELL=/bin/sh          :0     ! `/home/foo/scripts/blah/blah.sh`      The shell script has a condition that greps a file for a sender's email address and if it finds it, it exits:               grep i "$SENDER" /home/foo/scripts/blah/blah2.txt          if [[ $? -eq 0 ]] ; then         exit 1     fi      When this happens, I want procmail to just give up / discard the message. Interestingly enough though, if this triggers, procmail taking the value I just grepped and trying to send an email to it. In the procmail log, I see:               procmail: Notified comsat: "foo@:/usr/sbin/sendmail -oi sender@foodomain.com sender@foodomain.com"     From sender@foodomain.com  Thu Feb  6 22:31:47 2014      Subject: Test       Folder: /usr/sbin/sendmail -oi sender@foodomain.com sender     3165     procmail: Executing "/usr/sbin/sendmail,-oi,sender@foodomain.com,sender@foodomain.com"      Why is it doing this? Is there any way I can configure procmail to not do this? I just want it to give up and drop the prior email it was processing. I've tried different exit codes (0, 1, 77) but procmail always does the same thing. Any ideas?


title: cannot access vmware

text: I have linux server Debian ,i have vmware running on it,but the server is not accessing the vm ware installed,it show's running but when i ssh it's not log in into the vmware,it's logging to main server. I an using citrix xenserver.


title: how to route local ip subnet to vpnc tunnel

text: I have a `vpnc` client that will connect to Cisco and I put any information to `/etc/vpnc/default` then I run `vpnc-connect` status connected. All routes will be replaced to `tun0`. The targeted `10.10.0.9` can be ping'd from this host. This host has the private IP `10.10.2.15/24` and others host `10.10.2.x/24`, I made route in other host with iproute `ipr a a 10.10.0.9 via 10.10.2.15`. But can't ping `10.10.0.9`. Edit : ip a               1: lo: <LOOPBACK,UP,LOWER_UP> mtu 16436 qdisc noqueue state UNKNOWN     link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00     inet 127.0.0.1/8 scope host lo     inet6 ::1/128 scope host        valid_lft forever preferred_lft forever     2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000     link/ether 00:06:5b:3c:2b:3a brd ff:ff:ff:ff:ff:ff     inet 10.10.2.15/24 brd 10.10.8.255 scope global eth3     inet6 fe80::206:5bff:fe3c:2b3a/64 scope link        valid_lft forever preferred_lft forever     14: tun0: <POINTOPOINT,MULTICAST,NOARP,UP,LOWER_UP> mtu 1412 qdisc     pfifo_fast state UNKNOWN qlen 500     link/[65534]     inet 10.103.56.242/32 scope global tun0      edit : ip r               180.214.x.x via 10.10.2.1 dev eth1  src 10.10.2.15  mtu 1500 advmss 1460     10.10.2.0/24 dev eth1  proto kernel  scope link  src 10.10.2.15     169.254.0.0/16 dev eth1  scope link  metric 1003     default dev tun0  scope link      ![enter image description here](http://i.stack.imgur.com/hV8Mh.jpg) edit : mtr 10.10.0.9               Keys:  Help   Display mode   Restart statistics   Order of fields   quit                                               Packets               Pings     Host                                       Loss%  Last   Avg  Best  Wrst StDev     1. 10.10.2.15                               0.0%   0.3   0.4   0.3   0.5   0.1     2. ???


title: Focus "mouse" or "sloppy" do the same thing on gnome-shell

text: My problem is actually very annoying. I am very familiar with the mouse focus but right now it's not working. Inside `gnome-tweak-tool` the last option "windows" has the "windows focus mode" switch. I've set it to "mouse" but it does not work. It acts just like the "sloppy" option. I hope another gnome user understands my issue. ![enter image description here](http://i.stack.imgur.com/tF52c.png) **UPDATE:** ![enter image description here](http://i.stack.imgur.com/HzGOK.png)


title: /etc/passwd sql with bash access

text: I just got a CentOS VPS and was reviewing the passwd file and saw this:               mysql:x:498:499:MySQL server:/var/lib/mysql:/bin/bash      Is bash necessary for mysql?


title: LXDE environment looks and behaves like openbox

text: I have two logins on my box, one for work and the other for personal (I'm on crunchbang). Both run LXDE by default. As of yesterday the work login started acting like an Openbox session, ie you had to hover over a window before you could enter text, the windows could not be dragged to another point on the screen and the maximise button wouldn't work. The personal login, however, is working as expected and LXDE is as it should be. I can also log into a Xfce session and it is working fine (on work and personal logins) so the conflict appears to be between LXDE and Openbox. The only thing that I can think I've done is to install a few packages from the repositories and to do an `apt-get update`. If someone can tell me how to show the latest things installed from the repositories then I'll be able to tell you what they were. I've tried removing (with the `purge` option) LXDE and reinstalling it but to no avail. Can anyone think of a way for me to get LXDE working properly again? Are there any logs that I can trawl through to work out the problem? How do I find the last things installed from the repositories (so I can remove them)?


title: GNU scientific library linking

text: I have installed GNU scientific library (http://www.gnu.org/software/gsl/) which is located in `/home/usr/gsl-1.9` and installed statistical programme in `/home/usr/statprog` when I tried to compile it, this happens:               $ cd home/usr/statprog      $ make     gcc -O3 -Wall -Wshadow -pedantic D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -DVER32 -I/opt/local/include/ -L/opt/local/lib/ -c -o mlRho.o mlRho.c     gcc: error: D_GNU_SOURCE: No such file or directory     make: *** [mlRho.o] Error 1      It says no such file or directory. How to link GNU library to this statprog?


title: Linux running on SmartTV?

text: I recently bought a Samsung SmartTV. After setting up the wifi connection, I surfed to http://ip.comlex.de, which gave me the following information about the browser:   * `REMOTE_ADDR`: ###.###.###.###   * `REMOTE_HOST`: XXXXXXXXXXXXXXXXXXX.net   * `REQUEST_TIME`: 1381093040   * `QUERY_STRING`:    * `HTTP_ACCEPT`: text/html,application/xhtml+xml,application/xml,application/vnd.hbbtv.xhtml+xml,application/ce-html+xml,application/vnd.oipf.xhtml+xml;q=0.9, _/_ ;q=0.8   * `HTTP_ACCEPT_CHARSET`: HTTP_ACCEPT_ENCODING: gzip, deflate   * `HTTP_ACCEPT_LANGUAGE`: HTTP_REFERER: http://pagerank.comlex.de/   * `HTTP_USER_AGENT`: Mozilla/5.0 (SMART-TV; X11; Linux i686) AppleWebKit/535.20+ (KHTML, like Gecko) Version/5.0 Safari/535.20+ So, is there a Linux running on my SmartTV as the HTTP_USER_AGENT suggests? How can I find out more information about the Linux used? Can I somehow login to the TV from my Desktop PC? Possible solution: http://www.samsungdforum.com/Guide/d21/index.html#how-to- get-firmware-version-and-model-code