Trying to change GID on AIX server

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.


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

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


Why doesn't cups detect my canon selphy USB printer

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;" ""


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

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?


How to copy files within a remote server?

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?


processor(s) statistics that is one day old

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..


Drag and drop files with cURL

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


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

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?


what yum repo do I need for nfs-utils

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/#.


Convert Unix timestamp into human-readable format on AIX

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.**


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

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?


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

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?


bootloader configuration with GPT, RAID1, and LVM

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?


Drag windows with right mouse button in Linux Mint KDE

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.**


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

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?


rsync failing to choose the correct target directory

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/`?


How to concat file and a line on-fly?

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)?


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

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?


How to create merged input (stdin) for a program

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._


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

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."


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

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.


Minimal MTA that delivers mail locally (for cron)?

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.


Installing the JMeter CA certificate for HTTPS recording

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.


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

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


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

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.


CONFIG_LOCALVERSION (CentOS 6.5)

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?


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

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.


MySQL Failing Randomly

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!


understanding the default value of IFS

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`?


What are your favorite command line features or tricks?

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.


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

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.


How can I monitor CPU usage by user?

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?


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

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?


How to SSH into a specific directory?

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.


Remove all the new lines in a text file using sed

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


Uploading a file over FTPS

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.


Install kernel-devel of specific version in fedora 19

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!!


Reading apache error logs from php

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


weird problem with 64 bit install and memory

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:


What happens in Bash after calling exit?

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.


Using break command as argument to function

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?


Loop through the lines of two files in parallel

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?


Extract lines containing PAT1 but not PAT2 with sed

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


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

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!


How to remove "You have mail" welcome message

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!


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

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?


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

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.


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

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?


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

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.


Usage of dash (-) in place of a filename

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 -


Weird executabe behaviour

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?


Which sed version is not GNU sed 4.0?

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?


Where do I put the private ssh key?

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.


How can I use caps lock to change language in VIM

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?


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

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...


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

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.


How to use an optional argument?

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


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

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`?


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

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?


Install Linux without USB or DVD?

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.


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

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?


smartctl retest bad sectors

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.


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

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''


postfix: different file name format for Maildir messages

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`?


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

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?


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

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?


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

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.


Kali (former BackTrack) installing dropbox

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


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

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)


Can't login into the desktop

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


Unhighlight Last Search in 'less'

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.


FTP files from one remote server to another

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?


How to tell if SSH'd into machine?

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?


wifi failed to start with Arch Linux on laptop

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.


Installing Linux Mint 15 on HP PROOBOOK 4740S

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?


How Do You Pass VGA/VESA Modes with GRUB2?

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.


Lightweight X11 alternative available?

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


Find and use the path of a file?

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


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

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?


Switch keyboard layout programmaticaly

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


Where to look for problems logging in via ssh

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


ls behaves differently under strace

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!


PATH environment variable in linux

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.


self-recovering ssh tunnel over non-100% connection

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?


zsh syntax highlighting for files

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?


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

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.


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

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.


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

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.


Why doesn't Ubuntu use capabilities on ping?

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?


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

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?


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

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?


Trying to use an old PC for home theater PC

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.


An easy bash completion tutorial?

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


How to make a custom bash tab completion?

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.


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

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?


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

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)


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

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?


does anybody know this window manager

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)


Find & Delete directories in .zip files

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 ?


Non-blocking bash command

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).


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

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


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

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.


Upgrade Gnome 3.4 to 3.8 in debian 7

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


How can I access GPIO pins from CentOS 6.4?

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


How to identify faked mail origin?

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?


Where does MySQL store its databases on Debian?

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?


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

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?


cannot access vmware

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.


how to route local ip subnet to vpnc tunnel

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. ???


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

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)


/etc/passwd sql with bash access

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?


LXDE environment looks and behaves like openbox

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)?


GNU scientific library linking

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?


Linux running on SmartTV?

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


ASCII binary tools?

Which is a good tool to convert ASCII to binary, and binary to ASCII? I was hoping for something like:               $ echo --binary "This is a binary message"     01010100 01101000 01101001 01110011 00100000 01101001 01110011 00100000 01100001 00100000 01100010 01101001 01101110 01100001 01110010 01111001 00100000 01101101 01100101 01110011 01110011 01100001 01100111 01100101      Or, more realistic:               $ echo "This is a binary message" | ascii2bin     01010100 01101000 01101001 01110011 00100000 01101001 01110011 00100000 01100001 00100000 01100010 01101001 01101110 01100001 01110010 01111001 00100000 01101101 01100101 01110011 01110011 01100001 01100111 01100101      And also the reverse:               $ echo "01010100 01101000 01101001 01110011 00100000 01101001 01110011 00100000 01100001 00100000 01100010 01101001 01101110 01100001 01110010 01111001 00100000 01101101 01100101 01110011 01110011 01100001 01100111 01100101" | bin2ascii     This is a binary message      PS: I'm using bash PS2: I hope I didn't get the wrong binary


Removing text between two specific strings

I have a file as below:               mime PI Name: ISHO SUCCESS RATE RT, Value: 95.663826     scr  PI Name: RRC Access Failures due to UU, Value: 0.13394141     prog PI Name: RRC Access Failures due to UU, Value: 0.16077702     sch PI Name: RRC Access Failures due to UU, Value: 0.11781933      I want to remove text `PI` till `Value:`. I tried               sed '/<PI>/,/<\/Value:>/d'       Any help?


How to extract single value from single line tuples?

I have a dump file of a database in the following form               ('value1','value2',value3','value4'),('value1','value2',value3','value4'),...      I want first to have each tuple in a single line and next i would like to export only a single value (i.e:value3 from each tuple)


Why does curl command take urls with parameters as input

I know both `wget` and `curl`. Being curious I read a little about their differences. I recently tried to use `curl` with an url who has parameters and it turns out curl strips down the parameters from the url. The consequence is : I don't get the page I requested. So my question was, why does the curl command do that ? Edit : I tried following               # bare     $ curl -s http://tag.mobitrans.fr/horaires/index.asp?rub_code=23&lign_id=4&sens=2          # double quotes     $ curl -s "http://tag.mobitrans.fr/horaires/index.asp?rub_code=23&lign_id=4&sens=2"          # single quotes     $ curl -s 'http://tag.mobitrans.fr/horaires/index.asp?rub_code=23&lign_id=4&sens=2'          # escaping special chars     $ curl -s http://tag.mobitrans.fr/horaires/index.asp?rub_code=23\&lign_id=4\&sens=2      FWIW : `curl 7.34.0 (x86_64-apple-darwin13.0.0) libcurl/7.34.0 OpenSSL/1.0.1f zlib/1.2.8 libidn/1.26`


Emerge on Gentoo fails with "Multiple package instances within a single package slot have been pulled … in". How can I resolve this?

I'm trying to install Google Chrome on my recent Gentoo box. But `emerge` is throwing some errors that are way over my head. I genuinely don't know what the problem even is.               !!! Multiple package instances within a single package slot have been pulled     !!! into the dependency graph, resulting in a slot conflict:          dev-libs/glib:2            (dev-libs/glib-2.32.4-r1::gentoo, installed) pulled in by         <dev-libs/glib-2.33:2 required by (dev-libs/gobject-introspection-1.32.1::gentoo, installed)            (dev-libs/glib-2.36.4-r1::gentoo, ebuild scheduled for merge) pulled in by         >=dev-libs/glib-2.34.0:2 required by (x11-libs/gdk-pixbuf-2.28.2::gentoo, ebuild scheduled for merge)         (and 2 more with the same problem)          media-libs/fontconfig:1.0            (media-libs/fontconfig-2.8.0-r1::gentoo, installed) pulled in by         (no parents that aren't satisfied by other packages in this slot)            (media-libs/fontconfig-2.10.92::gentoo, ebuild scheduled for merge) pulled in by         >=media-libs/fontconfig-2.10.91:1.0= required by (x11-libs/pango-1.34.1::gentoo, ebuild scheduled for merge)      I've already tried the `\--backtrack=30` and `\--autounmask-write` options as suggested in the output, but there is no difference in the output. I just need to know what the problem is in order to go about finding a solution to it. Any help is greatly appreciated.


Can't open syntax.vim error when using vimrc

When I try to open my `.bashrc` file. then it shows these lines:               Errordetected while processing /etc/vimrc:     line 45:     E848: Can't open file /usr/share/vim/vim70/syntax/syntax.vim     Press ENTER or type command to continue      When I go to the `/etc/vimrc` file , it shows `syntax on` line 45. I've installed the OS three times and it always shows the same error.


Relation between the kernel version and OS version

I am running a Ubuntu of version 12.04. Can I use a kernel of version of version 2.4 on it?


${!FOO} and zsh

`${!FOO}` performs a double substitution in `bash`, meaning it takes the (string) value of FOO and uses it as a variable name.   `zsh` doesn’t support this feature. Is there a way to make this work the same in `bash` and `zsh`? ### Background: I’ve got a list of environment variables, like               PATH MAIL EDITOR      and want to first print the variable names and afterwards their values. This works in `bash` but not `zsh`:               for VAR in LIST     do             echo $VAR             echo ${!VAR}     done      It should be somehow possible “the old way” with `eval`, but I can’t get it to work:               for VAR in LIST     do             echo $VAR             echo `eval \$$VAR`     done      I’m never going to understand why I can’t simply do arbitrary deep substitutions like `${${VAR}}` or even `${${${VAR}}}` if need be, so an explanation for that would be nice, too.


Org-mode: Inserting (advanced) LaTeX equations for HTML expot

I'm using `org-mode` as working environment, and so far has been extremely useful. One of the wonders of it is the versatility of exporting... I can export to LaTeX or HTML or ODT files from the same code. :-) However, I would like to be able of writing an `aling` LaTeX environment and get it exported properly to HTML. I've tried different form, but nothing! For example: the code returns nothing               #+BEGIN_LaTeX          \begin{align}         \begin{pmatrix}           x' \\ y' \\ z'         \end{pmatrix}          =          \begin{pmatrix}           R11 & R12 & R13\\           R21 & R22 & R23\\           R31 & R32 & R33         \end{pmatrix}         \begin{pmatrix}           X \\ Y \\ Z         \end{pmatrix}          \end{align}     #+END_LaTeX      Any ideas?... Thanks!


Why useradd shows Permission denied error

I am working on CentOS 5.5. When I run the `useradd` command as root, then its working. But when I run the same command from one of the user, then it shows               -bash: /usr/sbin/useradd: Permission denied      Why all this happening? I also added `/usr/sbin` in `PATH`. I added user from root by following commands:               groupadd service     useradd -g service service     passwd service      I installed Operating System two three times, all the time it shows same error. Help me please, I didn't understand why all this happening.


What's with Totem 3.1.0 in Launchpad? And is it installable on Ubuntu 12.04?

I've been wondering, why on the totem launchpad page (https://launchpad.net/totem) they have 3.1.0 instead of 3.10 or 3.11 or what ever version the Gnome 3 team is working on. Is the page abandoned? And also is it installable on Ubuntu 12.04 (Instructions would be nice :)?


Returning a value from a bash function

I have a function which returns 1 if the number is a valid ten digit number:               valNum()     {         flag=1         if [[ $1 != [1-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9] ]]; then             echo "Invalid Number"             flag=0         fi         return $flag     }      It is getting called by:               if [[ $(valNum $num) -eq 1 ]]; then           #do something     fi      The function is working fine if the number is valid but is showing syntax error if input a invalid number.


Why do some drivers still require firmware?

There are a ton of reverse-engineered drivers in the Linux kernel tree. Yet some drivers, especially wireless drivers, require firmware binary blobs to run properly. What prevents someone from reverse-engineering these, too, and making the driver 100% free? Or is it different for different drivers?


Startup with USB Puppy without BIOS control

I'll preface by saying I'm a complete linux newbie. I have Puppy Linux all ready to roll on a USB drive. I know that I can set the boot order in BIOS to do USB first. But what I want is to be able to startup Linux on public computers where I can't get into the BIOS. Is there a way, other than using BIOS, to force the computer to startup with the Linux on the USB?


Is there any reason to move away from fstab on a systemd system?

I'm on an Arch Linux system, which means systemd. In systemd there are native unit files for mountpoints, with the extension .mount. I've always just used `/etc/fstab`, which never gave me problems because systemd just picks up information from that. But now that I've actually read the documentation, I'm wondering if I should change to native systemd unit files. The Arch Wiki suggests that there's no benefit, because it says to populate your `fstab` in the beginner's guide. But I'm not sure.


View all disabled or hidden linux kernel options

I am trying to build a 3.12 Linux Kernel and I see some of the options (sub menus) are hidden and their branch (menu entry) is disabled in `make menuconfig`. [`\----` instead of being `\--->`] I know it is because of my system profile or their dependencies but I want to view all of them. What helped in the previous kernels was a key-shortcut, (like `Ctrl`+`H` in file manager) that shows every option and menu. What is that shortcut?


Access remote server after running ifdown eth0

I had a problem:               Could not retrieve mirrorlist http://mirrorlist.centos.org/release=6&arch=x86_64&repo=os error was     14: PYCURL ERROR 6 - "Couldn't resolve host 'mirrorlist.centos.org'"     Error: Cannot find a valid baseurl for repo: base      I've read and tried this suggestion. Our server is remote, we connect to it with `ssh`. After issuing `ifdown eth0`, the server stopped responding. My OS is CentOS. How can I fix my problem?


How X (X Window) looks?

I am confused as when X is started, how it is visible on screen. Does a new Window appear or not? I am very confused! I booted, opened a shell terminal. > _**Below I write regarding my local machine:_** Entered `xterm` The terminal emulation window (xterm) appeared. Now, I conclude that X is already running and so is X server. Then I entered in terminal `startx` It resulted in a different screen. Looked like normal screen when the system is booted. But that screen has no menus. If 2 windows are opened one above the other, I can't bring the bottom one on top simply by clicking it. One thing I w'd like to add. Once I run 'startx' and a new screen/desktop appears, it's not a direct easy way to come out from there. Right now I experimented. I wasn't able to come out from that desktop. Button function 'alt-tab' doesn't work there. To escape from there back to my original desktop, i pressed ctrl-ALT-F1 and entered shell prompt. there I pressed ctrl- alt-F7 to return back to my original desktop. Now one doubt: Earlier before running command `startx`,was X running, if so when I again ran X by the above command , why it opened a new screen? That means, X is running again with a different look (i.e. different desktop) > _**Below I write regarding my remote machine._** > > One thing I w'd like to tell w.r.t. my **remote server**. One thing I w'd > like to tell w.r.t. my **remote server**. When I connect remote server of > mine (VPS) I see the desktop or the screen on the remote box which is same > screen/wkndow as what I saw on my local machine when I ran on my local > machine `startx`. From this I feel that something like startx is running on > my remote server as a result of which I am not able to see the normal > desktop as seen on local (having menus on left, etc). There was no menu > visible as is visible on my local machine. You can see the screen shot for > clarity of how my **_remote destop_** looks like when I connect to remote > machine. The menu visible on the screen shot is of my local machine. The top > most window is my remote machine. There also I can't change size of any > window. It works the same way as when here locally I ran `startx`. Now > please tell me what can I do so that I get menu on my remote machine. If > there everytime something (as told above) is running, how to stop and get > back to my normal desktop that we all (ubuntu 13.04 users)see after the > system is booted. What to do so that the remote also looks the same as my > local box. Both local and remote has ubuntu13.04 It's too unclear as how X looks. _**Below is screen shot of my remote machine as visible when I connect to it. (the top most window/screen heading: NX-ravbholua@ravi:1002-bholua)_** ![enter image description here](http://i.stack.imgur.com/gew1X.png)


LDAP: ldapadduser - can I add to two different groups?

Usually - `ldapadduser` assumes only one attribute for group-name:                # ldapadduser sysuser2 sysusers      Can I add add this users in to two groups while creating user? If I try run like:               # ldapadduser sysuser2 sysusers,wheel     Warning : using command-line passwords, ldapscripts may not be safe     Cannot resolve group sysusers,wheel to gid : not found      I got error... If no - can I modify users after adding to make him member of two groups? Using **FreeBSD** 9.1 and **OpenLDAP** 2.4.