Create and Delete Amazon EC2 Volumes using a shell script

I am using this following script which does a regular backup of volumes on Amazon AWS cloud service. It creates new snapshots of the volumes and should remove snapshots older than two days. It is creating new snapshots just fine but while removing older snapshots, it is not doing it right.               #!/bin/bash     #     # File: vol-snapshot.sh     TODAY=`date +%m-%d-%Y`     echo "================================================"     echo "Starting SNAPSHOT creation and deletion process for $TODAY"     echo ""     echo "The script will create a snapshot of every single volume"     echo "It will delete snapshots older than two days"     echo ""     echo "Setting ENVIRONMENTAL VARIABLES FOR ec2"          ##     #     export EC2_HOME='/usr/local/ec2'  # Make sure you use the API tools, not the     AMI tools     export EC2_BIN=$EC2_HOME/bin     export EC2_PRIVATE_KEY=$EC2_HOME/pk-XXXXXXXXXXXXXXXXXXXXXXXXXXXXX.pem     export EC2_CERT=$EC2_HOME/cert-XXXXXXXXXXXXXXXXXXXXXXXXXXX.pem     export REGION=us-east-1d     export PATH=$PATH:$EC2_BIN     export OLD=`date +%m-%d-%Y --date '2 days ago'`     ##     #          #     # To find the current location of JAVA_HOME, try env | grep JAVA_HOME     # It's necessary to put this environment variable in here because     # cron will not have access to your standard environment variables.     export JAVA_HOME=/usr/lib/jvm/jre-1.6.0-openjdk.x86_64     ##          ## Get Volumes     VOLUMES=`ec2-describe-volumes | grep VOLUME | cut -f 2`     echo "The volumes are: $VOLUMES"     echo ""          echo "===================================="     echo "Creating snapshots of volumes: $VOLUMES"     echo ""     for volume in $VOLUMES     do        ec2-create-snapshot -C $EC2_CERT -K $EC2_PRIVATE_KEY -d "Creating     Snapshots for $TODAY" $volume     done          echo""     echo "====================================="     echo "Deleting snapshots older than two days for $VOLUMES"     echo ""     for volume in $VOLUMES     do     OLDEST=`ec2-describe-snapshots -C $EC2_CERT -K $EC2_PRIVATE_KEY | grep     $volume | grep $OLD | sed -e 's/.*snap/snap/' | sed -e 's/\t.*//'`         if [ "x$OLDEST" != "x" ]; then             ec2-delete-snapshot -C $EC2_CERT -K $EC2_PRIVATE_KEY $OLDEST             else             echo "No other snapshots to delete using this script."         fi     done     echo "The end of script."      The following line is simply giving snapshots which is just two days old but not the ones beyond that.               OLDEST=`ec2-describe-snapshots -C $EC2_CERT -K $EC2_PRIVATE_KEY | grep $volume | grep $OLD | sed -e 's/.*snap/snap/' | sed -e 's/\t.*//'      Also, should this be placed under a for loop before if? I would be very pleased if someone can help me out here.


SSH asking for password after ssh-copy-id

I created a key on my machine with ssh-keygen. I copied the key to remote machine using ssh-copy-id. Tried to connect to remote machine but it asked me the password. Both machines are ubuntu (local 11.04, remote 8.04) ## EDIT (Output with extra verbose) Here is the verbose from ssh:                   OpenSSH_5.8p1 Debian-1ubuntu3, OpenSSL 0.9.8o 01 Jun 2010     debug1: Reading configuration data /home/leandro/.ssh/config     debug1: Applying options for *     debug1: Reading configuration data /etc/ssh/ssh_config     debug1: Applying options for *     debug2: ssh_connect: needpriv 0     debug1: Connecting to 192.168.1.217 [192.168.1.217] port 22.     debug1: Connection established.     debug3: Incorrect RSA1 identifier     debug3: Could not load "/home/leandro/.ssh/id_rsa" as a RSA1 public key     debug2: key_type_from_name: unknown key type '-----BEGIN'     debug3: key_read: missing keytype     debug3: key_read: missing whitespace     debug3: key_read: missing whitespace     debug3: key_read: missing whitespace     debug3: key_read: missing whitespace     debug3: key_read: missing whitespace     debug3: key_read: missing whitespace     debug3: key_read: missing whitespace     debug3: key_read: missing whitespace     debug3: key_read: missing whitespace     debug3: key_read: missing whitespace     debug3: key_read: missing whitespace     debug3: key_read: missing whitespace     debug3: key_read: missing whitespace     debug3: key_read: missing whitespace     debug3: key_read: missing whitespace     debug3: key_read: missing whitespace     debug3: key_read: missing whitespace     debug3: key_read: missing whitespace     debug3: key_read: missing whitespace     debug3: key_read: missing whitespace     debug3: key_read: missing whitespace     debug3: key_read: missing whitespace     debug3: key_read: missing whitespace     debug3: key_read: missing whitespace     debug3: key_read: missing whitespace     debug2: key_type_from_name: unknown key type '-----END'     debug3: key_read: missing keytype     debug1: identity file /home/leandro/.ssh/id_rsa type 1     debug1: Checking blacklist file /usr/share/ssh/blacklist.RSA-2048     debug1: Checking blacklist file /etc/ssh/blacklist.RSA-2048     debug1: identity file /home/leandro/.ssh/id_rsa-cert type -1     debug1: identity file /home/leandro/.ssh/id_dsa type -1     debug1: identity file /home/leandro/.ssh/id_dsa-cert type -1     debug1: identity file /home/leandro/.ssh/id_ecdsa type -1     debug1: identity file /home/leandro/.ssh/id_ecdsa-cert type -1     debug1: Remote protocol version 2.0, remote software version OpenSSH_4.7p1 Debian-8ubuntu1     debug1: match: OpenSSH_4.7p1 Debian-8ubuntu1 pat OpenSSH_4*     debug1: Enabling compatibility mode for protocol 2.0     debug1: Local version string SSH-2.0-OpenSSH_5.8p1 Debian-1ubuntu3     debug2: fd 3 setting O_NONBLOCK     debug3: load_hostkeys: loading entries for host "192.168.1.217" from file "/home/leandro/.ssh/known_hosts"     debug3: load_hostkeys: found key type RSA in file /home/leandro/.ssh/known_hosts:6     debug3: load_hostkeys: loaded 1 keys     debug3: order_hostkeyalgs: prefer hostkeyalgs: ssh-rsa-cert-v01@openssh.com,ssh-rsa-cert-v00@openssh.com,ssh-rsa     debug1: SSH2_MSG_KEXINIT sent     debug1: SSH2_MSG_KEXINIT received     debug2: kex_parse_kexinit: ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256,diffie-hellman-group-exchange-sha1,diffie-hellman-group14-sha1,diffie-hellman-group1-sha1     debug2: kex_parse_kexinit: ssh-rsa-cert-v01@openssh.com,ssh-rsa-cert-v00@openssh.com,ssh-rsa,ecdsa-sha2-nistp256-cert-v01@openssh.com,ecdsa-sha2-nistp384-cert-v01@openssh.com,ecdsa-sha2-nistp521-cert-v01@openssh.com,ssh-dss-cert-v01@openssh.com,ssh-dss-cert-v00@openssh.com,ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,ssh-dss     debug2: kex_parse_kexinit: aes128-ctr,aes192-ctr,aes256-ctr,arcfour256,arcfour128,aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,aes192-cbc,aes256-cbc,arcfour,rijndael-cbc@lysator.liu.se     debug2: kex_parse_kexinit: aes128-ctr,aes192-ctr,aes256-ctr,arcfour256,arcfour128,aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,aes192-cbc,aes256-cbc,arcfour,rijndael-cbc@lysator.liu.se     debug2: kex_parse_kexinit: hmac-md5,hmac-sha1,umac-64@openssh.com,hmac-ripemd160,hmac-ripemd160@openssh.com,hmac-sha1-96,hmac-md5-96     debug2: kex_parse_kexinit: hmac-md5,hmac-sha1,umac-64@openssh.com,hmac-ripemd160,hmac-ripemd160@openssh.com,hmac-sha1-96,hmac-md5-96     debug2: kex_parse_kexinit: none,zlib@openssh.com,zlib     debug2: kex_parse_kexinit: none,zlib@openssh.com,zlib     debug2: kex_parse_kexinit:      debug2: kex_parse_kexinit:      debug2: kex_parse_kexinit: first_kex_follows 0      debug2: kex_parse_kexinit: reserved 0      debug2: kex_parse_kexinit: diffie-hellman-group-exchange-sha256,diffie-hellman-group-exchange-sha1,diffie-hellman-group14-sha1,diffie-hellman-group1-sha1     debug2: kex_parse_kexinit: ssh-rsa,ssh-dss     debug2: kex_parse_kexinit: aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,arcfour128,arcfour256,arcfour,aes192-cbc,aes256-cbc,rijndael-cbc@lysator.liu.se,aes128-ctr,aes192-ctr,aes256-ctr     debug2: kex_parse_kexinit: aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,arcfour128,arcfour256,arcfour,aes192-cbc,aes256-cbc,rijndael-cbc@lysator.liu.se,aes128-ctr,aes192-ctr,aes256-ctr     debug2: kex_parse_kexinit: hmac-md5,hmac-sha1,umac-64@openssh.com,hmac-ripemd160,hmac-ripemd160@openssh.com,hmac-sha1-96,hmac-md5-96     debug2: kex_parse_kexinit: hmac-md5,hmac-sha1,umac-64@openssh.com,hmac-ripemd160,hmac-ripemd160@openssh.com,hmac-sha1-96,hmac-md5-96     debug2: kex_parse_kexinit: none,zlib@openssh.com     debug2: kex_parse_kexinit: none,zlib@openssh.com     debug2: kex_parse_kexinit:      debug2: kex_parse_kexinit:      debug2: kex_parse_kexinit: first_kex_follows 0      debug2: kex_parse_kexinit: reserved 0      debug2: mac_setup: found hmac-md5     debug1: kex: server->client aes128-ctr hmac-md5 none     debug2: mac_setup: found hmac-md5     debug1: kex: client->server aes128-ctr hmac-md5 none     debug1: SSH2_MSG_KEX_DH_GEX_REQUEST(1024<1024<8192) sent     debug1: expecting SSH2_MSG_KEX_DH_GEX_GROUP     debug2: dh_gen_key: priv key bits set: 132/256     debug2: bits set: 527/1024     debug1: SSH2_MSG_KEX_DH_GEX_INIT sent     debug1: expecting SSH2_MSG_KEX_DH_GEX_REPLY     debug1: Server host key: RSA 72:d5:e9:a2:09:46:e5:f2:e9:65:39:56:ba:f8:bc:38     debug3: load_hostkeys: loading entries for host "192.168.1.217" from file "/home/leandro/.ssh/known_hosts"     debug3: load_hostkeys: found key type RSA in file /home/leandro/.ssh/known_hosts:6     debug3: load_hostkeys: loaded 1 keys     debug1: Host '192.168.1.217' is known and matches the RSA host key.     debug1: Found key in /home/leandro/.ssh/known_hosts:6     debug2: bits set: 555/1024     debug1: ssh_rsa_verify: signature correct     debug2: kex_derive_keys     debug2: set_newkeys: mode 1     debug1: SSH2_MSG_NEWKEYS sent     debug1: expecting SSH2_MSG_NEWKEYS     debug2: set_newkeys: mode 0     debug1: SSH2_MSG_NEWKEYS received     debug1: Roaming not allowed by server     debug1: SSH2_MSG_SERVICE_REQUEST sent     debug2: service_accept: ssh-userauth     debug1: SSH2_MSG_SERVICE_ACCEPT received     debug2: key: /home/leandro/.ssh/id_rsa (0x21ef1040)     debug2: key: /home/leandro/.ssh/id_dsa ((nil))     debug2: key: /home/leandro/.ssh/id_ecdsa ((nil))     debug1: Authentications that can continue: publickey,password     debug3: start over, passed a different list publickey,password     debug3: preferred gssapi-keyex,gssapi-with-mic,publickey,keyboard-interactive,password     debug3: authmethod_lookup publickey     debug3: remaining preferred: keyboard-interactive,password     debug3: authmethod_is_enabled publickey     debug1: Next authentication method: publickey     debug1: Offering RSA public key: /home/leandro/.ssh/id_rsa     debug3: send_pubkey_test     debug2: we sent a publickey packet, wait for reply     debug1: Authentications that can continue: publickey,password     debug1: Trying private key: /home/leandro/.ssh/id_dsa     debug3: no such identity: /home/leandro/.ssh/id_dsa     debug1: Trying private key: /home/leandro/.ssh/id_ecdsa     debug3: no such identity: /home/leandro/.ssh/id_ecdsa     debug2: we did not send a packet, disable method     debug3: authmethod_lookup password     debug3: remaining preferred: ,password     debug3: authmethod_is_enabled password     debug1: Next authentication method: password     optimaster@192.168.1.217's password:           leandro@FiberWork72:~$ cd ~/.ssh/     leandro@FiberWork72:~/.ssh$ ls     config  id_rsa  id_rsa.pub  known_hosts  known_hosts.bkp  known_hosts.old      ## EDIT: Ok. I notice something here. I was looking at the ~/.ssh/authorized_keys and realized that in the end of the key it's written this:               me@my_computer_name       instead of:               me@my_computer_ip      I don't know if have something to do with it, but...


Tmux hidden input at command line

I've just started using tmux recently, and have run into this problem a few times. Whatever I type on the command line, is hidden from view until I press enter and it is executed. I don't know how I triggered this and can't find any mention of 'hidden input' in the manual. I've tried setw -g monitor-activity on, and set -g visual-activity on , but it seems these are meant for something else. To be clear, I can run a program or command if it's typed correctly -- e.g. python manage.py runserver works, but while I am typing it -- no keys show up. It's the same as when you are entering a password for PostgreSQL or similar. The commands do show up in history and can be seen after the command is executed (above the current line).


can i run a java software on startup

Hi I´m a total beginner when it comes to Linux but here goes, I have a raspberry pi with raspien installed. When I start my PI I would like to run the following steps after the operating system is loaded if possible:   1. a java software that checks the internet connection. If there was no connection a gui prompt to add internet properties should be shown and the user will then fill in a form to set the static ip and passwords as needed.   2. Now the PI has a connection and a browser should open with a given url. It this possible?


Detecting SSH agent forwarding

How can I find out whether an SSH connection has been established with or without agent forwarding? I'm trying to do the following:               ssh-add -D (delete all stored keys)     ssh --vvv something     ssh-add (adding key)     ssh --vvv something      and compare output, but I can see only subtle differences.


Ubuntu: How do the md devices get assembled at bootup?

How do the `md` devices get assembled at bootup in Ubuntu? Is `/etc/mdadm/mdadm.conf` truly the relevant factor here? My `mdadm.conf` is sound and I checked that while I was in the rescue CD environment. When running `mdadm -A --scan` it finds and assigns the device names as desired. The `mdadm.conf` contains `AUTO -all` to take out all automatism from assembling the arrays. What I need to do is to be able to auto-assemble the `md` devices as outlined in `mdadm.conf` at boot time or that when assembling it honors the `super- minor` value for the 0.9 array and the `name` (apparently `<hostname>:<super- minor>`) for the 1.2 arrays and does the right thing without `mdadm.conf`. What puzzle piece am I missing? * * * I have the following problem. There are two `md` devices with RAID1 (`md0` and `md1`) and one with RAID6 (`md2`). I am referring to them by the _desired_ device names. `md0` has meta-data version 0.9, the other two have version 1.2. `md0` maps to `/` and the other two are not relevant for _booting_. The boot drive is GPT partitioned. There is a glue "BIOS Boot Partition" (`sda1`) on it. `grub-install --no-floppy /dev/sda` reports success.   * `md0 == sda3 + sdb3`   * `md1 == sda2 + sdb2`   * `md2 == sdc + sdd + sde + sdf + sdg + sdh`   * `sda1` and `sdb1` are "BIOS Boot Partition" each GRUB2 is happy with the `/boot/grub/devicemap` I gave it and I added `part_gpt`, `raid`, `mdraid09` and `ext2` to the modules to preload in GRUB2. Since I still had my root volume in the rescue environment, I simply mounted everything and then `chroot`ed into it:               mkdir /target     mount /dev/md0 /target     mount -o bind /dev /target/dev     mount -o bind /dev/pts /target/dev/pts     mount -o bind /sys /target/sys     mount -o bind /proc /target/proc     chroot /target /bin/bash      From there I reset the `super-minor` on `md0` (with meta-data 0.9) and the `name` on `md1` and `md2`. I also verified that it worked using `mdadm --detail ...`. Other than that I adjusted `/etc/default/grub`, run `update- grub` and also `grub-install --no-floppy /dev/sda` and `grub-install --no- floppy /dev/sdb`. After that, when booting, I am always dropped into the `initramfs` rescue shell, however, because the root file system could not be mounted. The reason, after checking `/proc/mdstat` appears to be that the respective `md` device doesn't even get assembled and run. Not to mention that the other two (meta- data version 1.2) drives receive a device number somewhere in the 125..127 range. **Note:** GRUB2 comes up from the boot disk. So at the very least it has been embedded correctly. The issue is the transition from the initial `rootfs` to the proper root file system.


Change the default font size for single account in KDE

Recently, I got a new wide screen monitor and had to change my desktop size. Now when I log in, the font size for window titles, buttons, task bar items, etc. is too big. In fact, sometimes it is larger than the container holding the text. Problem is, this is a work computer and I do not have writable access to `/etc`. Can I change the font settings for my own user account? If so, how? Thanks!


Switch screens in xorg.conf without reloading X

I have an ARM device running ubuntu and the screen set up using xorg.conf as below:               Section "Device"         Identifier  "Card0"         Driver      "fbdev"         Option      "fbdev" "/dev/graphics/fb2"         VendorName  "Unknown"         BoardName   "Unknown"     EndSection          Section "Screen"         Identifier  "Screen0"         Device      "Card0"         DefaultDepth    24             SubSection      "Display"                 Depth               24                 Modes           "1280x800_60.00"              EndSubSection     EndSection      This works well, however I am trying to find if there is a way to switch graphics device (from `/dev/graphics/fb2` to `/dev/graphics/fb0`) while the X server is running etc. i.e while fb2 is connected use that, but once its not connected use fb0. Is there a way to easily do this? Once case is I will have to restart X but I wanted to check if it was possible.


Debian 6 Gnome black screen after boot

I installed Debian a few weeks ago, and the last time I ran `apt-get update`, I think it updated something **xorg/xserver** , not sure. Since then i get a black screen after boot. If I go into recovery mode I need to input the root password for maintenance, then I get a console. I have an `ATI Radeon HD 7800` and I installed the newest catalyst driver from the ATI website. I checked `/var/log/Xorg.0.log` but couldn't find any errors (EE) If I run `startx`, I just get a black screen, gdm3 gives me this error:`(gdm3:1308): WARNING: Couldn't connect to system bus: Failed to connect to socket /var/run/dbus/system_bus_socket: No such file or directory`. What to do?


background process pipe-input

if i want to display "aaa" on screen:               (1)$: echo aaa | cat                 ... works OK     (2)$: echo aaa | ( cat )             ... works OK     (3)$: echo aaa | ( cat & )           ... NOT working     (4)$: ( echo aaa & ) | cat           ... works OK      (5)$: echo aaa | ( cat <&0 & )       ... works ok in BASH (but not in SH)     (6)$: echo aaa | ( cat <&3 & ) 3<&0  ... works ok in BASH and SH      conlusion from (3) and (4) -> detached process still have connected output that can be controlled, used, redirected..., but not input! My question is: does someone understand **why and how line (5) works** ??? ... "<&0" is short for "0<&0", why redirecting 0 to 0 is solution, and what really happens behind with input of detached process. Subshell's are not the problem, using braces {...} instead of (...) provide same results. ... and question2: is there better solution for "giving input to detached process" than line (6).


Why do we need a firewall if no programs are running on your ports?

When I try to telnet to a port on a server, and if there is no program listening on that port telnet dies with a "Unable to connect ... " error. I understand that. But, why do we need a firewall if there is no program listening on any ports?


How do I get sar to show for the previous day?

on our servers, typing `sar` show's the system load statistics for today starting at midnight, is it possible to show yesterdays statistics?


Black screen at boot with Mint and Ubuntu live CDs

I just bought an HP pavillion g6 laptop, with the hope of installing Linux on it. I have now tried both Linux Mint (my first choice) and Ubuntu, and both simply give me a black screen from the moment it begins loading the Live CD. I think it reaches the login screen, I can hear the start-up jingle, but all is just black. Mint gives an "Automatic boot in 10...9..." screen, then goes black. I can stop the countdown and pick from a few options, I tried the "compatibility mode" but that didn't help. The other options are integrity and memory checks, or to boot from the harddisk. Ubuntu also shows a brief purple screen, where I can escape and either try it or install it. Given the problem I'm having I don't want to install just yet, so I haven't tried that. Picking "Try Ubuntu" I get a black screen immediately after. Google turned up a suggestion of pressing CTRL+ALT+F2 after it has finished loading, to get a shell, but that doesn't seem to do anything. I also searched through the BIOS options and set "Switchable Graphics Mode" to Fixed instead of Dynamic, but that didn't help either (so I've switched it back again). I'm out of ideas. I'd prefer to get Mint to work, since I'm tired of Ubuntu and want to try out Mint instead. **Update** I am able to get it to work by setting the nomodeset boot option, but without that I still get a black screen (I can just barely make out some elements on the screen, but it's very, very dark). I tried installing the proprietary ATI drivers in the Additional Drivers window, but that didn't seem to help, or they weren't installed properly, I can't seem to tell.


Moved Raid from NAS box to PC running Ubuntu hdparm shows drives frozen

So I had a RAID5 setup in a Partriot S4 Javelin (a NAS box). I'm now migrating it to a proper server running Ubuntu 14.04. **NOTE:** There are 4 drives. All the drives show up in Ubuntu. Two show partitions. Two of them are frozen according to `hdparm -I` and show no partitions. `mdadm --examine /dev/sd#` on one of the "not frozen" shows `mdadm` finds the superblock for the RAID. So I have 4 drives, two are "frozen" and show no partitions, while two are "not frozen" and show exactly the partition I expected to see. I tried sleep and awake. Still labelled as frozen. Security is not enabled though so no password has been set. How can I unfreeze these drives? Any advice?


Trying to update php on CentOS 5.7

Apologies in advance - I'm not a good Linux user by any stretch of the imagination. I have a CentOS 5.7 dedicated server on which I host a few websites. I currently have php `5.2.10` installed, but I'd like to update to `5.3.9`. I tried to update manually, and `php -v` displays `5.3.9`. However, when I `phpinfo()`, it displays 5.2.10. **First problem** I followed these instructions for updating PHP manually:   * Logged in as root   * `wget` the latest PHP installation   * `tar zxvf php-.....gz`   * `cd php-....`   * `./configure`   * `make`   * `apachectl stop`   * `make install`   * `apachectl start` I also tried restarting httpd by `/usr/sbin/httpd restart`. `php -v` shows the latest version of PHP but `phpinfo()` on a php page shows the old version. Any idea what the problem there might be? **Second Problem** If I try to `yum update php`, it says this: > Loaded plugins: fastestmirror > > Loading mirror speeds from cached hostfile > >   * epel: mir01.syntis.net > >   * rpmforge: ftp-stud.fht-esslingen.de > > > > Excluding Packages in global exclude list > > Finished > > Setting up Update Process > > No Match for argument: php > > No package `php` available. > > No Packages marked for Update I've tried `yum clean all` and adding rpmforge repositories - same outcome! So, secondly, does anyone have any idea why I can't update php from yum? I'd like to be able to do that in future so that I can quickly and easily keep php and mySQL up to date. Thanks in advance,


installing libsocket-perl, apt-get searches for wrong filename extension, gets 404

I've been having trouble installing a package for a number of days now and can't find the solution anywhere, though I have been able to figure out more exactly what's going wrong. It appears that apt-get or aptitude appends an incorrect extension to the file when searching for a specific dependency package `libsocket-perl` in the archive mirror. Looking through the archive, I can find many versions of the package: http://ftp.us.debian.org/debian/pool/main/libs/libsocket-perl/               libsocket-perl_2.014-1+b2_s390x.deb     libsocket-perl_2.014-1.debian.tar.xz     libsocket-perl_2.014-1.dsc     libsocket-perl_2.014-1_amd64.deb     libsocket-perl_2.014-1_armel.deb     libsocket-perl_2.014-1_armhf.deb     libsocket-perl_2.014-1_i386.deb     libsocket-perl_2.014-1_kfreebsd-amd64.deb     libsocket-perl_2.014-1_kfreebsd-i386.deb     libsocket-perl_2.014-1_mips.deb     libsocket-perl_2.014-1_mipsel.deb     libsocket-perl_2.014-1_powerpc.deb     libsocket-perl_2.014.orig.tar.gz     ...      but when apt-get or aptitude attempt to get and install it, I get this error thrown:               E: Failed to fetch http://ftp.us.debian.org/debian/pool/main/libs/libsocket-perl/libsocket-perl_2.014-1+b1_amd64.deb  404  Not Found [IP: 64.50.233.100 80]      The `+b1_amd64.deb` extension is not to be found on the archive. Now I don't really understand why I need a `+b1` version of the package or why it isn't available on the archive. Is there a way that I can get the package manager to search for an available version that would do instead?


Encrypt hook in mkinitcpio.conf for full system encryption USB drive Arch install

I have installed Arch Linux on a USB drive with full system encryption using LUKS. The Arch wiki as usual walked me through almost everything. The only issue I ran into was using setting up the hooks in `mkinitcpio`. The Arch wiki says that for a USB install the `block` hook must come immediately after the `udev` hook. The wiki also says for encryption that the `encrypt` hook must come before, but not necessarily immediately, the `filesystem` hook. Following these rules I first tried:               HOOKS="encrypt base udev block autodetect modconf filesystems keyboard fsck"      but it didn't work, so I moved `encrypt` to be later:               HOOKS="base udev block autodetect modconf encrypt filesystems keyboard fsck"      and it works fine. This leads to my question. What are the dependencies for the `encrypt` hook and where can I find details about hook dependencies?


Migrating from tp_smapi to 'normal' ACPI support in 2.6.36

I used zen kernel patchset for a long time which included tp_smapi patch. Recently in zen-stable tp_smapi was removed as "We no longer need tp_smapi as of 2.6.36 - the in-kernel thinkpad acpi support is better.". How to port following code to in-kernel thinkpad acpi:               echo 40 > /sys/devices/platform/smapi/BAT0/start_charge_thresh     echo 40 > /sys/devices/platform/smapi/BAT1/start_charge_thresh     echo 60 > /sys/devices/platform/smapi/BAT0/stop_charge_thresh     echo 60 > /sys/devices/platform/smapi/BAT1/stop_charge_thresh


Top Command - How to reduce the displayed Columns

Can we get specific column in a top command, for eg I'm interested in only the memory utilization and CPU usage column. How do I reduce the displayed columns of the top command to only the above two columns?


installing eric5 in CentOS 6.4

I am trying to install Eric Python IDE 5 in my CentOS 6.4. The problem here is even I have installed PyQT4 its again saying that module is missing. what I am supposed to do ? here is the terminal log               [root@localhost eric5-5.3.5]# yum install PyQt4     Loaded plugins: fastestmirror, refresh-packagekit, security     Loading mirror speeds from cached hostfile      * base: centos.excellmedia.net      * epel: mirrors.vinahost.vn      * extras: centos.excellmedia.net      * rpmfusion-free-updates: mirror.us.leaseweb.net      * updates: centos.excellmedia.net     Setting up Install Process     Package PyQt4-4.6.2-9.el6.i686 already installed and latest version     Nothing to do     [root@localhost eric5-5.3.5]# python3 install.py      Checking dependencies     Python Version: 3.3.2     Sorry, please install PyQt4.     Error: No module named 'PyQt4'     [root@localhost eric5-5.3.5]#       how can I solve this issue ?


Lowercasing all directories under a directory

I want to lowercase every directories' name under a directory. With which commands can I do that?


Mutt imap multiple account

My first question on this site, I come quickly. I'm a fan of command line tools and text-based application. I use tmux with a minimalist tiling wm is qtile, I can not change the environment. I'm a developer, I mainly use Python and Perl. My first question is about mutt a great client. I use the sidebar to be able to display mailboxes. I used imap with google accounts, Here is my configuration:               account-hook . 'unset preconnect imap_user imap_authenticators'          #First account     account-hook 'imaps://hobbestigrou@domain.com@imap.gmail.com:993/' \        ' set imap_user = "hobbestigrou@domain.com" \          imap_pass = "password" '          folder-hook 'imaps://hobbestigrou@domain.com@imap.gmail.com:993/INBOX' \         ' set imap_user = "hobbestigrou@domain.com" \           imap_pass = "1password" \           smtp_url = "smtp://hobbestigrou@domain.com@smtp.gmail.com:587/" \           smtp_pass = "password" \           from = "hobbestigrou@domain.com" \           realname = "Natal Ngétal" \           folder = "imaps://hobbestigrou@domain.com@imap.gmail.com:993" \           spoolfile = "+INBOX" \           postponed="+[Gmail]/Drafts" \           mail_check=60 \           imap_keepalive=300 '          #Second account     account-hook 'imaps://hobbestigrou@domain2.com@imap.gmail.com:993/' \         ' set imap_user = "hobbestigrou@domain2.com" \           imap_pass = "password" '          folder-hook 'imaps://hobbestigrou@domain2.com@imap.gmail.com:993/INBOX' \         ' set imap_user = "hobbestigrou@domain2.com" \           imap_pass = "password" \           smtp_url = "smtp://hobbestigrou@domain2.com@smtp.gmail.com:587/" \           smtp_pass = "password" \           from = "hobbestigrou@domain2.com" \           realname = "Natal Ngétal" \           folder = "imaps://hobbestigrou@domain2.com@imap.gmail.com:993" \           spoolfile = "+INBOX" \           postponed="+[Gmail]/Drafts" \           mail_check=60 \           imap_keepalive=300 '          mailboxes + 'imaps://hobbestigrou@domain.com@imap.gmail.com:993/INBOX' \               + 'imaps://hobbestigrou@dmain2.com@imap.gmail.com:993/INBOX' \               + 'imaps://hobbestigrou@domain.com@imap.gmail.com:993/[Gmail]/Messages envoyés' \               + 'imaps://hobbestigrou@domain2.com@imap.gmail.com:993/[Gmail]/Messages envoyés' \               + 'imaps://hobbestigrou@domain.com@imap.gmail.com:993/[Gmail]/Spam' \               + 'imaps://hobbestigrou@domain2.com@imap.gmail.com:993/[Gmail]/Spam' \               + 'imaps://hobbestigrou@domain.com@imap.gmail.com:993/Divers' \               + 'imaps://hobbestigrou@domain2.com@imap.gmail.com:993/Divers' \               + 'imaps://hobbestigrou@domain.com@imap.gmail.com:993/[Gmail]/Tous les messages' \               + 'imaps://hobbestigrou@domain2.com@imap.gmail.com:993/[Gmail]/Tous les messages'          # Where to put the stuff     set header_cache = "~/.mutt/cache/headers"     set message_cachedir = "~/.mutt/cache/bodies"     set certificate_file = "~/.mutt/certificates"               set mail_check = 30     set move = no     set imap_keepalive = 900     set editor = "vim"          set date_format = "%D %R"     set index_format = "[%Z]  %D  %-20.20F  %s"     set sort = threads                         # like gmail     set sort_aux = reverse-last-date-received  # like gmail     set uncollapse_jump                        # don't collapse on an unread message     set sort_re                                # thread based on regex     set reply_regexp = "^(([Rr][Ee]?(\[[0-9]+\])?: *)?(\[[^]]+\] *)?)*"          bind index gg       first-entry     bind index G        last-entry          bind index R        group-reply     bind index <tab>    sync-mailbox     bind index <space>  collapse-thread          # Ctrl-R to mark all as read     macro index \Cr "T~U<enter><tag-prefix><clear-flag>N<untag-pattern>.<enter>" "mar          # Saner copy/move dialogs     macro index C "<copy-message>?<toggle-mailboxes>" "copy a message to a mailbox"     macro index M "<save-message>?<toggle-mailboxes>" "move a message to a mailbox"          bind index \CP sidebar-prev     bind index \CN sidebar-next     bind index \CO sidebar-open     bind pager \CP sidebar-prev     bind pager \CN sidebar-next     bind pager \CO sidebar-open          set pager_index_lines = 10 # number of index lines to show     set pager_context = 3      # number of context lines to show     set pager_stop             # don't go to next message automatically     set menu_scroll            # scroll in menus     set tilde                  # show tildes like in vim     unset markers              # no ugly plus signs          bind pager k  previous-line     bind pager j  next-line     bind pager gg top     bind pager G  bottom          bind pager R  group-reply          set quote_regexp = "^( {0,4}[>|:#%]| {0,4}[a-z0-9]+[>|]+)+"     auto_view text/html                                      # view html automatically     alternative_order text/plain text/enriched text/html          set sidebar_delim   = '│'     set sidebar_visible = yes     set sidebar_width   = 24          set status_chars  = " *%A"     set status_format = "───[ Folder: %f ]───[%r%m messages%?n? (%n new)?%?d? (%d to delete)?%?t? (%t tagged)? ]───%>─%?p?( %p postpone          set beep_new             # bell on new mails     unset mark_old           # read/new is good enough for me          color normal    white black     color attachment brightyellow black     color hdrdefault cyan black     color indicator black cyan     color markers    brightred black     color quoted    green black     color signature cyan black     color status    brightgreen blue     color tilde    blue black     color tree    red black          color index    red black ~D     color index    magenta black ~T               set signature="~/.signature"      So it works well, I can see both my inbox and when there are new posts in it. But when I open mutt it first opened a local box, I do not understand why, and to see the new posts in other inbox, I have to move first in each of they. Maybe it's normal, but how by asking mutt to open domain.com for example first and not a local one that does not exist.


screen /bin/bash execute script and then go to interactive shell

I am using .byobu/windows to start up some screen sessions, and I'm trying to start a script that will exit to an interactive shell once it has completed. Is this possible? I've tried:               screen -t test /bin/bash -i /path/to/script     screen -t test /bin/bash - /path/to/script      I realize I could just add a /bin/bash to the end of the script, but I don't want that as a solution for when I run the script in a shell...


very high buffer memory usage

Is this normal - I've never seen buffers so high?               $ cat /proc/meminfo      MemTotal: 16332808 kB     MemFree: 1112264 kB     Buffers: 10630124 kB     Cached: 699400 kB     SwapCached: 0 kB     Active: 3262924 kB     Inactive: 8132004 kB     Active(anon): 27464 kB     Inactive(anon): 38888 kB     Active(file): 3235460 kB     Inactive(file): 8093116 kB     Unevictable: 0 kB     Mlocked: 0 kB     SwapTotal: 525308 kB     SwapFree: 525308 kB     Dirty: 40 kB     Writeback: 0 kB     AnonPages: 65412 kB     Mapped: 11300 kB     Shmem: 940 kB     Slab: 3674368 kB     SReclaimable: 3652612 kB     SUnreclaim: 21756 kB     KernelStack: 1496 kB     PageTables: 3340 kB     NFS_Unstable: 0 kB     Bounce: 0 kB     WritebackTmp: 0 kB     CommitLimit: 8691712 kB     Committed_AS: 594304 kB     VmallocTotal: 34359738367 kB     VmallocUsed: 102232 kB     VmallocChunk: 34359634044 kB     HardwareCorrupted: 0 kB     DirectMap4k: 2048 kB     DirectMap2M: 16691200 kB


Passing the "--float" option to OpenVPN client from  NetworkManager

NetworkManager on Fedora14 doesn't support the "--float" parameter of OpenVPN client. Are there any workarounds to connect with NetworkManager to an OpenVPN network using the `--float` option? Or are there any other graphical Network Managers for GNOME that would have this feature?


XenServer how can I shrink the virtual drive of XenServer domU?

How can I shrink the virtual drive of XenServer image?. I gave 300Gb of space for one image (domU) and that was mistake. Now I want to shrink it. How can I do that? The system is already set up and configured, I can't just start a new server. (But if there is no other way, I will.)


Does GRUB consider partition order when looking for config files?

I have a HD which has 3 partitions, in the following order:   1. NTFS   2. FAT32   3. FAT32 (very small) I want to install GRUB into the MBR of the HD, and place the config files (`menu.lst`, etc.) into the 3rd partition. I will use the `--root-directory` command-line parameter. What happens if I change the partition layout after GRUB installation? Will GRUB be able to read those files, even if the partition they belong to becomes the 2nd or 4th one on the disk?


32 or 64 bit class file

I have a Java `.class file`. Now I want to check it was compiled on a 32 bit machine or 64 bit machine ? I tried `file` command but it just says it is a compiled java class. Is there any way to find it?


Why is pcmanfm such a headache when it comes to mounting filesystems?

If I would have known how much 'customization' it takes to get LXDE and its default file manager, `pcmanfm`, just working, I would probably have never chosen to try it. I've got a problem. Lots of people have it. All of these people report the same problem with `pcmanfm`. The people in the forums have about half a dozen magic recipes that get it to work finally. But I want to know what's actually causing `pcmanfm` not to work, because I want to increase my understanding of the way Linux works, not just follow someone's instructions. I am talking about the rather unhelpful "Not Authorized" window that pops up whenever I insert media. Lots of people have this problem. I managed to fix this before. I ended up doing some sort of magic with an xml file. (Was it udisks? Was it `polkit-gnome`? Dunno, but they're both on the list of magic recipes for solving this issue.) I changed every entry that said something to say something else. And finally, I could see my media. (I couldn't even mount it manually I should add.) I fixed it before and... What happened? I used `apt-get`, installed a new package (`udev`, because I was trying to fix _other mounting issues_ that it seems people stopped having when `hal` became deprecated), and bang, the problem's back. So, I must like torment, because it's certainly in the cards. This is not an easy answer question. If you didn't click any of the links above, you won't be able to tell what I'm talking about. My question is, _what's at the bottom of this?_ At a real, bare bones, _we built these systems on top of Unix and sometimes they don't work as well as the original Unix_ level?


How can I check which terminal definitions are available?

The bulk of the question is in title, but to elaborate a little: On most Linuxes I can `find /usr/share/terminfo -type f`. But on Solaris machine I have nearby - this directory doesn't even exist. I could iterate over a list of terminals, and do something like:               for TERM in xterm xtermc xterm-color xterm-256color screen rxvt     do         tput cols >/dev/null 2>/dev/null && echo "$TERM available"     done      But it's slow. Any options to discover path used by `tput` to terminal definitions, and run "find" myself?


How to find out what is wasting space on "/"?

I can find out what is wasting space with this:                du -sm * | sort +0nr | head -30      But what if "/" is filled 100%, and there are many mountpoints, ex.: /foo, /foo2, etc. How can I get a list of directory sizes in ex.: "/" that aren't mountpoints? (recursively not mountpoints?) UPDATE: This doesn't work:               cd /; du -sxm * 2>/dev/null | sort +0nr | head -30      since it lists directories that are mounted in ex.: "/FOO" (tried this under: AIX6.1 and SLES 9.4) UPDATE:               du -xm / | sort +0nr | head -30      this worked on AIX, now what? :D


Where is the log for ACPI events?

Running Mint 14. Sometimes I can suspend fine, but after my computer is on for a while, it no longer suspends. It wakes up after a second or so without any external inputs. My guess is that I'm monitoring something I don't need to monitor:               >cat /proc/acpi/wakeup     Device  S-state   Status   Sysfs node     LID       S4    *enabled        SLPB      S3    *enabled        IGBE      S4    *enabled   pci:0000:00:19.0     EXP3      S4    *disabled       XHCI      S3    *enabled   pci:0000:00:14.0     EHC1      S3    *enabled   pci:0000:00:1d.0     EHC2      S3    *enabled   pci:0000:00:1a.0     HDEF      S4    *disabled  pci:0000:00:1b.0      These devices are rather cryptic. Although it might be interesting to know what the devices are, all I really care about is the one that is causing my computer to wake up (so I can disable monitoring of that device). Is there a log file somewhere that keeps track of ACPI events that would tell me which device woke up my computer?


How to write out the next 3 or X days with a command?

I can give the day for today in a command:               TODAY=`date +%Y.%m.%d.`      but how can I give out the next 3 or X days in a command? (Ubuntu 12.04)


Linux VM's disk went read-only = no choice but reboot?

I have several Linux VMs on VMware + SAN. ## What happened A problem occured on the SAN (failed path) so that for some time, there were I/O errors on the Linux VMs drives. When the path failover had been done, it was too late: _every Linux machine considered most of its drives as not "trustworthy" anymore, setting them as read-only devices_. The root filesystem's drives were also impacted. ## What I tried   * `mount -o rw,remount /` without success,    * `echo running > /sys/block/sda/device/state` without success,   * dug into `/sys` to find a solution without success.  ## What I may have not tried   * `blockdev --setrw /dev/sda` ## Finally... I had to reboot all my Linux VMs. The Windows VMs were fine... ## Some more info from VMware... The problem is described here. VMware suggests to increase the Linux scsi timeout to **prevent** this problem to happen. ## The question! However, **when the problem _does_ eventually happen, is there a way to get the drives back to read-write mode?** (once the SAN is back to normal)


Which systems do not honor socket read/write permissions?

`man 7 unix` on Linux states: > In the Linux implementation, sockets which are visible in the file system > honor the permissions of the directory they are in. Their owner, group and > their permissions can be changed. Creation of a new socket will fail if the > process does not have write and search (execute) permission on the directory > the socket is created in. **Connecting to the socket object requires > read/write permission. This behavior differs from many BSD-derived systems > which ignore permissions for UNIX domain sockets.** Portable programs should > not rely on this feature for security. Which systems ignore permissions for UNIX domain sockets?


What's the syntax for selecting a range of lines in Vim?

What's the syntax for selecting a range of lines? I want to run a command over lines 1405 until 1700. And one from 1405 until the end of file, without wanting to look up that number. Update: Is it possible to select a range from the current line to Nth line?


How can I remotely run a Windows 7 application from host on a linux guest without showing up on host?

I have Ubuntu Linux guest running on a Windows 7 host using Virtualbox. I am wondering if I can remotely access the application from Windows 7 on my ubuntu install and not show up on the windows 7 host and only appear on Ubuntu. I know terminal services can do this but I am using Windows 7 ultimate and it does not include it. Would installing and x server on windows 7 like Mingw/Cygwin+CygwinX and SSH work like it does while in linux? Can anyone guide me in the right direction?


How do I force move something when sudo mv -f doesn't work?

I need to move a 16 GB folder to my external drive, but moving it manually gives me an in use error. I have tried to start in safe mode and moved it but it was still in use. I have run these commands               diskutil repairdisk /dev/disk0s2     diskutil repairdisk /dev/disk2      Where disk0 is my disk and disk2 is the one I want to move it to. I have no permission errors and I have even run `sudo mv -f` it gives me these:               mv: symlink: ../../../../../Preferences/com.apple.systemsound.plist: File exists`      I have also gotten the same error but without `symlink` For 200 files and the last error is this               mv: /bin/cp: terminated with 1 (non-zero) status      What can I do? I have also ran `sudo chmod 777` for both folders and used the "include for all files option (OS X). By request here is the exact command:               sudo mv -f ~/desktop/collections/jadd /Volumes/External\ 4


Running 64bit OS , Find all 32bit programs on a system

How should I locate all 32bit programs on my system ? I'm running a 64bit OS. (There might be some , but I forget)


Applying changes to xorg.conf without restarting

I'm using Ubuntu 12.04 and making some changes to `/etc/X11/xorg.conf`. I now need to restart X server to apply the changes, but I don't want to restart my machine. I know restarting the display manager (eg. lightdm) will sometimes work, is this the best way to do it?


Why isn't sed greedy in this simple case?

$echo "foo 65 bar" | sed -n -e 's/.*\([0-9]\+\).*/\1/p'     5      Why is the output not `65`? Shouldn't sed greedily match the `[0-9]\+` part? How do I tell sed to match all of `65`?


How to fix possibly wiped MBR after centOS install?

I think I have messed this one up royally... I have done a clean install of centOS 5.6 (x86_64) on my system. I got through the installation process successfully and rebooted. Now I am greeted with a blinking cursor on a black screen. No grub, no menu, no nothing (the system does POST). I did wipe the hard drive completely before doing the install. I am wondering if I wiped the MBR too, but I thought the centOS install would fix that. I am able to use bootable media with no issues. I have a copy of RIP Linux on a bootable USB so I am able to access the CentOS install files. At this point Im not sure where to go from here. What should my next step be to troubleshoot this? How would I do a fix or even a check on the MBR?


How do I make a droplet/.app in platypus for my unix command?

This is my sample code from the platypus tutorial. I am trying to make it work with a command named `pymol`, and I want it to open .pdb files or open just `pymol`. I know nothing about perl, but I have basic sh knowledge and can do aliases and modify `.zshrc` files. According to CommonMediaInc, > Filling the gap is Platypus, a handy little utility which makes application > bundles out of Unix scripts. Notice I didn’t say “Perl” there. Platypus > plays nicely with shell scripts, Python, PHP, Ruby, and Tcl just as easily > as Perl. As the developer describes it, “this is done by wrapping the script > in an application bundle directory structure along with an executable binary > that runs the script.” So hopefully someone here can help with making a small, usable droplet (drag- and-drop icon) to open files dropped to this app (while switching to the path of the file).               #!/usr/bin/perl          use strict;     use File::Basename;          my $cmd = "/usr/bin/tar cvfz";          # Get enclosing folder of first file     my($fn, $directory) = fileparse($ARGV[0]);          # Change to that directory     chdir($directory);          # Archive is created there     my $dest_path = "Archive.tgz";          my $files;     foreach(@ARGV)     {         my($filename, $directory) = fileparse($_);         $files .= "'$filename' ";     }          print $cmd . "\n";     system("$cmd $dest_path $files");


debug php script and output result and errors to a text file

Can someone tell me how to to run a php script and output content and errors to a text file (using nohup) using csh?


Sed regex - include original matching

INPUT:               dsfgsdf8gfsd     2011.06.26. v     iudsfg98sdfg     sosdufgsdfg     2011.06.27. h     8xdofguiosdfg     jdasfhasd89fa     2011.06.28. k     ydsfgsdgsdg     dsfgdsfzfszgh     2011.06.29. sze     ds9fgisdfgsdfg     asdfasdfasddf     2011.06.30. cs     dsg789sdiofgsdg     dsfig89dsfgds     2011.07.01. p     sd9fg8sdgsdg     sdlfjgsd89öfgxcbv     dsglsd9gcxbv     dsflgjsdlfgfsdg     sdfsdfgdxfgxc     2011.07.02. szo     cvbdsgfsd     2011.07.03. v     dfgsdfgsd     2011.07.04. h     sdfgsdfgsdg      How can I get this OUTPUT with e.g.: sed? (or Perl?)               2011.06.26. v     iudsfg98sdfg     sosdufgsdfg     ----------     2011.06.27. h     8xdofguiosdfg     jdasfhasd89fa     ----------     2011.06.28. k     ydsfgsdgsdg     dsfgdsfzfszgh     ----------     2011.06.29. sze     ds9fgisdfgsdfg     asdfasdfasddf     ----------     2011.06.30. cs     dsg789sdiofgsdg     dsfig89dsfgds     ----------     2011.07.01. p     sd9fg8sdgsdg     sdlfjgsd89öfgxcbv     dsglsd9gcxbv     dsflgjsdlfgfsdg     sdfsdfgdxfgxc     ----------     2011.07.02. szo     cvbdsgfsd     ----------     2011.07.03. v     dfgsdfgsd     ----------     2011.07.04. h     sdfgsdfgsdg      So I want to swap the:               2011.06.26. v      AND               2011.06.27. h      etc. to this:               ----------     2011.06.26. v      AND               ----------     2011.06.27. h      I already tried (don't laugh :D ):               sed "s/[0-9]\{4\}\.[0-9]\{2\}\.[0-9]\{2\}\. /WTF/g"      But I don't know how to match "h, k, sze, cs, p, szo, v" in sed, and I don't know how can I put the matched things to the "WTF" (in .../WTF/g") Has anyone any idea? :\ Thank you!


Is there a Vim syntax file for ANSI-colored output of CLI apps?

I have quite a lot of Perl scripts which print colored output to the terminal, using `Term::ANSIColor`. This is the same as when a shell script does e.g.               echo -e '\e[1;31mError:\e[0m Your fault.'      Viewing log files of these commands works in `less` (with the `-R` switch), but in Vim, the color characters are displayed raw like this:               ^[[1;31mError:^[[0m Your fault.      I would do a syntax file to match these markers, conceal them, and color the resulting syntax regions accordingly, but first I wanted to check whether there is something like this already.


Debian Stable libgl1-nvidia-glx:i386 not found (trying to install Steam)

I just installed Debian and now I am trying to set up Steam. I did the first 2 steps in the 64 bit instructions and also installed `ia32-libs`. But when I run the following:               apt-get install libgl1-nvidia-glx:i386      It tells me this:               Reading package lists... Done     Building dependency tree           Reading state information... Done     E: Unable to locate package libgl1-nvidia-glx      How can I have `apt-get` locate and install `libgl1-nvidia-glx`?


How can I find my local mail spool?

I am a graduate student and a relative Linux novice. This question is a sort of spin-off of my earlier question. My institution has a Ubuntu Linux cluster. I am just a user; I do not have sysadmin permissions, and I certainly do not have the expertise to be a sysadmin! My question is, how do I find my local mail spool? As far as I know, I am not using a mail transfer agent. Answers to my previous question suggested that I look for a file `/var/spool/mail/$USER`, but unfortunately, I do not see a file corresponding to my user name. In `/var/spool/mail/`, using `ls` I only see two files: `nobody` and `www-data`, which are both extensionless files. Do you have any other ideas of where I can look for my mail spool (which is probably local, since I do not have a mail transfer agent configured, as far as I know)?


bash: regular expressions in if expression

In my script on my ubuntu machine I declare a string like this:               DEBUG_PACKAGE_LIST=$(apt-cache search dbg | awk '{ print $1 }' | grep -e "-dbg")      For you to help you understand my problem here is the output of               echo $DEBUG_PACKAGE_LIST >> debug      The following               if [[ ! $DEBUG_PACKAGE_LIST =~ "[^-a-z0-9]libmagick++5-dbg[a-z]*" ]]; then         echo "no contained";      fi      echos "not contained", despite `$DEBUG_PACKAGE_LIST` contains the string "libmagick++5-dbgsym". Could you help me understand why? Basically my intention is to match libmagick++5-dbg, wheras, libmagick should only be preceeded by a space character.


How to create command shortcut to .sh file?

I want to type `firefox` in terminal and run Mozilla browser. So I try to create sym-link: `ln -s /opt/firefox firefox` but after typing `firefox` in terminal I get an error: `bash: firefox: command not found` Where is problem?


Install OpenSUSE 12.3 on a Virtual Machine

I am trying to install OpenSUSE 12.3 onto a (VirtualBox, on Windows) virtual machine. I have tried both the Net Install (-NET) and LiveCD (Gnome) installs. The installations proceed almost to completion, but then fail for a variety of reasons. For the Net Install, it will install most of the way, then crash into the text mode fallback with the error message "an error occurred during the installation". For the LiveCD, it will freeze when it reaches the point of installing the bootloader. I have tried scanning my disk for bad sectors or errors that would affect VirtualBox itself. I have also tried using a VirtualBox "fixed disk" rather than the "dynamic allocation". What would cause this?


Unable to start the 'named' service

Whenever I try to run the `named` service, I get the following even though my permissions and folder ownership are all fine:               [root@f13 ~]# service named start     Starting named:     Error in named configuration:     zone localhost/IN: loading from master file /var/lib/named/localhost.zone failed: permission denied     zone localhost/IN: not loaded due to errors.     _default/localhost/IN: permission denied     zone 235.168.192.in-addr.arpa/IN: loading from master file /var/lib/named/mydb-for-192-168-235 failed: permission denied     zone 235.168.192.in-addr.arpa/IN: not loaded due to errors.     _default/235.168.192.in-addr.arpa/IN: permission denied     zone example.org/IN: loading from master file /var/lib/named/mydb-for-example-dot-org failed: permission denied     zone example.org/IN: not loaded due to errors.     _default/example.org/IN: permission denied                                                                [FAILED]     [root@f13 ~]# ls -lh /var/lib/named/     total 12K     -rwxrwxrwx. 1 named named 191 May 27 09:13 localhost.zone     -rwxrwxrwx. 1 named named 277 May 27 09:15 mydb-for-192-168-235     -rwxrwxrwx. 1 named named 269 May 27 09:14 mydb-for-example-dot-org


Make laptop to wake up by keyboard and mouse

The only way I can wake up my laptop (HP Elitebook 8460p) from suspend is by pressing the power button. Neither the built-in keyboard/mouse nor the external ones (connected via USB) wake the laptop up. Things I already tried:   * Enabling the USB devices in `/proc/acpi/wakeup`.   * Checking the bootlog to find out the /dev paths of the USB mouse/keyboard, then:              udevadm info -a -p $(udevadm info -q path -n /dev/input/mouse2)      I then checked for every device in the list using:              cat /sys/devices/.../power/wakeup      if it is possible to enable it, and if so, I do that.   * I have enabled wake on USB in the BIOS. Here some outputs you might need: **$ uname -a**               Linux oliarch 2.6.38-ARCH #1 SMP PREEMPT Tue May 10 08:05:04 CEST 2011 x86_64 Intel(R) Core(TM) i5-2540M CPU @ 2.60GHz GenuineIntel GNU/Linux      **# lsusb**               Bus 001 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub     Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub     Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub     Bus 002 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub     Bus 003 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub     Bus 003 Device 003: ID 046d:c52b Logitech, Inc. Unifying Receiver     Bus 003 Device 004: ID 04f2:b230 Chicony Electronics Co., Ltd      Bus 003 Device 005: ID 03f0:231d Hewlett-Packard      **# lspci**               00:00.0 Host bridge: Intel Corporation 2nd Generation Core Processor Family DRAM Controller (rev 09)     00:02.0 VGA compatible controller: Intel Corporation 2nd Generation Core Processor Family Integrated Graphics Controller (rev 09)     00:16.0 Communication controller: Intel Corporation 6 Series Chipset Family MEI Controller #1 (rev 04)     00:16.3 Serial controller: Intel Corporation 6 Series Chipset Family KT Controller (rev 04)     00:19.0 Ethernet controller: Intel Corporation 82579LM Gigabit Network Connection (rev 04)     00:1a.0 USB Controller: Intel Corporation 6 Series Chipset Family USB Enhanced Host Controller #2 (rev 04)     00:1b.0 Audio device: Intel Corporation 6 Series Chipset Family High Definition Audio Controller (rev 04)     00:1c.0 PCI bridge: Intel Corporation 6 Series Chipset Family PCI Express Root Port 1 (rev b4)     00:1c.1 PCI bridge: Intel Corporation 6 Series Chipset Family PCI Express Root Port 2 (rev b4)     00:1c.2 PCI bridge: Intel Corporation 6 Series Chipset Family PCI Express Root Port 3 (rev b4)     00:1c.3 PCI bridge: Intel Corporation 6 Series Chipset Family PCI Express Root Port 4 (rev b4)     00:1c.7 PCI bridge: Intel Corporation 6 Series Chipset Family PCI Express Root Port 8 (rev b4)     00:1d.0 USB Controller: Intel Corporation 6 Series Chipset Family USB Enhanced Host Controller #1 (rev 04)     00:1f.0 ISA bridge: Intel Corporation 6 Series Chipset Family LPC Controller (rev 04)     00:1f.2 SATA controller: Intel Corporation 6 Series Chipset Family 6 port SATA AHCI Controller (rev 04)     23:00.0 FireWire (IEEE 1394): JMicron Technology Corp. IEEE 1394 Host Controller (rev 30)     23:00.1 System peripheral: JMicron Technology Corp. SD/MMC Host Controller (rev 30)     23:00.2 SD Host controller: JMicron Technology Corp. Standard SD Host Controller (rev 30)     24:00.0 Network controller: Intel Corporation Centrino Advanced-N 6205 (rev 34)     25:00.0 USB Controller: NEC Corporation uPD720200 USB 3.0 Host Controller (rev 04)      **# cat /proc/acpi/wakeup**               Device  S-state   Status   Sysfs node     LANC      S0    *enabled   pci:0000:00:19.0     EHC1      S3    *enabled   pci:0000:00:1d.0     EHC2      S3    *enabled   pci:0000:00:1a.0     PCIB      S5    *disabled       RP02      S4    *disabled  pci:0000:00:1c.1     ECF0      S4    *disabled       RP03      S4    *disabled  pci:0000:00:1c.2     RP04      S5    *disabled  pci:0000:00:1c.3     WNIC      S5    *disabled  pci:0000:24:00.0     RP08      S4    *disabled  pci:0000:00:1c.7     HST1      S5    *disabled        Any ideas?


Esker ActiveX Plug-in for Firefox under Linux?

I have installed the windows version of Firefox with winetricks under Fedora, hurrah! I heard that there is an Esker ActiveX Plug-in for Firefox, but I can't find it. I need it for visiting a website that uses Active X and by default it's only working under IE6.. :D (but it works perfectly under windows if the Firefox has the IE TAB plug-in installed.) Where is the offical Esker ActiveX Plug-in for Firefox? It woud be a great help to have activex under Fedora... :\


How to asynchronously launch external program from cli and discard its output?

I'm writing a simple desktop initiation script which waits for disk idle, and then launches next external program (like Firefox, Skype or conky) using `&`, like:               ps cax | grep conky > /dev/null     if [ $? -eq 0 ]; then       echo "Conky is already running."     else       wait-for-disk-idle sda       conky &     fi      That's easy. The problem is that some programs spew a lot of debug output to the terminal, which gets mixed with the messages produced by my initialization script. **The question:** Is there any way to asynchronously launch an external program so that its standard output is discarded? What I already tried:   * `conky & >/dev/null 2>/dev/null`   * `bash -c conky &` * * * The correct answer:               bash -c "conky >/dev/null 2>/dev/null &"


Light-weight alternative to Apache

In my set-up, I run (as root) `ln -s ~/share /var/www`. By doing this, anyone on the local network will access the _~/share_ directory by pointing their browsers at http://hostname/share. I use `apache`, but I suspect that it's overkill (memory usage) for this simple use. What alternative light-weight web servers can I use for this? Will it also be tinker-free (in Debian, there's no extra set-up for `apache`, beyond installation)?


Install yum packages on a mounted volume

I have a Raspberry Pi with Pidora installed. I need to install a LAMP server. This is the scheme of the filesystem, with a mounted USB flash drive.               Filesystem      Size  Used Avail Use% Mounted on     /dev/root       2.1G  2.0G     0 100% /     devtmpfs        218M     0  218M   0% /dev     tmpfs           218M     0  218M   0% /dev/shm     tmpfs           218M  376K  218M   1% /run     tmpfs           218M     0  218M   0% /sys/fs/cgroup     tmpfs           218M  160K  218M   1% /tmp     /dev/sdb1       7.5G  1.7G  5.8G  23% /mnt/ExternalDrive     /dev/mmcblk0p5   50M   23M   27M  46% /boot      The `/` partition has no space left, so I figured I could mount a USB flash drive in order to install `mysql`, `apache`, `php` and my website files there.   * Is that the best way to go in this situation?   * If so, how can yum packages be installed on a mounted volume? Consider that reinstalling the OS is not feasible.


8086 emulator for unix-like OSs?

Is there any 8086 emulator (free or paid) for Fedora 17? I am learning assembly language using AT&T style.


Double line box_drawing characters in terminal

This piece of code in wikipedia:               $ char=( 6a 6b 6c 6d 6e 71 74 75 76 77 78 )     $ for i in ${char[*]}; do printf "0x$i \x$i \e(0\x$i\e(B\n"; done      includes one-line box-drawing characters. Are there double-line box-drawing characters in terminal? For example how can I print the character "╢". I'll use them in a C++ program like this:               #include <stdio.h>          int main()     {         printf("\e(0\x6a\e(B "); // 188         printf("\e(0\x6b\e(B "); // 187         printf("\e(0\x6c\e(B "); // 201         printf("\e(0\x6d\e(B "); // 200         printf("\e(0\x6e\e(B "); // 206         printf("\e(0\x71\e(B "); // 205         printf("\e(0\x74\e(B "); // 204         printf("\e(0\x75\e(B "); // 185         printf("\e(0\x76\e(B "); // 202         printf("\e(0\x77\e(B "); // 203         printf("\e(0\x78\e(B "); // 186     }


ubuntu winboot wubildr.mbr missing

I have installed Ubuntu 12.04 (64 bit) operating system, It supports uefi so I installed it like a normal dual booting Now(not like wubi), when I try to load Windows8 it works fine. But when I try to run ubuntu, I got the following error               ubuntu winboot wubildr.mbr missing      How to i fix the ubuntu boot-loading issue ? UPDATE: I have tried bootinfoscript in my lap this is the pastebin url http://paste.ubuntu.com/6073509/


System heating up since recent installations

Recently, after some operations on my machine, its temperature began to raise. Let's begin with some information. ### Machine caracteristics   * Sony VAIO SVE1511C5E laptop   * Intel Core i7   * 8Go RAM   * AMD Radeon graphics   * 500Gb hard drive ### Current system caracteristics   * Latest Arch Linux (3.10.10-1-ARCH)   * Working with Intel Integrated Graphics (supposedly, I'm not sure I did this configuration correctly). ### What I did until now... A few days ago, I decided it was be time to abandon the classic "Ubuntu/Windows 7" dual-boot, and switched to Arch Linux, which I've used for quite a long time on other machines.   * I started by shreding the hard drive, to make it "clean". One pass random, one pass with zeros (from sector 2048 to the end).   * I installed Arch Linux, everything went fine. But the problem occured after this. Back when I was under the Ubuntu/Windows 7 dual-boot, my computer's temperatures were reasonnable. I had sent the machine to Sony for repairs once (the fan was apparently broken), and since then, everything ran around 40/50°C (idle), and rarely reached 60/65°C during big tasks. Now that W7/Ubuntu disappeared, these temperatures are nothing but old memories.   * When doing nothing (idle), the machine stays around 60°C.   * When working harder, it reaches 75°C/80°C very quickly.   * I did not try the heaviest tasks such as running IDE's, compiling big programs, and so on. Right now, as I'm asking this question, `sensors` outputs :               acpitz-virtual-0     Adapter: Virtual device     temp1:        +58.0°C  (crit = +102.0°C)          coretemp-isa-0000     Adapter: ISA adapter     Physical id 0:  +61.0°C  (high = +87.0°C, crit = +105.0°C)     Core 0:         +61.0°C  (high = +87.0°C, crit = +105.0°C)     Core 1:         +58.0°C  (high = +87.0°C, crit = +105.0°C)     Core 2:         +57.0°C  (high = +87.0°C, crit = +105.0°C)     Core 3:         +55.0°C  (high = +87.0°C, crit = +105.0°C)          radeon-pci-0100     Adapter: PCI adapter          temp1:        +52.5°C      In order to "fix" this problem, I tried/did the following :   * I installed and configured `laptop-mode-tools` as suggested by the Arch community.   * I installed `cpupower` and set it to work under the `powersave` governor (CPU Frequency Scaling).   * I checked my BIOS for fan-related parameters, but there's none I can see.   * I _tried_ to work with Intel's graphics instead of using my AMD card, but I'm not even sure this worked (any way I could check it?)   * I _tried_ to use `fancontrol` and `pwmconfig` but apparently, there's not pwm-capable modules loaded. I couldn't succesfully load `it87`.   * I've set the ATI power profile to `low`.   * I've set the ATI power method to `profile`. After that, I decided to try other distributions, in case there would be a problem specific to Arch.   * OpenSUSE shows the same behaviour.   * Back to Ubuntu, same, even if I used it when dual-booting with W7 ! Having tried most of the things I know when it comes to high temperatures, I have to admit I've now run out of ideas... Is there anything I've missed, something I should try on my machine ? Something I've lost when I shreded my hard drive ? ## PowerTop results ### Overview Summary: 290.5 wakeups/second, 0.0 GPU ops/seconds, 0.0 VFS ops/sec and 6.8% CPU use                           Usage       Events/s    Category       Description             100.0%                      Device         Audio codec hwC0D0: Realtek              23.6 ms/s      50.7        Process        /usr/lib32/skype/skype               6.8 ms/s      51.2        Process        /usr/lib/chromium/chromium             413.2 µs/s      25.3        Process        [rcu_preempt]               7.6 ms/s      21.2        Process        /usr/lib/chromium/chromium --typ               0.9 ms/s      17.5        Timer          tick_sched_timer               7.0 ms/s      14.9        Process        /usr/bin/X -nolisten tcp :0 -aut             432.5 µs/s      15.2        Process        tint2             687.9 µs/s      15.4        Process        urxvt               1.8 ms/s      15.2        Interrupt      [6] tasklet(softirq)               4.3 ms/s       9.9        kWork          ath_hw_pll_work             323.9 µs/s       9.7        kWork          ieee80211_iface_work             321.6 µs/s       8.0        Process        /usr/bin/openbox --startup /usr/               1.0 ms/s       6.8        Timer          hrtimer_wakeup               3.1 µs/s       3.8        kWork          ieee80211_dynamic_ps_enable_wor               1.2 ms/s       2.1        Process        sensors               1.5 ms/s       1.9        Process        watch      ### Idle stats                           Package |             Core    |            CPU 0       CPU 1                         |                     | Actual    1.6 GHz     1.7 GHz     Idle        96.8%   | Idle        99.6%   | Idle        99.6%      100.0%     2.40 GHz     2.7%   | 2.60 GHz     0.0%   | 2.60 GHz     0.0%        0.0%     2.60 GHz     0.0%   | 2.50 GHz     0.0%   | 2.50 GHz     0.0%     2.50 GHz     0.0%   | 2.40 GHz     0.0%   | 1.60 GHz     0.1%     1.60 GHz     0.1%   | 1.60 GHz     0.1%   | 2.21 GHz     0.0%     2.21 GHz     0.1%   | 2.21 GHz     0.0%   | 2.40 GHz     0.0%     2.31 GHz     0.0%   | 2.31 GHz     0.0%   | 2.31 GHz     0.0%     1500 MHz     0.0%   | 1500 MHz     0.0%   | 1500 MHz     0.0%     1300 MHz     0.0%   | 1.80 GHz     0.3%   | 1.80 GHz     0.3%     1400 MHz     0.0%   |                     |                              |             Core    |            CPU 2       CPU 3                         |                     | Actual    1.8 GHz     1.7 GHz                         | Idle        99.9%   | Idle       100.0%      100.0%                         | 2.60 GHz     0.0%   | 2.60 GHz     0.0%        0.0%                         | 2.40 GHz     0.0%   | 2.40 GHz     0.0%        0.0%                         | 2.31 GHz     0.0%   | 1.60 GHz     0.0%        0.0%                         | 1500 MHz     0.0%   | 1.80 GHz     0.0%        0.0%                         | 1300 MHz     0.0%   |                          0.0%                         | 1400 MHz     0.0%   |                          0.0%                         | 1.60 GHz     0.0%   |                         | 1.80 GHz     0.0%   |                         |                     |                              |             Core    |            CPU 4       CPU 5                         |                     | Actual    1.9 GHz     2.2 GHz                         | Idle        99.9%   | Idle        99.9%      100.0%                         | 2.21 GHz     0.1%   | 2.21 GHz     0.1%        0.0%                         | 2.40 GHz     0.0%   | 2.40 GHz     0.0%                         | 2.10 GHz     0.0%   | 2.10 GHz     0.0%                         | 1.80 GHz     0.0%   | 1.80 GHz     0.0%                         |                     |                         |                     |                         |                     |                         |                     |                         |                     |                              |             Core    |            CPU 6       CPU 7                         |                     | Actual    2.3 GHz     2.0 GHz                         | Idle        97.3%   | Idle        97.3%      100.0%                         | 2.40 GHz     2.7%   | 2.40 GHz     2.7%        0.0%                         | 2.60 GHz     0.0%   |                          0.0%                         | 1.60 GHz     0.0%   |                          0.0%                         | 2.31 GHz     0.0%   |                          0.0%                         | 1300 MHz     0.0%   |                          0.0%                         | 1500 MHz     0.0%   |                          0.0%                     | 1.71 GHz     0.4%   | 2.40 GHz     0.0%        0.0%                         | 2.40 GHz     0.0%   | 2.60 GHz     0.1%        0.1%                         | 2.60 GHz     0.1%   | 3.10 GHz     0.0%        0.0%                         | 2.71 GHz     0.0%   | 2.81 GHz     0.0%        0.0%                         | 2.81 GHz     0.0%   | 1400 MHz     0.0%                         | 1400 MHz     0.1%   | 1300 MHz     0.0%                         | 1300 MHz     0.0%   | 2.10 GHz     0.1%                         | 2.10 GHz     0.1%   |                         |                     |                              |             Core    |            CPU 4       CPU 5                         |                     | Actual    1.8 GHz     1.8 GHz                         | Idle        97.8%   | Idle        98.5%       99.3%                         | 3.10 GHz     0.0%   | 3.10 GHz     0.0%        0.0%                         | 3.00 GHz     0.0%   | 3.00 GHz     0.0%        0.0%                         | 2.21 GHz     0.0%   | 2.21 GHz     0.0%        0.0%                         | 2.31 GHz     0.0%   | 2.31 GHz     0.0%        0.3%                         | 1.60 GHz     0.1%   | 1.60 GHz     0.1%        0.0%                         | 1.91 GHz     0.4%   | 2.00 GHz     0.2%        0.0%                         | 2.00 GHz     0.2%   | 1300 MHz     0.0%        0.0%                         | 1300 MHz     0.0%   | 1400 MHz     0.0%        0.0%                         | 1400 MHz     0.0%   | 2.90 GHz     0.0%        0.2%                         | 2.90 GHz     0.0%   | 2.10 GHz     0.0%        0.0%                         | 2.10 GHz     0.1%   | 2.60 GHz     0.0%        0.1%                         | 2.60 GHz     0.0%   | 1.71 GHz     0.3%        0.1%                         | 1.71 GHz     0.5%   | 1.80 GHz     0.7%        0.0%                         | 1.80 GHz     0.8%   | 1.91 GHz     0.1%        0.0%                         | 1500 MHz     0.1%   | 2.40 GHz     0.0%        0.0%                         | 2.40 GHz     0.0%   | 2.50 GHz     0.0%        0.0%                         | 2.50 GHz     0.0%   | 2.71 GHz     0.0%        0.0%                         | 2.71 GHz     0.0%   | 2.81 GHz     0.0%        0.0%                         | 2.81 GHz     0.0%   | 1500 MHz     0.0%                         | 1200 MHz     0.0%   |                              |             Core    |            CPU 6       CPU 7                         |                     | Actual    1.8 GHz     1.8 GHz                         | Idle        99.0%   | Idle        99.1%       99.8%                         | 3.10 GHz     0.0%   | 3.10 GHz     0.0%        0.0%                         | 2.21 GHz     0.0%   | 2.00 GHz     0.1%        0.0%                         | 2.31 GHz     0.0%   | 2.90 GHz     0.0%        0.0%                         | 2.00 GHz     0.1%   | 2.10 GHz     0.0%        0.0%                         | 1.91 GHz     0.1%   | 2.60 GHz     0.0%        0.0%                         | 1.60 GHz     0.1%   | 2.50 GHz     0.0%        0.0%                         | 2.90 GHz     0.0%   | 1.60 GHz     0.1%        0.0%                         | 2.10 GHz     0.0%   | 1.71 GHz     0.1%        0.1%                         | 2.60 GHz     0.0%   | 1400 MHz     0.0%        0.0%                         | 2.50 GHz     0.0%   | 1500 MHz     0.1%        0.0%      ### Frequency stats                         Package   |             Core    |            CPU 0       CPU 1                         |                     | C0 active   0.4%        0.0%                         |                     | POLL        0.0%    0.0 ms  0.0%    0.0 ms                         |                     | C1E-IVB     0.0%    0.0 ms  2.6%    6.6 ms     C2 (pc2)    0.9%    |                     |     C3 (pc3)    0.1%    | C3 (cc3)    0.0%    | C3-IVB      0.1%    0.1 ms  0.0%    0.0 ms     C6 (pc6)    1.0%    | C6 (cc6)    0.0%    | C6-IVB      0.0%    0.0 ms  0.0%    0.0 ms     C7 (pc7)   91.5%    | C7 (cc7)   96.9%    | C7-IVB     98.7%   39.9 ms 97.4%  246.1 ms                              |             Core    |            CPU 2       CPU 3                         |                     | C0 active   0.1%        0.1%                         |                     | POLL        0.0%    0.0 ms  0.0%    0.0 ms                         |                     | C1E-IVB     0.1%    0.3 ms  0.9%    1.8 ms                         |                     |                         | C3 (cc3)    1.6%    | C3-IVB      1.6%    2.7 ms  0.0%    0.0 ms                         | C6 (cc6)    0.0%    | C6-IVB      0.0%    0.0 ms  0.0%    0.0 ms                         | C7 (cc7)   97.4%    | C7-IVB     97.4%   49.2 ms 99.1%   91.0 ms                              |             Core    |            CPU 4       CPU 5                         |                     | C0 active   0.1%        0.0%                         |                     | POLL        0.0%    0.0 ms  0.0%    0.0 ms                         |                     | C1E-IVB     0.1%    0.5 ms  0.0%    0.0 ms                         |                     |                         | C3 (cc3)    0.0%    | C3-IVB      0.0%    0.0 ms  0.0%    0.0 ms                         | C6 (cc6)    0.0%    | C6-IVB      0.0%    0.0 ms  0.0%    0.0 ms                         | C7 (cc7)   99.5%    | C7-IVB     99.4%   71.8 ms100.1%  144.5 ms                              |             Core    |            CPU 6       CPU 7                         |                     | C0 active   3.1%        0.1%                         |                     | POLL        0.0%    0.0 ms  0.0%    0.0 ms                         |                     | C1E-IVB     0.2%    0.2 ms  0.0%    0.0 ms                         |                     |                         | C3 (cc3)    0.1%    | C3-IVB      0.1%    0.2 ms  0.0%    0.0 ms                         | C6 (cc6)    0.0%    | C6-IVB      0.0%    0.0 ms  0.0%    0.0 ms                         | C7 (cc7)   96.7%    | C7-IVB     96.8%   22.2 ms 99.9%  144.2 ms      ### Device stats               Usage     Device name     6.9%        CPU misc     6.9%        CPU core     100.0%        Audio codec hwC0D0: Realtek     100.0%        Display backlight     99.6%        Display backlight     0.0 ops/s   GPU core     0.0 ops/s   GPU misc     100.0%        USB device: EHCI Host Controller     100.0%        USB device: EHCI Host Controller     100.0%        USB device: xHCI Host Controller     100.0%        USB device: xHCI Host Controller     100.0%        Radio device: btusb     100.0%        Radio device: ath9k     100.0%        Radio device: Sony Notebook Control Driver     100.0%        Radio device: Sony Notebook Control Driver     100.0%        USB device: USB2.0 Camera (LOEA11P2BF13827W01781)     100.0%        USB device: Bluetooth USB Host Controller (Atheros Communicat     100.0%        PCI Device: Intel Corporation 7 Series/C210 Series Chipset      (most tunable items are set to Good, except USB suspension. Changes don't go further than +/- 2°C)


How to get larger thumbnails in dolphin

How can I increase the maximal size (when enlarging them with `Ctrl` `+`) and resolution of thumbnails in dolphin? If not, is there any other file manager which supports larger thumbnails than dolphin to preview pdf's and djvu's?


Getting stdin from a named pipe

What I am trying to do is run python in a terminal window and redirect it's stdin from a named pipe. Then I write to the named pipe in another terminal and have that command execute on python. Terminal 1:               mkfifo p1     python < p1      Terminal 2:               echo -n "print \"Hello World\"" > p1      What happens is - python prints `Hello World` and exits. What I want to do is keep python running to take a next command. How do I do this in the shell?


Auto-restart an process when it crashes

I have an app that I need to autostart when the OS starts. I am running in a CentOS 6, so I am using a LSB init script placed in `/etc/init.d`. So far this is fine and working. Now....besides that, what I would like is that if my app crashes (exits with error), I want that it automatically starts again. Ideally, even defining a max number of tries. In Mac's Info.plist there are the keys `KeepAlive` Since I already have `chkconfig` working, I was wondering if there is something I could do with it. I know there is http://mmonit.com/monit/ but it may be too much for what I need.


How to get the hostname along with the domain name?

In unix (Solaris) is there any command that returns the hostname and domain name together? For instance:               hostname -> servername     domainname -> us.xyz.com      I need : `servername.us.xyz.com`


Launchy: Hot keys won't work in xmonad

OS:Arch Linux Tiling manager: xmonad with unagi I installed the package launchy and I managed to set the hot key to `CTRL`+`ALT`+`Z` (it's the only program that uses this hotkey). However nothing, happens if I press `CTRL`+`ALT`+`Z`. Also dmenu works without trouble. What is the problem?


how to setup virtual box guest additions (drivers) on systemd system (exherbo)

The trouble is when I run ./VBoxLinuxA... I'm getting: **Unable to determine your Linux distribution** so there is build in script :               check_system_type() {         if [ ! "$ro_SYS_TYPE" = "" ]; then             return 0         elif [ -f /etc/debian_version ]; then             ro_SYS_TYPE=debian             ro_INIT_TYPE=sysv         elif [ -f /etc/gentoo-release ]; then             ro_SYS_TYPE=gentoo             ro_INIT_TYPE=sysv         elif [ -x /sbin/chkconfig ]; then             ro_SYS_TYPE=redhat             ro_INIT_TYPE=sysv         elif [ -x /sbin/insserv ]; then             ro_SYS_TYPE=suse             ro_INIT_TYPE=sysv         elif [ -f /etc/lfs-release -a -d /etc/rc.d/init.d ]; then             ro_SYS_TYPE=lfs             ro_INIT_TYPE=lfs         elif [ -f /etc/pardus-release ]; then             ro_SYS_TYPE=pardus             ro_INIT_TYPE=pardus         elif [ -f /etc/rc.d/rc.local ]; then             ro_SYS_TYPE=unknown             ro_INIT_TYPE=bsd             ro_RC_LOCAL=/etc/rc.d/rc.local         elif [ -f /etc/rc.local ]; then             ro_SYS_TYPE=unknown             ro_INIT_TYPE=bsd             ro_RC_LOCAL=/etc/rc.local         elif [ -d /etc/init.d ]; then             ro_SYS_TYPE=unknown             ro_INIT_TYPE=sysv         else  # Perhaps we can determine what we need to know anyway though?             echo 1>&2 "Unable to determine your Linux distribution"             log "Unable to determine the Linux distribution"             return 1         fi         return 0     }      And I'm confused what can I chose here. I'm using systemd I've tried to create various files but it still being wrong for me :( How to install it for systemd? (fedora installs it somehow) Add: seems like fedora had sysv-compatibility enabled in systemd and vbox don't support systemd. So I just need this hacky way to get drivers.


Fedora 14 command line: assign folder permissions

How can I assign folder permissions in Fedora 14 using the command line? I'd like to give read/write/execute permissions to :   * 2 users (tom, jim) to the folder /Home/Share   * 1 group (employees) to the folder /Home/Share/Employees However, I'm not sure how to do this properly from a shell.


KSH styling text based menu  using STDERR

Is it possible to format the STDERR in order to have a better looking menu using the select command? I have a simple select                   select oChoice in $(<tempMenu.menu) ; do             case "$oChoice" in               *)                 break               ;;           esac        done      I've tried a trick like:                   exec 3>&1         select ...         ...         done 2>&1 1>&3 | sed 's/^/NICE OUTPUT    /'      But I cannot use escape sequences (i.e. colors), for example                  ...        done 22>&1 1>&3 | sed 's/^/\033[1;33m\033[44mNICE OUTPUT    /'        or        done 22>&1 1>&3 | sed 's/^/\\033[1;33m\\033[44mNICE OUTPUT    /'      The escape sequences are not escaped and also the STDOUT is altered because I have customized the PS3 as well.               PS3="$(print \\n\\r)# $(print "\\033[1;33m\\033[44m")"$QUESTION"$(print "\\033[0m\\033[1;1m\\033[44m") `tput sc` $(print "")     #$(print "")     # $(print "")     # Status: $status $(print "")     # $(print "")     #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~  `tput rc` "      As far as I understand (Show only stderr on screen but write both stdout and stderr to file) I cannot separate the STDERR from the STDOUT, so, is there a smarter way to create dynamic text-based menus just using the STDOUT? (or an otherway to workaround my issue)


fetchmail to log complete messages AND pass to mda

I couldn't seem to tell from the `fetchmail` man page or http://www.catb.org/~esr/fetchmail/fetchmail-man.html#7 whether `--bsmtp <filename>.bsmtp.log`, applied from cli/cronjob, and `--mda <command>` applied from varying _fetchmailrc_ config files are mutually exclusive. I am hoping not as I am trying to keep a "filename.bsmtp.log" for failover purposes on dedicated machine-email accounts, among all other fetchmail parameters to limit which messages are retrieved and how/if they are left on the IMAP server. Most of the messages the mda simply tosses so it is hard to tell if they've been seen or not properly by the mda. It is custom built and designed to exit immediately with no reading** under certain conditions, for example in the presence of certain other processes on the appliance. If they are mutually exclusive, is there another way to log everything similar to --bsmtp, in fetchmail, without altering the custom built mda? **Deliberately putting the responsibility back on `fetchmail` to not dismiss that message as read. Experimentally confirmed when the mda's _stdin_ was not read until _EOF_ before exiting


How to capture images transferred via HTTP?

I have multiple browsers and I want save all images with size more than 30KB and save to specified address. What is best way?   * listen to `tcpdump` and read the content, and then save to a file, or   * use something like `squid` I think `tcpdump` is better but I don't know how to find out whether the content is an image and of what size (and other attributes) to save it in a file.


'Open .bash_profile' conflict on Ubuntu

I want to edit `.bash_profile` on my Ubuntu system. When I try to run the command `open .bash_profile`, it gives this message:               Couldn't get a file descriptor referring to the console      Please help me get around this problem and edit the file.


Imagemagick -quality 85 doesn't work

I run `mogrify` to compress a JPEG image to 85% quality:               $ ls -lah Screenshot.jpg     -rw-rw-r--.  1 USER GROUP 440K May 24 12:10 Screenshot.jpg     $ mogrify -compress JPEG Screenshot.jpg -quality 85     $ ls -lah Screenshot.jpg     -rw-rw-r--.  1 USER GROUP 441K May 24 12:10 Screenshot.jpg      The size doesn't shrink. Yet if I open the image in Gimp and save at 85% quality, the size does shrink:               ls -lah Screenshot.jpg     -rw-rw-r--.  1 USER GROUP 135K May 24 12:11 Screenshot.jpg      Why doesn't ImageMagick compress the JPEG image to 85%? I'm using ImageMagick-6.6.4.1-15.fc14.i686 on Fedora.


How to turn off a USB drive when samba is not using it [Raspberry PI]

I have a backup server on a Raspberry Pi using samba with 2x 2TB drives for storage. To reduce noise and drive degradation I'd like to turn them off when I'm not transferring files. I tried to unmount it but the disck kept spinning. I also tried "echo suspend > /sys/bus/usb/devices/usb1/power/level - error "no such file or directory".


I don't have a /dev/dsa yet I have audio!

I was hacking around and hoping to direct some random data using pipes at /dev/dsa as follows                 cat random.file > /dev/dsa      ...to get some random noise, but I can't manage to find an audio device. I have looked all around the dev folder, there is nothing called /dev/mixer or /dev/audio. I am running Ubuntu 11.04 on an Eeepc 1001p.


Does the position of partition on disk affect speed?

If I put `/var` as first partition, then `/home` and `/`, will the partition for `/var` have better performance than if I put other partitions close to head of the disk? Will the disk sector position matter? I heard some people saying that I should put swap closer to the head of a partition to get higher performance.


Reverse control-code look up for terminals

My understanding is that terminals often use ANSI control-codes to represent non-alphanumeric character sequences. For example, when editing `.inputrc` for Bash in Linux, it's easy to find code sequences that look as follows:               "\e[A": history-search-backward     "\e[B": history-search-forward     "\e[C": forward-char     "\e[D": backward-char     "\e[1~": beginning-of-line     "\e[4~": end-of-line     "\e[3~": delete-char     "\e[2~": quoted-insert     "\e[5C": forward-word     "\e[5D": backward-word      The commands above define key bindings for the Bash commands `history-search- backward`, etc.. Now, in bash, I can use `read` to see how characters typed in my keyboard are mapped to ANSI control codes. E.g. For example, if I run `read`, and then enter `Ctrl-P`, I get: `^P`. Similarly, if I enter `Alt-W`, I get: `^[W`. My question is: Is there a program, tool or website that does the opposite? I.e. a tool that outputs or shows the sequence of keyboard keys that I need to type on my keyboard to obtain a given ANSI control-code sequence. For example, entering `^[W` should output: `Alt-W` Thanks!


How do I remove certain lines (using line numbers) in a file?

There are specific lines that I want to remove from a file. Let's say it's line 20-37 and then line 45. How would I do that without specifying the content of those lines?


e2fsck not working

I am using Linux slitaz on my machine. I am able to see drives on the left side of the screen but when I click the drives it is giving the error cannot open the drive. When I ran the `e2fsck` on that partition I am getting an error. I used the following command to run `e2fsck`:               e2fsck -y -f -V /dev/hda3      and this gives the following error:               error:     e2fsck: Attempt to read block from filesystem resulted in short read while trying to open /dev/hda3     Could this be a zero-length partition?      How can I resolve this? when i did fdisk -l, i got this               Disk /dev/hda: 80.0 GB, 80026361856 bytes     255 heads, 63 sectors/track, 9729 cylinders     Units = cylinders of 16065 * 512 = 8225280 bytes             Device Boot      Start         End      Blocks  Id System     /dev/hda1               1        2550    20482843+ 83 Linux     /dev/hda2            2551        2615      522112+ 82 Linux swap     /dev/hda3            2616        6439    30716280  83 Linux     /dev/hda4            6440        9729    26426925  83 Linux


Ubuntu vs Debian for server

What would be a better choice for a web server, Debian or Ubuntu? I mainly use Python & PostgreSQL with Nginx and sometimes PHP & MySQL. What are pros/cons of each?


Print folders names character count

I am trying to use `find . -type d -print | wc -m` where `-m` or `--chars` would print the character counts of the folder names. Take following screen shot as example, the character count for **tempFolder** \+ **tempFolder** \+ **dingdongFolder** is only **34** , and event counting the slashes and dots is still **40**. Why the command print out **43** characters? Where are the 3 extra characters come from? ![enter image description here](http://i.stack.imgur.com/dRgin.png)


Progress bar in updatedb

Is it possible to get a reliable progress bar (or just a reliable information how long it will take) when doing `updatedb`?


Using Ctrl+B in less within tmux

I use the `Ctrl+B` command prefix in `tmux`, however this clashes with `Ctrl+B` in `less`, which is used for scrolling up a file. How can I get this to work? Do I have to set a different command prefix in `tmux`? I really don't want to have to learn new key bindings if I can avoid it.


How do I get back to X?

I pressed some key combination and got a big full screen black terminal screen with a login prompt. After logging in, I tried startx to get the UI back, but got a message               Fatal server error:     Server is already active for display 0     If this server is no longer running, remove /tmp/.X0-lock and start again.      So - what did I do to get me the black prompt in the first place, and how do I get back to X?


Can htmldoc create multi-level pdf bookmarks?

I downloaded an online html book (http://www.cim.mcgill.ca/~franco/OpSys-304-427/lecture-notes/lecture- notes.html), by the following command               wget -r -np  -nH --cut-dirs=3 -p -k http://www.cim.mcgill.ca/~franco/OpSys-304-427/lecture-notes/lecture-notes.html       Then I tried to convert it to pdf using htmldoc. My command is:               htmldoc --webpage -f 1.pdf lecture-notes.html node1.html node2.html ... node69.html      The resulting PDF file has bookmarks for its table of content shown in `lecture-notes.html`, but the bookmarks are just one-level. The table of content shown in `lecture-notes.html` is multilevel however, indicated in HTML source code by `<UL>` and `</UL>` pairs. Another example is http://www.unknownroad.com/rtfm/gdbtut/, which uses a different way to represent multi-level table of content in its HTML source code. Can `htmldoc` create multilevel bookmarks for table of content?


keyboard and mouse not working in QEMU

I'm trying to run a Linaro Beagleboard image under Qemu and I have trouble with the keyboard and mouse. Basically neither the keyboard nor the mouse work once the boot process completes. I tried two types of images, one with a full Ubuntu desktop and the other with just a minimal filesystem. Both of them boot OK but then I cannot interact in any way with the virtualized system; for the minimal image I get to the login prompt, it auto-logins as root but then I cannot do anything(it's very, very frustrating). I've tried starting both from the command line and from Qemulator GUI but with the same outcome. What could be the problem? The Qemu command line follows:               qemu-system-arm -M beaglexm -m 256 -sd /home/mac/work/qemu_images/beagle-nano.img      -k en-us -append "console=ttyS0" -serial stdio -usb      -hda /home/mac/work/qemu_images/beagle-nano.img      -localtime -net nic,vlan=1 -net user,vlan=1,hostname=beagle_nano      -kernel /home/mac/work/qemu_images/vmlinuz-3.0.0-1002-linaro-omap      -initrd /home/mac/work/qemu_images/initrd.img-3.0.0-1002-linaro-omap      I also tried without the direct boot which uses the kernel and the initial ramdisk images, but still no luck.


How to kill a command started over SSH - the SSH connection lost

If I use               timeout 10 ssh -n -o BatchMode=yes 1.1.1.1 'sleep 20' > 1.1.1.1.txt 2>&1 &      To give out a remote command on a server, and I kill the SSH connection after 10 seconds, then I can see that the `sleep 20` is still running on the server, but there is no SSH connection. How can I kill the remote command after a timeout, say 10 seconds? The remote machine is AIX 6.1 (or SLES) and no package is available for "timeout". My client is Ubuntu 10.03.


POSIX compliant way to work with a list of filenames possibly with whitespace

I have seen Bash scripting guides suggesting the use of array for working with filenames containing whitespace. DashAsBinSh however suggests that arrays are not portable so I am looking for a POSIX compliant way of working with lists of filenames that may contain whitespace. I am looking to modify the below example script so that it would `echo`               foo/target/a.jar     foo/target/b.jar     bar/target/lol whitespace.jar      Here is the script               #!/usr/bin/env sh          INPUT="foo/target/a.jar     foo/target/b.jar     bar/target/b.jar     bar/target/lol whitespace.jar"     # this would be produced by a 'ls' command     # We can execute the ls within the script, if it helps          dostuffwith() { echo $1; };          F_LOCATIONS=$INPUT     ALL_FILES=$(for f in $F_LOCATIONS; do echo `basename $f`; done)     ALL_FILES=$(echo "$ALL_FILES" | sort | uniq)          for f in $ALL_FILES     do         fpath=$(echo "$F_LOCATIONS" | grep -m1 $f)         dostuffwith $fpath     done


Recommended live distro with persistent USB storage and Compiz

I need a distro that matches these specifications:   * runs from USB   * has persistence (saves sessions and data like a regular OS)   * controls on top (as in, the Mac toolbar - I'm still new to Linux, I don't know the difference between desktops yet)    * I'd like it to run Compiz - those effects look awesome   * Compatible with a lot of machines, right off the bat


fstrim and iostat

I have a new samsung ssd in my new notebook. I tuned up everything to avoid writings in the disk (firefox profiles and `/var/log` in memory), I'm using a `ext4` fs with `relatime` and I use `fstrim` once a day to TRIM my ssd. I monitor disk load with `iostat -dhm`. Before running `fstrim` the command `iostat` shown               Device:            tps    MB_read/s    MB_wrtn/s    MB_read    MB_wrtn     sda                   4.97         0.05         0.59       1856      20924      after trimming `/home`               # fstrim -v /home     /home: 100.2 GiB (107555401728 bytes) trimmed      `ìostat` shows               Device:            tps    MB_read/s    MB_wrtn/s    MB_read    MB_wrtn     sda                   5.91         0.05         3.51       1859     123498      `MB_wrtn` increased `102574 MB`. Does that mean `fstrim` is writing `102574 MB = 100.2 GB` to my disk ? Trim is supposed to "mark" the pages that do not contain valid data, not writing them. I guess `iostat` saw the operation made by `fstrim` as writing (even if _it is not_ a writing). What do you think? Is there a better way to monitor my disk? Note: Using `iotop` is not an answer, because it doesn't show the amount of data of processes that were killed. Thus, `iotop` measurement is inexact.


Adding to PS1 in bash_profile

In my `.bash_profile` currently, I have `PS1='\[\e[1;91m\][\u@\h \w]\$\[\e[0m\] '`. I am trying to follow these commands to show branch name on iTerm terminal. I changed my               PS1='\[\e[1;91m\][\u@\h \w]\[\e[0m\][\033[32m\]\$(parse_git_branch)\[\033[00m\]$'      and the method at the end of the file               parse_git_branch() {         git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/'     }      which shows now as:               [ava@GM12673 ~/blog][$(parse_git_branch) $      How to correctly add something to `PS1`?


Lock all devices when adjusting pulseaudio volume in kmix

My problem is that kmix adjusts the volumes of not all devices locked together. Adjusting built-in analog stereo also adjusts application's equalized stream and ALSA plugin. But webcam and event sounds are not locked and have to be adjusted separately. Also, when I strart an aplications, master can be at the middle, but the app volume is at maximum, so lowering it by hotkey lowers master from it's relative position. For example "Built-In analog stereo" was at level 50% with "Unknown application" Now I dolphin calls system sound on "delete". It plays very loud and when I open the kmix window - "Built-In analog stereo" now at 100% but other apps are where they were. By lowering "Built-In analog stereo" apps are getting lowered by the same amount (for example, ALSA plugin was 50% and is lowered with Built-In analog to 10% when analog was lwered from 100% to 60%). I want kmix (or "built-in analog stereo" which is master right now) to to adjust one system-wide volume regardless whether are these pulseaudio devices or other. ![screenshot](http://i.stack.imgur.com/F1fz8.png)