Why pick Git?
Someone on the Git LinkedIn group asked “why pick Git?”. I started writing a response on LinkedIn but quickly realized I had more to say on the topic than I’d care to leave behind closed doors of LinkedIn. If you already use Git, none of the stuff I talk about below will surprise you. But if this sparks your interest see my Git talk.
select loop for X events
I am not a huge fan of threading when it can be avoided. I always thought that it was OK for GUI programs to be threaded. I just discovered that you can handle X events from a select loop. dis = XOpenDisplay(DISPLAY); fd = ConnectionNumber(dis); FD_SET(fd, &in_fds); select(fd+1, &in_fds, NULL, NULL, NULL); ...
portable printf
I was squashing some warnings in [uzbl]{tags/uzbl} code: printf("set %s = %d\n", (char *)k, (int)*c->ptr); Ignoring the fact that, at first glance, it’s weird to cast a pointer to int (ptr is defined as void**), compiling this code on 64bit would warn you that you were casting a pointer to an int. That’s because a pointer is 64bit and an int is 32bit.
switching to uzbl
I’ve been using vimperator for a long time now. I love this firefox plugin, but firefox is pretty slow at times. Today I decided to more seriously look at uzbl. I am surprised how much I like it. I’ve put up my configuration on github and will try to blog about it again as I convert more of my usage to uzbl.
Linux Symposium
I will be attending the Linux Symposium/2009 in Montreal in under a month. It’s been for for 11 years now, and I am looking forward to the break from work. I hear that the conference is not yet sold out… so you can still attend.
bringing git-format-patch to bzr
It should be of no surprise to readers of this blog that I am a fan of Git. If you know me, you will also know that I am no fan of Bzr. I was working on something today and wanted to export a patch… you know, like git format-patch does. Well, bzr does not seem to have an equivalent.
nfs local caching with fscache and cachefilesd on Lenny
The idea is to put a caching layer between filesystems, that tend to be slow, and the user, who is impatient. This is accomplished by the fscache kernel module, and the cachefilesd user space daemon. The kernel module intercepts what would be disk/network access and redirects it to the daemon. The daemon uses local media, which supposedly is faster, to cache recent data. The new Linux native implementation is very generic, and can be used to accelerate anything like floppies and CD-ROMs. I am interested in this because I find NFS slow. Read more about it at Linux Magazine.
Scott Chacon smacks git around
I came across a RailsConf talk given by Scott Chacon last month. As previously, his git work is really good. His presentation style has also guided my Git the basics talk which I gave about a year ago. Anyway, I want to summarize what I learned from Scott’s presentation…
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.