Why pick Git?
[ link: why-pick-git | tags: git | updated: Thu, 02 Jul 2009 15:36:58 ]
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
[ link: 20090628131255 | tags: devel x | updated: Sun, 28 Jun 2009 13:17:40 ]
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
[ link: 20090625181315 | tags: c code | updated: Thu, 25 Jun 2009 18:49:17 ]
I was squashing some warnings in 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
[ link: 20090623225800 | tags: uzbl | updated: Tue, 23 Jun 2009 23:02:12 ]
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
[ link: 20090622223147 | tags: linux conference ols | updated: Mon, 22 Jun 2009 22:35:47 ]
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
[ link: 20090622214023 | tags: git bzr | updated: Mon, 22 Jun 2009 22:29:29 ]
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
[ link: 20090612215638 | tags: debian nfs | updated: Wed, 17 Jun 2009 20:10:18 ]
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
[ link: 20090610202041 | tags: git | updated: Thu, 11 Jun 2009 00:11:22 ]
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
[ link: 20090610150039 | tags: bash shell zsh | updated: Wed, 10 Jun 2009 17:52:01 ]
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
[ link: 20090609215141 | tags: virt | updated: Tue, 09 Jun 2009 21:54:16 ]
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.
