bartman's blog

how would you read a file into an array of lines

I was working on a shell script that needed to look at some lines in a bunch of files and perform some data mining. I started it in bash, so I am writing it in bash even though dave0 notes that I should have started in in perl. Point taken… I suffer for my mistake. After a quick google I learned that a nice way to do what the topic of this post describes can be done using IFS=' ' declare -a foo=( $(cat $file) ) Which is great! Right?

libguestfs

I came across a cool post on the kvm blog today about libguestfs and it’s various uses that I wanted to share. If you are using virtualization and have images sitting around, this is a great tool to create, inspect, and modify them… should you have the need.

tiding up the PATH

I have previously noticed that loading up the list of application available in $PATH took a long time in [wmii-lua]{tag/wmiirc-lua}. I recently found out that it was related to me having multiple duplicates in my [zsh]{tag/zsh} environment. To clean this up I added the following to my zsh configuration: typeset -U path cdpath manpath fpath This removes duplicates from the PATH, CDPATH, MANPATH, and FPATH environment variables. Well, technically it removes duplicates from the path, cdpath, manpath, and fpath arrays; but these are treated special and updating them automatically generates their respective :-delimited environment variables.

only showing relevant messages in mutt by default

Following Steve Kemp’s blog, I’ve made a small but very cool improvement to my mutt setup. Here are the new lines: macro index .i "l((~N|~O|~F)!~D)|(~d<1w!~Q)\n" macro index .n "l~N\n" macro index .o "l(~N|~O)\n" macro index .a "l~A\n" macro index .t "l~d<1d\n" macro index .y "l~d<2d ~d>1d\n" folder-hook . push '.i'

git-vim hacking

I did some hacking on my fork on git-vim. I am impressed how well things work. motemen, the upstream author, did a really great job setting things up. I’ve been mostly tyoing with command handling and completion this evening. I want to make that I could type :git diff ma<tab> and have it do the rigth thing… it seems to work. Next, I need to integrate my other git hacks and also others that seem interesting. I should also see if I can get the upstream author to consider including any of it.

mark-yank-urls: fix bug allowing shell to interpret the url

I committed a fix for an annoying bug in the urxvt [mark-yank-urls]{urxvt-url-yank} script. This has been reported by several people. I have finally fixed it, but the credit should go to Hans Dieter Pearcey, Daniel Danner and Olof Johansson for reporting it.

wmiirc-lua v0.2.8 release

I’ve packaged up the recent changes made to [wmiirc-lua]{tag/wmiirc-lua} and released a new version. This release is mostly about bug fixes, and moving things around. Particularly, I’ve [moved the project to github]{wmiirc-lua-github}, and also the new configuration files live in ~/.wmii-lua not ~/.wmii-3.5 (which clearly didn’t make sense). There are many fixes to the packaging and startup scripts to make things more robust. I’ve also revisited and fixed building Debian packages (at least for Debian/Lenny). If you’ve used the [kitchen sink]{wmiirc-lua-kitchen-sink} repository you should note that this repository is being deprecated in favour of storing the wmii and libixp repositories as submodules of wmii-lua – so no need for a container repo like the kitchen sink.

wmiirc-lua moving to github

I had as surge of new interest in wmii-lua in the last couple of months. I thought it would be good to officially state here that I’ve been moving the wmii-lua git repositories to github.

two terminals one PWD

I often find myself needing multiple terminals (urxvt) with shells (zsh) in the same directory. The step of entering that directory is teadieous, especially if there are many terminals involved. I have a few tricks that I use to make this faster.

splitting files out of a commit

I previously wrote on [splitting patches with git]{20081112150409}. This is very similar but deals with removing a file from a commit.