You are currently browsing the archive for the Software category.

Problem – you have a directory full of epub files with names like 1234.epub and 4567.epub files, and what you’d really like to have is all those files organised into directories by author name, and the filenames themselves being of the form “Author – Title”.

Solution – first, install Calibre, because it comes with a handy command-line tool called ebook-meta that spits out all the metadata from a file. Then, from the directory where the files are, run this:

Read the rest of this entry »

This is one of those “in case I ever need to do it again” posts. Converting EMF files to SVG files – sounds like it should be a simple task, translating from one vector format to another. It turned out not to be.

However, in the end:

find . -name '*.emf' -exec unoconv -f svg "{}" \;

successfully converted a nested directory structure full of .emf files to have their .svg equivalents alongside. Oh, and for some reason (I don’t care why) you have to run this first:

unoconv --listener &

The key ingredient was unoconv (thankfully, Debian-packaged as unoconv), which also requires a load of openoffice and/or libreoffice stuff to make it work. There were a load of other possible ways of doing this that didn’t work, which I won’t even go into. Also, don’t even ask why I needed to do this in the first place.

Update: After I’d finished, I realised I also needed EPS. Easy conversion, not so easy command due to various shell-related complications:

find . -name '*.svg' -exec sh -c 'inkscape "{}" --export-eps="`dirname "{}"`/`basename "{}" .svg`.eps"' \;


After many years as a dedicated user of Thunderbird as a mail and news client, along with the Lightning add-on for calendar and tasks, my list of gripes suddenly reached breaking point this week. I won’t go through them all, but here’s a small selection:

Read the rest of this entry »

Map Control in C#

I found myself in need of a C# (.NET/Mono) control for displaying and interacting with maps. I’d already implemented the same functionality in my application using an embedded browser, but that’s a horrible hack, so I decided to implement something nicer. I ended up with this:

I can hear the whining sirens of the don’t-reinvent-the-wheel police approaching already, so a couple of points about that. Yes, there are a couple of projects around already that I could have used almost off the shelf. They’re too complicated for my liking. What I’ve implemented does the basics of what I needed straight away in two small classes, contained in one file. I find this much more pleasant that having to wrangle with someone else’s 25-class monster implementation. Sometimes you can spend more time figuring out how to integrate an external module than you would just writing it yourself, and having spent all that time you still don’t understand the underlying implementation. This becomes more important when you start to extend things further down the line, which I will need to do. I’ve even done all this before, about 7 years ago, using tile data sneakily grabbed from various online proprietary mapping services of the day – I could have used that code, but I even rejected my own wheel.

Furthermore, if all you ever do is piece together other people’s ‘wheels’, you miss out on a lot of understanding, and more importantly fun. I don’t advocate reinventing wheels when someone else is paying for your time or you just need to get something done, but aside from that it’s frequently a good idea. So hopefully the don’t-reinvent-the-wheel police have now gone away to annoy someone else, and I can get back on topic…

Read the rest of this entry »

It’s been in the works a long time, but Facebook have finally switched on their XMPP functionality. Suddenly something like 400m users inside the Facebook walled garden are contactable from the outside world. I don’t know if this makes it the largest single deployment of XMPP – Google may be in a position to argue there, although I’ve sometimes been inclined to call their implementation almost-but-not-quite-XMPP.

Read the rest of this entry »

Samsung i7500 Reboxing

If you’re unlucky you’ll have heard of unboxing videos, where someone laboriously unpacks their latest gadget purchase, appreciatively describing each piece of cardboard and polystyrene in excruciating detail, and videoing the whole thing for the ‘benefit’ of the world. Frequently the gadget in question seems to be made by Apple, because who else but a purchaser of Apple products would do such a thing? Anyway, not to be outdone, here is my re-boxing post and photograph.

Read the rest of this entry »

There are two things I think are just plain wrong. Actually there are millions, but there are two I have in mind right now. The first is spaces instead of tab characters for indenting code. The second also involves spaces – excessive use of them like 1 + 1 = 2 when 1+1=2 is, to me, far more sensible. I don’t want to argue about either of these things, because a) this is a religious matter, i.e. I’m right and you’re wrong, and b) there’s no point, because you win anyway.

Why? Because in the interests of global harmony, code sharing, encouraging of contributions, etc, all my Python projects will now follow the PEP 8 guidelines. This doesn’t affect my contributions to other projects, since they’re always in the style required by that project (consistency always trumps religion), but it does mean that others can use and contribute to my stuff more easily, and hopefully in time I’ll get so used to seeing 1 + 1 = 2 that it won’t look stupid any more.

So, on the subject of PEP 8, a couple of tips I figured out along the way:

Read the rest of this entry »

I wanted an easy way of using images from a Zenphoto gallery in MediaWiki pages, and it turned out there wasn’t one. In fact, I had trouble finding a hard way of doing it with satisfactory results. It’s easy enough to embed external images in a MediaWiki page, if you have your MediaWiki config set to allow it, but I wanted thumbnails that clicked through to the real image. Not so easy. Hence MWZenphoto – a very basic MediaWiki extension that lets you do just that by including a simple <zenphoto> tag in the wiki markup.

Read the rest of this entry »

It’s less than a year since I wrote about how much I like Gallery. That’s still true, and I’m still running a couple of instances of it, but it’s now gone from this site. In the last year, Gallery has undergone a complete rewrite, with the new 3.0 in beta at the time of writing. In some ways, the rewrite seems like a good thing. It’s fair to say that 2.x was pretty bloated, and definitely ‘legacy code’. The new version is stripped down in many ways, PHP5 only, and built on top of the Kahona framework, making for a much cleaner codebase.

Read the rest of this entry »

Something that’s becoming obvious to me lately is the unintended suitability of a microblog to act as an information hub. To clarify the term microblog here, many may understand that as Twitter, but that would be a bad example because a) it’s both a single public instance of a microblog, and b) it doesn’t have all the capabilities that make this so interesting.

Therefore a good example of what I’m talking about would be a private instance of Laconica running on a local network, or perhaps in a private setup on the public internet. I say private because some of the examples I’m going to give are most appropriate for a private setup.

Read the rest of this entry »

« Older entries