Fun with file descriptor leaks

How file descriptor leaks are causing your processes to stick around longer than they should.

June 22, 2014 · 2 min · Ohad Lutzky

Multiple library versions

Working with vendor code in C can get very tricky, especially when you except breaking changes to occur. Especially when you have multiple binaries depending on that vendor code, updating at different times, necessitating different live versions. Let’s explore. Introduction Assume you’re working with an external vendor, who is providing you with code for a wonderful function getFoo: // foo.h version 1.2.3 int getFoo(); // foo.c version 1.2.3 int getFoo() { sleep(1000); // TODO improve performance return 42 } You use this function in many of your products - for example, in your best-selling barApp application:...

May 15, 2013 · 3 min · Ohad Lutzky

Timezones are fickle

Creating a manual “always-daylight-savings” timezone is hard. Let’s peek at just how messy timezone logic gets.

April 18, 2009 · 4 min · Ohad Lutzky

Automatically starting rtorrent within screen

These days I don’t stay at home often, but I do have an RSS/BitTorrent combo fetching me all kinds of neat stuff for me, so I can have it ready for me on the weekend. I love rtorrent, especially due to the fact that I can run it in screen, ssh home and see how things are doing (or add more torrent to the download). However, sometimes my net connection breaks down, computers gets shut off, or things like that....

November 4, 2008 · 1 min · Ohad Lutzky

Quick time tracking hack

Gnome 2.24 adds a new Time Tracking feature, which I would have found useful. I don’t have Gnome 2.24 at work, but I do have a Unix-based operating system… Here’s my new ~/bin/track: #!/bin/bash date >> ~/time_tracking vim ~/time_tracking + Now, if I could only get vim to automatically hit “A” and space for me afterwards… (I’m betting there’s a way to do it, but AFAIK vim can only receive ex-mode commands as parameters)....

October 26, 2008 · 1 min · Ohad Lutzky

Deskbar and Firefox 3

Deskbar has a really neat plugin which allows you to search your browsing history and bookmarks. Firefox 3 has switched the storage format to an sqlite-based one. I’ve been working on a new plugin to make use of that - so far it’s very enjoyable to use :) » Deskbar_FF3

April 28, 2008 · 1 min · Ohad Lutzky

Things I learned today

You can use git on a VFAT disk (for example, a USB key) without all of the annoying mode issues, by using the following setting in .git/config: [core] filemode = false What I haven’t figured out is how to do force a chmod in this situation; for example, if I create a new script, I was hoping to be able to git chmod +x it. Cream is a very good editor if you’re used to Windows applications....

April 28, 2008 · 1 min · Ohad Lutzky

Hebrew spell-checking in Pidgin

This one took me a while to figure out, which is reason enough to post it here. First of all, you’ll need aspell-he, as pidgin uses gtkspell (which, in turn, uses aspell) rather than enchant (which supports hspell). There is a patch for gtkspell which gets it to use enchant, but I don’t know of a simple way to get it to work in my distribution of choice, Ubuntu. Now you need a neat little plugin from the Guifications plugin pack, called SwitchSpell....

April 22, 2008 · 1 min · Ohad Lutzky

My alarm clock

YNet was running a story on how to use your computer as an alarm clock. Here’s what I do, for our commandline junkies :) Here’s ~/bin/ #!/bin/bash find ~/music/ -name '*.mp3' -print0 | xargs -0 mplayer -shuffle & MAXVOL=31 TIME=900 for (( i = 0; i <= $MAXVOL; i++ )); do amixer set Master $i > /dev/null; sleep `echo $TIME / $MAXVOL | bc -l` done This basically plays all of my MP3 files, in random order....

February 12, 2008 · 1 min · Ohad Lutzky

Grub menu.lst editor

A lot of people ask me how to change the default operating system booted after installing Linux. The answer they get in Ubuntu’s case, “Edit /boot/grub/menu.lst, it’s self-explanatory”, is often unsatisfactory. Attached is the solution :) Actual script lost in the mists of time… Download the file, open a terminal, and run gksudo python I’ll try and make a package of this soon, so it becomes a menu entry and that much easier to use....

April 19, 2007 · 1 min · Ohad Lutzky