JNI hacking

For some reason this week I decided it would be handy to learn something about how JNI works. And when I say learn, I mean write something that would work. The Linux event interface is fairly fresh in my mind, due to working with buffalo’s ruby library for it recently so I decided to re-implement […]

it’s all about the features

At home we have a D-Link DNS-323 as a file and print server. Among other things, we store all our music on it, as it runs an “iTunes Server” (actually mt-daapd, now known as Firefly). My wife has a MacBook and an iPod, and runs iTunes. Strangely enough, this combination is missing some desirable features: […]


Inspired by Martin Fowler articles on domain specific languages, I’ve come up with this kind of thing to use a USB gamepad device to control things on my desktop. device "/dev/input/by-id/usb-050d_0805-event-joystick"   key_map 304, :ctrl, :alt, :left key_map 306, :ctrl, :alt, :right   rule ‘ABS’, ‘THROTTLE’ do |value| `/home/edward/bin/set-volume #{adjust_range(value, 255, 0, 0, 100, true)}` […]

find and grep

It seems I’m using this kind of thing a lot: find . -name ‘*.jsp’ -exec grep -q ‘contentType=’ ‘{}’ \; -print This example finds all jsp files that contain the text ‘contentType=’. Actually I’m more interested in the ones that don’t, so I’d add a -v flag to the grep. Update: oops, the latter doesn’t […]

today’s dumb bash script

An ‘awesome’ now-playing display: while true do dcop amarok player nowPlaying | figlet sleep 60 done Ok, room for improvement there. I am amused by figlet though. Today’s actually in use bash script: WPS=( /home/edward/enchantwp* ) WPCOUNT=${#WPS[@]}   `dirname $0`/xpropf -spy -root _NET_CURRENT_DESKTOP | while read v do A=($v); N=${A2} gconftool-2 -t string -s /desktop/gnome/background/picture_filename […]

petting the puppy

As part of my plans for moving, last weekend I did some reinstalling work on my PC. I’m not taking my PC with me – it is old and not worth shipping over – so my mum asked if she could have it. At the same time I wanted to remove one of the hard […]

A brief guide to Screen

screen is a very useful utility if you work in a terminal window. It lets you open multiple “windows” within your terminal session, and lets you detach from a session and come back to it later. screen is installed as standard in some Linux distributions, but you might have to install a package for it. […]