laszlo.nu

How to kill an unresponsive ssh session

I often find myself in the somewhat cumbersome situation that a currently running ssh session stops responding, often due to a lost connection. The normal ctrl+c of course doesn’t work, the ssh client catches all the usual commands, which is very handy while you are still connected to the host but not very handy at all in this case.

My usual approach has been to switch to another terminal window or shell and then killing the process in question. Today I happened to be skimming through the ssh client’s man page and I found a section about escape characters. Suddenly I gazed upon the glory of the disconnect key sequence: a newline followed by ~.. It works like a charm. As always, I thought I should share.

How to rebuild all your packages from source in Arch Linux - Gentoo style

One of the things I liked about Gentoo when I tried it out some year ago was that you were able to build software packages directly from source. It might seem like overkill but if you want full control over your system you might find this useful, or perhaps only amusing. :) I decided I wanted to try this in Arch Linux using a feature of the Yaourt package manager.

You won’t gain anything by simply recompiling all packages though, since the default optimization flags are probably already used by the people that makes the binary packages. You need to edit the /etc/makepkg.conf file, specifically the CFLAGS and CXXFLAGS variables. Optimizing and compiling stuff is a science all by itself but the most important is the -march flag. If you’re a noob just like me, you might want to read the Gentoo docs about optimization.

If you haven’t already done so, you need to install Yaourt. It is a really good package manager, a pacman on steroids really (heh-heh). More specifically, you need the package yaourt-abs. Abs contains only packages from the Arch Linux developers but the support for abs in the default yaourt package didn’t work for me so I had no sources to work with. If you already got yaourt installed, it’s really easy to install the abs fork:

yaourt -S yaourt-abs

When you have got yaourt-abs, all you need to do is this:

yaourt -Syb --noconfirm $(pacman -Q | cut -f 1 -d " ")
This might take a week or so — seriously. And the performance increase might not be very impressive. Depending on what optimization parameters you chose you might even end up with a very unstable system or with binaries bigger than before (speed at the cost of size), it’s all up to you. You have been warned. Enjoy!