> Public git repo for GSSMP

March 12th, 2008

Git is supposed to work when you upload your repository to an http server, but in reality, no-one except me seems to use it, and it’s nothing like as useful as having a proper repository that people can commit to etc.

So, here it is: http://repo.or.cz/w/gssmp.git.

Enjoy.

> Finally released last.fm support for GSSMP

January 20th, 2008

There was a weird bug in my last.fm support for GSSMP, where it would crash when run from the GNOME panel, but be fine when run from a terminal.

After two bugs fixes from Charles Bailey, the problem seems to have gone away, so I’ve finally been able to make a release.

Now I have to resist the temptation to choose songs to make last.fm think I’m cool, instead of songs I actually want to listen to.

And I really need to fix the debian/Ubuntu package of lastfmsubmitd so that the client exe lastfmsubmit is included in the package. Without that, using last.fm with GSSMP is a major hassle.

> lighttpd on Ubuntu – alias.url doesn’t work when included in a module config file

December 9th, 2007

I’ve decided to use lighttpd on my new machine (which was generously given to me and features a 700GB raid array).

My main reason for choosing lighttpd was the FLV streaming plugin for it that will make my Wii TV viewing experience a lot better. (It works – I’ve tried it!)

However, if I’m going to use lighttpd for streaming TV to my Wii, I want to use it for everything, rather than having Apache running as well. In any case, I think given my load pattern (average 0.01 users at any time, approx) a lower-memory (but maybe less stable under heavy load) solution seems a good choice.

So I have to get my webmail, home-grown address book, and mediawiki installations all working with lighttpd. How hard can it be?

Actually, harder than it should be.

Lighttpd is supposed to listen to a directive that looks like this:

alias.url += ( "/mediawiki/" => "/usr/share/mediawiki1.10/" )

and on Ubuntu, being Debian-derived, you can split your lighttpd config into separate files, allowing apt to modify the main config file during an upgrade without blatting your customisations.

So I created a file in /etc/lighttpd/conf-available/ called 50-mediawiki.conf that contained the alias-url line above, and then I ran:

sudo lighty-enable-mod mediawiki

and a symbolic link was duly created at /etc/lighttpd/conf-enabled/50-mediawiki.conf.

I restarted lighttpd like so:

sudo /etc/init.d/lighttpd force-reload

and navigated to localhost/mediawiki, but got a 404 error.

A lot of experimentation later, and it turns out to be a stupid thing.

Lighttpd has a stupid “by design” behaviour, which I think I can summarise as “if you encounter a change to alias.url that comes AFTER a conditional that modifies alias.url, ignore it.”

So, to explain by example, this code in /etc/lighttpd/lighttpd.conf will successfully redirect /test/ to /home/andy/test/:

alias.url += ( "/test/" => "/home/andy/test/" )

$HTTP["remoteip"] == "127.0.0.1" {
        alias.url += (
                "/doc/" => "/usr/share/doc/",
                "/images/" => "/usr/share/images/"
        )
        $HTTP["url"] =~ "^/doc/|^/images/" {
                dir-listing.activate = "enable"
        }
}

but this code:

$HTTP["remoteip"] == "127.0.0.1" {
        alias.url += (
                "/doc/" => "/usr/share/doc/",
                "/images/" => "/usr/share/images/"
        )
        $HTTP["url"] =~ "^/doc/|^/images/" {
                dir-listing.activate = "enable"
        }
}

alias.url += ( "/test/" => "/home/andy/test/" )

Will leave you scratching your head as to why it doesn’t work.

Since the bit of lighttpd.conf that is put there by Debian (or Ubuntu?) to include all files in conf-enabled/ comes at the very end of the file, any alias.url lines in any module config are ignored. Clever eh?

To skip to the end, my fix was to move the Debian documentation code to the very end of the config file, so the end of lighttpd.conf now looks like this:

...

#### external configuration files
## mimetype mapping
include_shell "/usr/share/lighttpd/create-mime.assign.pl"

## load enabled configuration files,
## read /etc/lighttpd/conf-available/README first
include_shell "/usr/share/lighttpd/include-conf-enabled.pl"

#### handle Debian Policy Manual, Section 11.5. urls
#### and by default allow them only from localhost

$HTTP["remoteip"] == "127.0.0.1" {
        alias.url += (
                "/doc/" => "/usr/share/doc/",
                "/images/" => "/usr/share/images/"
        )
        $HTTP["url"] =~ "^/doc/|^/images/" {
                dir-listing.activate = "enable"
        }
}

Now my separate file for mediawiki works fine, and my 404 error has changed to a much more healthy 403. (If that causes pain, expect a blog entry on that too.)

As for why lighttpd works in such a stupid way, apparently it’s by design: lighttpd bug 1427

And here’s the relevant debian bug, to which I will try to remember to reply: Debian bug 445459

Incidentally, running this might be helpful:

lighttpd -tp -f /etc/lighttpd/lighttpd.conf | less

It shows you how lighttpd has understood your configuration files.

Lighttpd seems to be light on end-user documentation, and concern for ease of use. I hope I’m not making a big mistake…

> FreeGuide updated to latest XMLTV, and bug fixes

November 16th, 2007

Check out a release candidate here: http://freeguide-tv.sourceforge.net/rc/ .

So far I’ve only uploaded an RPM, but hopefully there’ll be a Windows exe and some other packages soon.

Update: Windows installer now uploaded too.

Test it! It’s got better capturing and reporting of download errors, more sensible “download in background” and “show output” behaviour, and its list of XMLTV grabbers is synched with the latest XMLTV (0.5.50).

However, apparently XMLTV 0.5.50 is causing problems in FreeGuide for at least some people, so it may not be a flawless experience…

I really must make a one-button build for Ubuntu .debs, like I have for RPMs. I have been using Ubuntu for some time now…

I’d forgotten to update the version page on the FreeGuide web site for 0.10.5, so users weren’t notified of that release. I’ll do it for 0.10.6, and hopefully get some stats together to find out how many people are using it. Now that the stats are working, we may be starting to get some better information.

Yes, I couldn’t sleep tonight.

No, I won’t be very clever tomorrow.

But hey, I was clever tonight – dipping into some of the spaghetti that makes FreeGuide tick these days and not only making a change that works, but also making things a tiny bit better – _that’s_ an achievement.

> duckmaze 0.2

November 10th, 2007

I’ve finally released to the world the secret extra duckmaze levels. They’re contained in the 0.2 release, which is also faster, and doesn’t freeze time.

(As far as I know.)

It’s got 18 levels, and a level editor, which means you can make more.

  • Do it.
  • Send them to me.
  • ???
  • Profit.

> Caution: numbers that feel prime may be divisible by 3

November 8th, 2007

Caution: numbers that feel prime may be divisible by 3. For example, 51 and 57.

Conversely, numbers that feel divisible by 3 may be prime. For example, 61, 89 and 97.

Nominations for least prime-feeling numbers that actually are prime: 89 and 101.

Nominations for best prime number: 2 and 101.

Both have digits that sum to 2.

Yes, I was trying to count sheep last night.

> Announcing Record TV

September 24th, 2007

Last night I uploaded the first public version of my latest project, Record TV. Record TV is a system for recording TV (on a Linux desktop computer) that is designed to allow lots of different user interfaces all to use the same back end. It is currently only useful for people who are quite familiar with the Linux command line. It essentially has no user interface at all, but the back end stuff works for recording TV.

Perhaps more excitingly, I have also managed to get my recorded programmes to play back on my Nintendo Wii, so I can watch them on my TV.

Find out more on the project page linked above. I’ve released this code very early, in the spirit of “release early, release often,” so expect to hack on it a bit to get it working.

If you think MythTV just goes about things the wrong way, and you’d like to help do it right, it might be of interest.

It’s mostly Python, with some PHP and shell scripts.

A job I’d like to do is to be able to use FreeGuide as a UI for selecting programmes to record.

> FreeGuide 0.10.5

September 19th, 2007

After over a year, and several U-turns, the next version of FreeGuide is out.

I was dead-set on getting recording functionality into it, and when some students turned up asking to help, I directed them towards doing that. They produced a reasonable framework for how to do it (without any of the dirty details of actually recording stuff), but we ended up throwing it away in favour of the way Alex wanted to do it, which was as an extension of the current reminder code.

This way of doing things never reached a stable state, so the trunk was festering for a long time with broken code in it that lost your settings, and tried to record programmes but started too late, and with loads of other usability bugs that I’d hesitate to call minor since any one of them could put off someone trying the program for the first time and persuade them never to come back.

In the end, since this just wasn’t getting fixed, I decided we needed to give up on recording and get back to what we’re good at, which is being a TV guide. There is, of course, quite a lot of overlap in these two functions, but I just didn’t have time to think through properly what a recording program should do, and how to move FreeGuide over to a sensible model.

So, I reverted the recording code, and it’s there in the SVN history if anyone wants to resurrect it.

Meanwhile, the thing that motivated me to do this and actually get a release out was the fact that the US listings provider Zap2It has wound up their service, and it’s been replaced with a new one, called Schedules Direct, for which you have to pay money.

Hopefully, any US and Canadian users of FreeGuide should be able to download the latest version of FreeGuide (and update to the latest XMLTV if they’re on Linux) and start viewing their listings as soon as they’ve paid for them from Schedules DIrect. Do let us know on the mailing list if this isn’t the case.

So, hopefully the crisis has been averted, and now we can get back to doing things right. I’ve implemented the Benevolent Fascist Dictator rule, and so far, trunk is better than 0.10.5, and we could make a release from it any time. I plan to make one every couple of months, to keep things ticking along.

FreeGuide 0.10.5 contains millions of small features and bug fixes, that I didn’t manage to keep up with while trunk was broken. The next release will be after a much shorter delay, and will have a much better change log.

> FreeGuide SVN now useable

August 18th, 2007

Why not try the latest SVN version of FreeGuide, which contains lots of bug fixes over 0.10.4? There are detailed instructions on how to Build FreeGuide from SVN, and do ask on the developers’ list if you have problems.

I’ve fixed the horrible bug that deleted all your preferences, and I think the code’s in pretty good shape, with all the recording code gone, but lots of nice additions put in over the last year.

Try it out, and let us know on the developers’ list how you get on – good or bad.

> Heartfelt apologies for the feed URL change

August 15th, 2007

Sorry, sorry, sorry, sorry. I decided to change to wordpress’ pretty-URLs mode, and it changed the feed URL, which I was not expecting, and which I think is fundamentally borken.