Category Archives: Linux

Speed up SSH X11 forwarding

I use an Ubuntu server as a work-horse for my calculations and connect from my desktop-pc with ssh to the server. For some applications (gnuplot =) this is really slow altough it’s over LAN. I found on the internet some instructions to improve this situation: instead of the AES cipher the arcfour and blowfish ciphers perform much better and switching on compression also doesn’t hurt. Therefore one should use

ssh -c arcfour,blowfish-cbc -XC

to connect to with ssh. And guess what? This really improves the situation, especially for gnuplot. Thanks Samat!

Same swap partition mounted twice (Ubuntu Feisty)

Yesterday I wrote that my swap partition suddenly vanished, only to find out that suddenly my swap partition was mounted twice. “top” showed twice the amount of swap space available and “cat /proc/swaps” listed two entries to the same swap partition (/dev/sda6 and /dev/mapper/sda6). This seems to be a bug in Ubuntu Feisty and the (temporary) solution is to change the “/etc/fstab”. You’ll find a line “UUID=Your_UUID none            swap    sw”. Replace “UUID=..” with the correct device, e.g. “/dev/sda6”. After a reboot the swap partition should only be mounted once (“cat /proc/swaps”). The system boots now faster btw, sometime it hung during the startup.

Suddenly my swap drive was missing

When checking ‘top’ after I was told that I have no memory anymore I found out that I had no swap drive anymore. Must have gone lost when I switched to Ubuntu Feisty. Anyway, I found a description to re-initiate the swap drive:

  • First find out which partition your swap drive is, e.g. with ‘sudo fdisk -l /dev/sda’ (the important line is ‘/dev/sda6 8391 8645 2048256 82 Linux swap / Solaris’)
  • sudo mkswap /dev/sda6 – a new UUID will be created and printed on the screen (e.g. ‘no label, UUID=16ef6e6c-dd7e-4efd-bacd-8718ebeac568’)
  • create a link in /dev/disks/by-uuid: ‘cd /dev/disks/by-uuid’ and ‘sudo ln -s ../../mapper/sda6 /dev/disk/by-uuid/Your-UUID’
  • sudo swapon -va
  • sudo gedit /etc/fstab and set the correct UUID in the line ‘UUID=Your-UUID none swap sw 0 0’

To keep swap intact after hibernation additionally you need

  • sudo gedit /etc/initramfs-tools/conf.d/resume and add the line ‘RESUME=UUID=Your-UUID’
  • sudo update-initramfs -u

mdadm trouble on Ubuntu Feisty

I kept getting these error message during the boot process and also after issuing the command ‘sudo update-initramfs -u’:

W: mdadm: unchecked configuration file: /etc/mdadm/mdadm.conf
W: mdadm: please read /usr/share/doc/mdadm/README.upgrading-2.5.3.gz .
W: mdadm: no arrays defined in configuration file.
W: mdadm: falling back to emergency procedure in initramfs.

The mdadm-package is needed for software raid array. If you don’t have a raid array you can solve this problem simply by removing the mdadm package: ‘sudo apt-get remove mdadm’. More information is at

How to remove programs installed from source in Linux

Though you can usually install most programs in Linux comfortably with the package manager of you Linux distribution (rpm, deb, etc.), sometimes you need to compile something from source.

For example gnuplot in Debian/Ubuntu has the readline functionality not compiled in, which makes it rather hard to use. But I’m somewhat reluctant to install these programs with “make install” since they are somewhere copied into system and it’s practically not possible to remove them except with “make uninstall” – but this option is not always available and you have to keep the sources of the program you installed.

But don’t renounce yet. There is paco. This little gem allows one to log the “make install” process. paco is than able to remove all installed files if one decides so. Installing paco is easy.

  • Download and untar it somewhere, cd into new directory
  • sudo apt-get install libgtk2.0-dev (if you don’t have gtk devel installed) or sudo apt-get install libgtkmm-2.4-dev (if you install paco 2.0 or newer)
  • ./configure --prefix=/usr/local
  • make
  • sudo make install
  • sudo make logme

paco is now installed, paco itself is also logged in its database. If you want now to install something if it should be logged with the name of the current directory as the name for the package replace the last “make install” command with

sudo paco -lD make install

to set the name of the package yourself, use

sudo paco -lp foo-1.0 "make -C src install"

In order to see what packages are installed or to remove a package use sudo gpaco.

X11 forwarding with OpenSSH on bare Ubuntu Server Edition

I installed today Ubuntu Server Edition 7.04 on one of my machines and here practically nothing is installed. Therefore for example X11 forwarding doesn’t work if you remotely log in with “ssh -X” (after you installed openssh-server :). So, if you start a X11 program you get e.g.:

xterm Xt error: Can’t open display:
xterm: DISPLAY is not set

I found the solution here. You need to install the program xauth with

sudo apt-get install xauth

and off you go.