Grpahical GPRS utility for Openmoko SHR distro

Monday, December 15th, 2008

This past weekend I flashed my Openmoko Neo Freerunner to the software distribution known as SHR. Immediately I was very pleased with the look, and after playing with it most of the weekend, I’m now attempting to use it as my primary phone.

GPRS was working, but I wasn’t satisfied with any of the current graphical tools to launch it, of which I only knew of one, and launching at the command line is unacceptable, as things on a handheld device need to be finger-friendly.

With that in mind I wrote a small graphical utility to launch GPRS on FSO based distributions. The tool makes use of Gtkdialog, which wasn’t in the SHR repositories, so I had to build the ipk as well: gtkdialog-0.7.9_0.1_armv4t.ipk.

At one point I had 4 different applications accessing the Internet at once: a browser surfing the web, an active chat via Pidgin, a terminal with an SSH session to a remote host, and tangoGPS downloading map tiles. Granted, none of it was super fast; GPRS is old, slow technology, but it’s still usable for many things. And over all that I was still able to receive a phone call. Things are getting better by the day for Openmoko Neo owners, but there is still a way to go.

dd saturating disk I/O

Friday, August 15th, 2008

Today I was in need of pre-allocating a 50G file on a number of CC‘s servers. I started off with this:

# dd if=/dev/zero of=bigfile.bin bs=1M count=50000

However, that operation was too expensive in terms of disk I/O and was causing critical web services to fail. I played around with multiple options in dd but to no avail. I finally ended up doing this, which works, but seems rather ridiculous. Surely there’s a better way to do it:

# for i in $(seq 1 50000); do nice -n 19 dd if=/dev/zero of=bigfile.bin conv=notrunc oflag=append bs=1M count=1 &> /dev/null && sleep 0.1; done

The nice probably isn’t necessary, but I threw it in for good measure.

nutridb.org

Saturday, July 12th, 2008

Sometime back in 2002 I started writing a nutrition database in PHP that was based on data from the USDA Nutrient Data Laboratory. In 2003 I left the U.S. for a Peace Corps assignment in Belize, then stayed in Central America for about another year and half before returning to the States. When I came back I rewrote the whole thing and registered the domain nutridb.org. It doesn’t really get used, but the code is there under an MIT (X11) license.

lolnkinkade

Friday, July 4th, 2008

http://lol.nkinka.de

Below is the bit of javascript that handles the text transitioning at the above URL. More than anything this was a way for me to explore the use of setInterval(), a javascript builtin function which I didn’t previously know about.

setInterval('lolme()', 1000);
i = 0;
function lolme() {
	var ar_lol = new Array(
		"nath@nkinka.de?",
		"lol",
		"rofl",
		"omg wtf bbq",
		":-)",
		";-)"
	);
	var ar_cnt = ar_lol.length;
	(i == 0) ? pi = ar_cnt - 1 : pi = i - 1;
	var loldiv = document.getElementById('lol');
	if ( loldiv.childNodes[0] ) {
		loldiv.removeChild(loldiv.childNodes[0]);
	}
	loldiv.appendChild(document.createTextNode(ar_lol[i]));
	(i == ar_cnt - 1) ? i = 0 : i++;
}