Archive

Recent FOSS activities

I've not been doing a huge amount of work on Terminator recently - I have to be honest and say that a lot of the fun stuff is already done and behind us, and it's just got a couple of features before it's as complete as it should be, also it's now well over 2 years into the long-slog towards the often-marvelled-about decade it takes for a piece of software to be truly mature. That's not to say that I haven't still got a burning interest to do good works in the FOSS world. Recently I've been poking around at other things. I've got a patch in GNOME's Bugzilla which fixes the stupid bug where mailto: URIs get mangled when you open them, and yesterday I submitted a branch to the GNOME Do folks which adds a plugin for users of Request Tracker (being a sysadmin, RT rules my working life). Hopefully both will get merged soon! Now I need to figure out what I should poke at next in 2009 (my rough aim for the year being to produce more and consume less).


Float to the top of the race to the bottom, on wings of quality

I came across an interesting blog post earlier, in which the creators of some iPhone applications dropped their pricing and asked their users to consider donating money to them if they felt the applications were worth more. This being a reaction to applications on the store generally trending towards $0.99 in a massive war of attrition among the 15,000 applications there. It's a market worth fighting for considering there are 5 million downloads a day, but you need to be compelling, and price is the easiest way to do that. Not necessarily the best though. I had never heard of their apps, so I went to their site to check them out and they certainly look good - something that a lot of the apps I've tried don't, but I noticed straight away that it was basically just the same idea rehashed in a few different forms. I felt compelled to comment on their forums:

I'm not trying to be dismissive of your work, indeed I've never tried any of your apps (nor would I, since I don't have a car, go to the gym, etc. I'm lazy and I live in a big city). My natural reaction when I see a selection of apps such as yours is that you've had an idea and you're trying to milk it. Again, I'm not trying to be mean or cruel, it's just my gut reaction. You appear to have some very pretty and quite flexible technology for logging events, and jotting up costs, so why is there not a single awe-inspiring app for people to do those things in the way *they* want to, not the way *you* want them to. $5 just to keep track of fuel bills seems a bit bizarre when you can just keep a stack of paper receipts, or search your online credit card statements. However, a generic tracking tool that lets you create arbitrary tags.... that's a whole new kettle of fish, I could be tagging any work related expenses, things that relate to clothes, or iphone apps, and it's entirely up to me to develop a workflow that I'm comfortable with. I could also be logging when I go to the gym (if I did), and when I walk to work, which kinda counts as keeping fit, or when my washing machine breaks down so I can complain to my landlord, etc, etc. I think it's deeply unfortunate that you're finding yourself in a situation where you feel you are undervaluing your hard work, nobody likes that kind of thing, and I don't at all doubt that a significant factor is the general race-to-the-bottom of pricing in the AppStore. At that point it seems like the best way to succeed is to stand out on quality and features. Your screenshots suggest you have the design flair to pull off a quality application, but you're deliberately trying to restrict the features in each app, so people end up buying two apps if they want to track gym and fuel events, but they still can't record their expenditure on flowers for their wife. Make a free, or $0.99 app that lets people track two or three things, and a $5 app that lets you track as much as you want. I would buy it the $5 version and my gut feeling is that lots of other people would too.

The interesting thing is that I actually asked a Mac developer friend of mine the other day to consider making a generic kind of event logging app, because I do have infrequently recurring events I'd like to keep track off, and I might well be tempted to keep track of arbitrary groupings of expenditure if I had the facility, but I have no reason to buy an application for tracking car fuel costs, or company trip expenses. As it happens I don't have a car, but even if I did I would feel like I should be buying something that can track *anything* and creating a tag for car related expenses, and a second tag for fuel expenses, then creating events with both those tags when I fill the car up. I guess my fundemental problem is that the iPhone is a general purpose computer, but these apps are very specific in their functionality, and that fundementally annoys me.


Terminator 0.12 released!

Sadly a small translation change slipped in at the last minute, but I'm otherwise pleased to announce the release of Terminator 0.12! Bug fixes and some new features (including the very shiny "simultaneous typing").


Terminator 0.12 released!

I've just uploaded a new version of Terminator! This time we merry band of elves bring you a delightful mix of bug fixes and new features. Here's the change log: * Bug fixes * Simultaneous typing support * Directional terminal navigation * Improved search UI * Graphical Profile Editor * Bug numbers for launchpad.net are now URLs Head over to the homepage or Launchpad for the goodness. I've already pushed out source packages to the Ubuntu PPAs, which should be spinning up buildds soon, so expect binary packages shortly. I'm sure we'll filter into Debian, Ubuntu Jaunty, Fedora, FreeBSD and more soon enough :)


Translation template updated

Something that I've consistently failed at previously is uploading new translation templates in a timely fashion before a release. The translation community is absolutely fantastic and I want to make the best use of them that we possibly can, so beginning now I'm making more of a focus on regularly uploading templates to allow these multi-lingual rockstars enough time to make sure that the next release of Terminator has as much coverage as possible in your favourite language.


New Terminator feature: Directional terminal navigation

One of the nice side effects of being at an Ubuntu Developer Summit is the interesting conversations you have with people outside of the sessions themselves (which, as a sysadmin present to support the event itself, I was not particularly involved in). One such conversation was over lunch in a busy Google canteen with Kees Cook, one of our rocking security engineers and a thoroughly decent chap. After a while we came to the subject of Terminator and some of the features we'd like to implement, the ones that have been requested and we're not particularly motivated to work on, and the odd ones. I was trying to remember the things people have asked us to add, that for one reason or another we probably aren't going to and mentioned one about the ability to navigate between terminals in a directional way: That is, rather than doing Ctrl-Tab to cycle through the terminals in the order they were created, you could press something to move to the terminal to the left, or above, right or below the currently focussed one. On the surface it sounds like a good idea and probably not too tricky, but only if you think from the point of view of a grid. That really would be easy, but our UI is produced by way of a tree structure, not a grid. This means you need to do some proper thinking to figure it out. Kees' face lit up and he said something like "that sounds like a graph theory problem!" and expressed an interest in working on it. I'm very glad to say that in just under a week after we all went home from UDS, I've just merged his results into trunk. Thanks very much to Kees for his code and helpful suggestions (such as resurrecting Marcus Korn's simultaneous-typing branch, which I did one evening at UDS - rewriting it and then merging it into trunk). Also thanks to the other Terminator users I met there :) So that's two new features, although not really the big ticket ones that are holding back 1.0 ;)


My new project: juicyD (maybe)

Being a sysadmin I tend to install operating systems quite often on various bits of hardware. This means a lot of CDs. I carry at least 4 CDs in my laptop sleeve and that's not really enough, plus I sometimes burn CDs to update firmwares in laptops, etc. It doesn't sound like the end of the world, because it's not, but that doesn't mean the status quo is worth keeping. I've been thinking for a while now that it would be great to have a solid-state device I could use as a USB CDROM. I could load it up with a bunch of ISOs and boot from them without having to carry round a load of CDs or waste blank CDs for BIOS/firmware upgrades that are only a few MB. A little research showed that, as ever, Linux was the perfect candidate because of its USB Gadget subsystem, which lets it act as USB Mass Storage, USB Ethernet, USB Serial, USB MIDI and other things. While the Mass Storage support currently in the kernel doesn't include CDROM support, there is a patch kicking around which adds it as an option when loading the g_file_storage kernel module. Next up - selecting some suitable hardware to test this on. Atmel NGW100 Atmel's NGW100 ticks all of the boxes for a test rig, it's got a serial port, a USB port, a power port and an MMC card slot. It's much bigger than a gumstix, and not powered by USB (although there is adubious sounding hardware hack for this), but this is a low cost board to prove the project is possible. The board comes with linux pre-installed, but the kernel isn't super-new, and since the CD-ROM patch isn't in mainline yet, I needed to get the board up to date. Fortunately there is a great community of people around embedded linux. With a bunch of googling and help from HcE on #elinux, last night I got stuck in and built a toolchain, kernel, root image and upgraded the bootloader. This morning I uploaded a new image with a slightly old version of the CD-ROM patch (because I only just found the newer version while writing this post). There's also plenty of information around about this, but it can be a challenge to wade into a brand new system and immediately know the right places to look (the avr32linux.org wiki turns out to be supremely useful, as was HcE). So the question is, does it work? The simple anwer is yes, a Linux machine sees it as a CD-ROM drive and can mount it as such. The more complex, and slightly worse answer is not yet, because a test against a BIOS didn't work. It's possible this is a hardware issue, but it could be a software issue too, so I'm casting around for ideas :) (the name "juicyD" is probably temporary, and I noticed about 6 hours after I chose it that someone commented on an earlier post with that nick a while ago. Weird)


Foo Fighters Wembley Concert, the tale of a weekend like no other

It seems like I have failed utterly to comment on the towering totem of raw awesome that was the Foo Fighters concert on a balmy Saturday in June. To put the event in context, I spent a few hours during the day with Rike, Alex and Simon in Hyde Park at the Red Bull Flügtag. We ate, we drank, we watched ridiculous people flinging themselves from a raised platform into The Serpentine in craft that almost invariably were capable solely of an ungraceful and undignified plunge. The notable exception being a poor attempt at a basic hangglider design, which somehow stalled and dived its way to a distance record. We then said goodbye to Alex and headed half way across London toWembley Stadium, where we arrived to a bigger queue for the toilet than for the gates, so we were inside in a jiffy. We'd missed the support acts nonsense and things were gearing up for the Foos. It was a pretty impressive sight and sound to walk out onto what would normally be the pitch, amongst an almost capacity crowd (Dave Grohl seemed to think there were 86,000 people there). Then noise, then cheering, then rock. Twenty minutes of rock go by before they take so much as a beat of a break to say hello. More rocking. Rock. Rockity rock. Rock. Special appearance by Jimmy Paige and John Paul Jones from Led Zepplin. Rock. Good night. Massive firework show. Best gig I've ever been to, and I'm not expecting it to ever be beaten. I would describe the show in more detail, but if you weren't there then you lose, sorry. Except you don't lose! You can now buy a DVD or a Bluray of the show, and I am here to tell you that you absolutely should, especially if you own a Bluray player. My copy of the Bluray arrived yesterday and I've watched the entire 2 hour show twice so far. There seem to be cameras everywhere and they're edited together well, so it's a treat to watch. The show was presented in conjunction with BBC Radio One and they broadcast it, so the sound recording is very good. What else do you care about? There are no extras, but who cares. As if the weekend hadn't offered up enough excitement already, Simon and I went to Silverstone on the Sunday to see a day of Renault motorsport.


Using inotify in a pygtk application without pyinotify

I am lazy. There's no denying it, it's simple fact. That means, for example, when I am working with pygtk and I look at the API for pynotify, I am sad, because it's a polling API and I hate polling. What I like is GTK's event model. I like telling it what to run when things happen and letting it take care of all the pain for me. Obviously it's possible to write some code which will do the polling and then trigger an event, but that compromises my freedom to be lazy. Step in pygobject, which contains the bindings for GIO. Within the bowels of this beastie are the required components to monitor a file for changes in a very few lines of python:

#!/usr/bin/python
import gtk
import gio

def file_changed (monitor, file, unknown, event):
  if event == gio.FILE_MONITOR_EVENT_CHANGES_DONE_HINT:
    print "file finished changing"

file = gio.File('/path/to/some/file')
monitor = file.monitor_file ()
monitor.connect ("changed", file_changed)
gtk.main()

That's it. I don't know what the "unknown" argument for the callback is, probably the optional user_data connect() argument and this is but a small part of what inotify/GIO can do, but if you just care about being told when a file is updated, it'll do (with caveats that you can never really know when a file has finished being changed, so be careful to validate it before you trust its contents).


openssh 5.1 chrootdirectory permissions issue

If you're playing with the excellent new ChrootDirectory and internal-sftp options in recent OpenSSH releases (such as 5.1 which is in Ubuntu 8.10 Intrepid), you may have hit an error like:

fatal: bad ownership or modes for chroot directory

You may also have searched on Google for what to do about it and come away with very little useful information. Well no more! I did the same thing and got bored of reading mailing list posts, so read the source code instead. The relevant section is in session.c:     if (stat(component, &st) != 0)       fatal("%s: stat(\"%s\"): %s", func,           component, strerror(errno));     if (st.st_uid != 0 || (st.st_mode & 022) != 0)       fatal("bad ownership or modes for chroot "           "directory %s\"%s\"",           cp == NULL ? "" : "component ", component);

This is quite simple really, it's stat()ing the directory specified for "ChrootDirectory" and all its parents up to / and checking that they are: - owned by root - not group or other writable - (it also checks they are actually directories, but I'm going to assume you're not stupid enough to try and chroot into a file ;)

Note my emphesis that these checks apply to the chroot directory itself and its parents and /, so if you are chrooting users into /srv/chroot/ then you need to ensure that /, /srv and /srv/chroot are owned by root and not writable by the group (even if it's root, bizarrely) or other users. Sorted.