kvm nfs hang
I ran into a strange NFS + KVM issue. Every so often under heavy NFS load my KVM client would hang retrying the nfs server. On the console the client was showing: nfs: server host not responding, still trying I found this bug post which does not seem to have been resolved in 2.6.24. Using the kvm flag -net nic,model=rtl8139 fixed the problem for me.
screen -c relative path bug
I must have recently upgraded to a new screen. My screenrc file was using the chdir directive so that the windows started inside would have a PWD I wanted them to. As soon as I tried to reconnect the screen session would die. screen -x Unable to open "screenrc" I was able to find the bug on savannah that described the symptom quite well. I then wrote a wrapper zsh function which fixes the problem:
WeeChat spell suggestions
I recently decided to give WeeChat a try. I found that it had a nice new feel and less complicated windowing structure then irssi – at least more intuitive to a vim user. Here is my weechat config. On debian you can install it with apt-get install weechat-curses weechat-scripts weechat-plugins I really liked the spell-checking plugin which uses aspell to highlight misspelled words as I type them. One thing I missed was the ability to tab complete words from the /usr/share/words list. So I wrote a short lua script to do it…
show current git branch in zsh
NOTE: This post has been [updated]{zsh-git-branch2}. Earlier today I saw a blog post titled “Git in your prompt” which showed how to get the current git branch to display in zsh and bash. I tried it on my setup and found it really slow, probably due having $HOME on NFS or having big git repos or maybe not enough ram. Anyway, after looking at some zsh docs and blog posts, I had added caching to the idea. Now the git-branch is only queried on a directory change or on a command that matches *git*.
wmiirc-lua kitchen sink repository
[wmiirc-lua]{tag/wmiirc-lua} is a replacement for sh-based wmiirc that ships with the wmii window manager. I have had some issues with the libixp and wmii packages under Debian. Particularly the problem is caused by the fact that libixp (and wmii use of the library) changes often but do not have any way to detect subtle changes in the API from the sources. I decided to track everything in a kitchen sink repository that will include all the sources that need to be versioned and released together. That way what you try is the same thing I tried. Currently this includes libixp imported from mercurial wmii imported from mercurial wmiirc-lua This of course uses magic [git]{tag/git} powers; or more specifically git submodules. To follow along you will need git 1.5.3 or newer.
protecting sshd from OOM killer
When Linux runs low on memory it tries to kill off applications that may be responsible for the high memory usage. It sometimes gets is all wrong, so the kernel has a way to tell it which processes are to be treated differently by the OOM killer. I am using ssh to run some stress tests. Occasionally they cause memory to run out, and when I am not paying attention sshd is killed off… which means I cannot turn off the tests.
wmiirc-lua v0.2.1 remembers a bit more
[wmiirc-lua]{tags/wmiirc-lua} is a replacement for sh-based wmiirc that ships with the wmii window manager. In version 0.2.1 wmii will remember the last few programs that have been ran and the last few actions taken. It will put those entries at the beginning of the completion list. Frequent items can thus be selected with arrow keys and pushing enter. In this release selecting works spaces with Mod4-[a-z] will not select the first view that starts with that letter, but rather the most recently used view that starts with the letter. There have also been a few bug fixes, notably the core will now look in ~/.wmii-3.5 for plugins and core libraries before looking in system directories. That will solve the problem of someone using make install-user while having an older .deb installed.
wmiirc-lua v0.2 has suspend and raw modes
[wmiirc-lua]{tags/wmiirc-lua} is a replacement for sh-based wmiirc that ships with the wmii window manager. The big improvement in version 0.2 is the client tracking support; this enables raw and suspend modes… in raw mode the wmii key-bindings are ignored and all input is passed to the application. in suspend mode, the process that created a particular window will be sent the STOP signal when the window is not in focus. I wrote this with firefox in mind; even when idle and off-screen my firefox gets woken up 100 times per second. There were also several bug fixes in this release. You will still need to build libixp and wmii from hg [as detained here]{wmiirc-in-lua-v0.1.1}.
wmiirc-lua debianization
I just fixed the install scripts for wmiirc-lua. It is now possible to install wmiirc-lua in system directories and run from there. There is also a Wmii-lua session for the display managers (kdm, gdm, etc). The new and improved way to install wmiirc-lua is to [get libixp and wmii from hg]{wmiirc-in-lua-v0.1.1} and then… sudo apt-get install lua5.1 liblua5.1-0-dev liblua5.1-posix0 git-core git clone git://repo.or.cz/wmiirc-lua.git/ cd wmiirc-lua git checkout debian make deb sudo debi install-wmiirc-lua … restart X, and select Wmii-lua as your login session.
zsh tip of the day - global aliases
Most shells have aliases. Last week I started using a new (to me) feature in zsh aliases. Zsh lets you create arbitrary substitutions for the command line, not just the executable. The simple example of a alias would create a new command that acts like another with some parameters added to it: alias ll='ls -l' You can also alias other common patterns in zsh. Say, you noticed that you used | tail -n10 a lot in your shell. You can alias it like so: alias -g TT10='| tail -n10" history TT10 (10 lines follow) You can also make this tail macro a bit more useful by not fixing it to use 10 lines: alias -g TT='| tail -n' history TT 10 (10 lines follow) Of course you need to pick alias names that will not conflict with normal usage.