Skip to content

selphy.go - Linux client for Canon Selphy CP-900 photo printer

Last month I ran into a Canon Selphy CP-900 photo printer. It's a pretty neat device, prints pictures with pretty good quality. It even worked out of the box in Linux, but only via USB, and by it pretending to be an ordinary printer. This can have pretty ugly results.

The CP-900, as the first one in the Selphy series, can also take print jobs over WiFi. The nice thing is, other than it being wireless, that the WiFi protocol is just a pretty simple JPEG file transfer mechanism. Just giving the printer a JPEG and have it figure out layout/crop/etc seems to give somewhat nicer results. But of course, only Windows/OSX/smartphone clients are available. Fortunately, after some staring at wireshark, I managed to create a new client for it.

For extra fun, it's written in Go. My first time using the language, and I quite like it. It means the tool is very easy to build, and there are no special dependencies at all, as the Go base libraries already have everything I need.

To try it:
bzr branch http://wilmer.gaa.st/selphy/
And yes, I'm still using bzr. Deal with it. :-)

uhat, using your joystick's hat switch in Linux flight simulators

So I have this fun hobby for a while already, flying.. I have around 50 hours logged by now in the US + Ireland, which means I can more or less land safely now, on my own. In fact I had my first solo in October last year which was an absolutely amazing experience. But sometimes weather just doesn't work with me here in Ireland (either too windy or too cloudy) and instead I go "flying" with X-Plane on my machine at home.

Now X-Plane is a pretty neat simulator, and as long as you use it with a real yoke/stick and not keyboard/mouse, it seems like a useful way to practice. But there's one way in which a flight simulation projected on a single screen, no matter its size, just doesn't beat sitting in a cockpit: the inability to look around in any direction by, you know, just turning your head. Instead, joysticks often have this hat switch on the top to look around. Unfortunately in Linux, the joystick driver gets told that the hat switch is a mini-joystick that the user can move up/down, left/right. Instead of just representing it as four separate buttons (which is what they really are anyway, hardware-wise). X-Plane and apparently other flight simulators can't use this, they need buttons.

This week I wrote uhat to solve this problem. It'll listen to joystick events and if you move the hat switch axes, it will generate button events on a separate virtual joystick device. There's a similar tool called jhat, which generates keyboard events instead, but I never really liked the idea of my joystick pretending to be a keyboard and hoped there were a better way to do this. A week ago I found my answer in uinput. It's poorly documented, but fortunately very simple to figure out. It looks like uinput is just a fairly 1:1 translation of the input subsystem kernel interface into a character device.

It works like a charm for me, with the udev rule I don't even have to think about it, udev will just start it for me when I plug in my joystick. Hugely enjoying X-Plane 10 again. :-D

Bank statement scraper for Bank of Ireland

Like many people, I was also losing track of my finance. Having bank accounts in use in both NL and IE probably didn't help. :-) As any proper FOSS geek, I learned to like the monster called GnuCash. (Psst! Guys! It's pretty amazing that a product more than ten years old still doesn't let you do operations (like delete) on multiple entries at once, dont you think?)

And there's this thing about Irish Banks. They have bigger issues to worry about than how well their Internet banking service works. What keeps you away from looking at my bank account? You (hopefully) not knowing my six-digit user ID, date of birth (top secret information! Have I mentioned that my birthday is next Saturday? ;-P) and another six-digit number, this time my PIN number. No one-time passwords, no challenge-response system, nothing else.

My only hope is that this lets you transfer money only to accounts to which I've transferred money before. IOW all you can do is give my landlady a little present. Pfew!

Also, going back to the original topic, there's no way to export info from their web interface. So I wrote one myself. One advantage of a pretty simple website is that I could easily write a scraper for it. Run it with the right arguments, and it'll spit out a CSV bank statement, ready to be fed to your favourite accounting software.

What else have I been doing? Been working on Giggity. Android development's fun. I spent the weekend scraping the Dance Valley timetable page, Google, Last.FM, Wikipedia and more to automatically generate a Giggity schedule file for it. Love it! :-)

dnsrev

As a bit of a cloud "sceptic" I still like to waste too much time maintaining my own network/IT infrastructure. :> I'm definitely trying to avoid the more tedious stuff though. I started using Puppet a while ago which definitely helps.

Last week I was looking for a way to automatically populate DNS reverse lookup zones. The only thing I could find was mkrdns which is unmaintained for almost ten years and doesn't seem to support IPv6. So I decided to write my own thing, dnsrev.

It's pretty simple, written in Python with help from some modules. It can read any number of zonefiles and update any number of reverse zonefiles. There's no need for any kind of 1:1 mapping between them, so it can deal with multiple netblocks in one zonefile, etc. I hope it'll be useful to someone. Comments, suggestions and patches are welcome.

Mountain View, TAPFS and yet another gallery

Writing from Mountain View again! Landed on Thursday, spent one day at work so far and today I got my bicycle fixed up so I can use it for commuting again. It's nice how year after year, the thing still works for me, all it needs when I come is some extra air in the tires. :-) One thing California is really not doing well this year is the weather, though. It's raining for two days already!

In other news, I should definitely be plugging The Australian Pink Floyd Show in this post. They were in Dublin about a week ago and they're amazingly good. Even a singer that sounds a lot like Roger Waters! The show was great too, with inflatable animals and everything, and the music sounded perfect. This tour they're playing all of The Wall, and for that that means not just a "copy" of the CD, but also many of the little filler pieces that PF used to play during the concerts.

Also working on a bit of OSS these weeks, adding more "diversity" to the already bloated landscape of gallery webapps. I'm making a difference though, SRSLY! I found myself making a lot more pictures since I bought my first dSLR and many of them aren't really part of an album/event or anything like that. I could just put them on Flickr or Picasa and be done with it, but that'd break my time-wasting tradition of hosting everything myself.

I already use F-Spot to manage my pictures, so it'd be nice to have a web gallery that can automatically use tag information from F-Spot. Turns out there are two programs that can do this already. They're not for me though; they automatically export everything, and there are pictures that I'd rather keep for myself. :-P

I then tried to adapt "original" to my wishes, but gave up when I saw it doesn't quite use templates and am rewriting it now using web.py and Cheetah templates. Going well, but TBH I feel homesick to PHP. Not that it's such a great language, it's more that I fail to understand why there are 982397832 different webapp frameworks for Python/WSGI/mod_python/whatever instead of just one that actually works.

This is a work in progress, and the progress is good. :-) Once it's done, I'll be able to post pictures here of my new radio-controlled airplane and other neat stuff. Yaaaay...

Unbricking your Netgear ADSL router without Windows

So for about a year I have a DSL modem and a separate router (running OpenWRT) here. Simply because the average DSL router has crappy software (no decent CLI, connection tracking for nothing more complicated than TCP and for only a few hundred of them, crappy wireless ... well, you get the point). So I decided to buy a Linux-powered DSL router, the Netgear DG834G. I hoped for one with an AR7 board, because that one seems very well supported, but I received a v4 which has a Broadcom board instead. :-(

Anyway, Netgear is still pretty decent. The stock firmware comes with a telnetd (must be activated via the webserver though), and (well, forced by the GPL) they put tools on-line which I can use to rebuild firmware images, which I already abused to remove the multi-lingual web interface and use those precious kilobytes for a tcpdump binary instead. :-) Adding a kernel with IPv6 support is going to be more complicated though.

Anyway, I should first focus on making the thing actually wortk with my IPoA ADSL2+ connection.... sigh

But after bricking the thing once I did manage to write up a tool (based on a half-finished tool written by someone on the OpenWRT forum) to fix that very problem. These routers can be reflashed without any serial cable or whatever these days, using the power of raw Ethernet frames (R). It's a gross hack, but it works and is reasonably convenient. It's up for download for anyone who needs it. Be careful, only use it when things can't get any worse anyway!