bartman's blog

wmiirc-lua v0.1.1

Last night, just before midnight, I released v0.1 of wmiirc-lua. And then a few minutes later I had to release v0.1.1. Let this be a lesson to me, midnight is way too late to make releases. So what do you get in v0.1.1? a very fast and lean implementation of an event loop for wmii-3.5 all keyboard shortcuts from the (shell) wmiirc that ships with wmii-3.5 some ideas taken from wmii+ruby like more advanced keyboard shortcuts and plugins a clock plugin, a load plugin and most importantly a huge community of 3 users! Why would you want to use wmiirc-lua over the default, or even over the fabulous wmii+ruby? unlike wmii+ruby, wmiirc-lua can run with wmii-3.5 debian/testing no longer has wmii-3.1 and according to the wmii website: wmii-3.1 is deprecated wmiirc-lua is faster then the shell version because it doesn’t have to exec things on event processing we communicate with wmii over an IXP socket directly wmiirc-lua will not eat your laptop’s battery life like ruby threading can powertop used to show ruby as the #1 source of CPU wakeups 300 wakeups/s with wmii+ruby and 1 wakeup/s with wmiirc-lua

comparing two directories

In one of the project I am working on we have the build environment tarred up and stored in tgz files and committed in SVN. To avoid updating the same 300M tarball we decided to added incremental tarballs each time that we add new software to the build environment. But that’s not the important bit… I wanted to figure out what software was installed since the last tarballs were extracted. To do this I need to compare two directories and create a new tarball with all the new files. How do you diff two directories pro grammatically?

git-rebase --interactive

MadCoder wrote today about git-rebase –interactive which is a new feature in git that allows you to easily reorder, or fix patches already applied to the current branch by editing a file… very neat.

zsh tab completion awesomeness

I have been using [zsh]{tag/zsh} for a few months. I love it. The best part of zsh is the tab completion. Here are a few examples (note that you don’t actually type in the <tab>):

wmiirc in lua

I have been running wmii window manager for almost a year, and since the beginning I have been using the ruby wmiirc script. In wmii all events are handled by the wmiirc script, while wmii handles the display of windows. The wmiirc should thus do nothing until a user event (or a program event) occurs. Well, it turns out that updating the clock and status widgets requires that a thread be ran to write the new text to the screen. So far, that’s not so bad. We could schedule updates to occur infrequently. The bad part comes from the ruby implementation of threads. Threads in ruby 1.x seem to require that the interpreter do a busy wait at an interval of 10ms… this does not make me very happy as it chews up a ton of battery life according to powertop. I wanted to rewrite a wmiirc in something else. That something else, I decided, would be [lua]{tag/lua}. I chose lua because of the small footprint, use of coroutines and iterators to avoid threading, and the fact that I can plug things in using C.

debugging with -dbg libraries

I am having a problem getting openssl to verify a signature that I generated from a smartcard. I decided to step through the openssl code to see what it’s actually doing when I call RSA_verify()… but I didn’t feel like rebuilding openssl.

svn status like output in git

Today Dave asked me how to get a script-friendly list of untracked files, and modified files… like svn status. First I suggested that he look at --diff-filter and --name-status options for git-diff. git diff --name-status --diff-filter=M While git-diff can actually report a lot of cool stuff (see the git-diff-files man page for more details), it did not solve all the problems. The above worked for getting the list of modified files, but not for untracked files. We scratched our heads and were unable to get anywhere.

Git Cheat Sheet

Zack Rusin “took a break from being insanely handsome” and created a stunning Git Cheat Sheet. There are three formats: medium sized png, large sized png, and original svg. (these are distributed under the Creative Commons License) Now I have to figure out how I can print it in colour.

switching to abiword

Someone on the #oclug channel said today: Mind you, and vim-keybindings add-on for OOo would be nice. So I did the natural thing I googled for it. I am already using vi-bindings in firefox (vimperator) and in zsh. I came accords a link on using vi shortcuts in abiword, which was instantly interesting to me. I tried the procedure and it didn’t work. However, making the following change did work… --- .AbiSuite/AbiWord.Profile-original 2007-08-21 14:18:02.278538328 -0400 +++ .AbiSuite/AbiWord.Profile 2007-08-21 14:20:52.738536739 -0400 @@ -98,10 +98,8 @@ <Scheme name="_custom_" + KeyBindings="viEdit" /> <Recent And now I have modal editing support in an office suite. I still have to play with it to see if I find it useful… but initially it looks great.

forwarding ssh and X through screen

I have an update to my [previous article]{screen-ssh-agent} on forwarding [ssh-agent]{tag/ssh} through [screen]{tag/screen}. I’ve since switched to [zsh]{tag/zsh} and am now forwarding the X DISPLAY environment variable through to the screen shell. You can grab my ~/.zsh.d/S51_screen, ~/.zsh.d/S60_prompt, and ~/.screenrc or read below.