Lars Wirzenius: March, 2004


Monday, March 29, 2004

Random hacks:

I have at least two versions of the md5sum command on my system. One from textutils, the other from dpkg. They seem to be slightly different, but mostly compatible. Neither is, however, very nice to use interactively: I get very annoyed while creating an md5sum.txt at the root of a CD or DVD, or while checking them. It would be nice to get some progress information.

There are some other annoyances. When creating a checksum file, it is easy and natural to try to do it like this:

find . -type f -print0 | xargs -0 md5sum > md5sum.txt

Note how carefully I have used -print0 to avoid having problems with filenames containing whitespace. The problem with the above command line is that it creates md5sum.txt before it starts executing the commands. This means that md5sum.txt will contain itself, which will cause trouble.

An aesthetic problem is that all filenames will begin with ./ even though there is no benefit to that.

A minor issue while checking is that as md5sum.txt filenames relative to the root of the CD or DVD, one has to change the current working directory there. This is an unnecessary.

I finally got enough of these minor annoyances, and wrote my own program for creating and checking MD5 checksums: Perhaps someone else will find it useful as well.

ObNIH: I had to write my own program from scratch, rather than modify the textutils one, because the dpkg or textutils one is in C and the kinds of stuff I wanted to do is too tedious for me to be bothered to write them in C. The actual MD5 computation is provided by the Python standard library, the stuff I wrote is just dressing on top of that.

Random thought: Art of computer naming

Naming computers is half the fun of administering them. Some people prefer to name each machine uniquely, depending on its use and character. Others have naming schemes to make it easier to find many names.

I use two naming schemes. At home, I use names of female Discworld characters: granny, nanny, magrat, sybil, igor, angua. At work, I use names of famous computer scientists for servers. Therefore, our printer is called knuth, our main server for mail and intranet is turing, the big server for running our application is cray, and so on. Workstations do not follow this scheme: everyone gets to name the workstation they use.

In the past, I've heard of many funny naming schemes. There's even been articles in the computer press about them. I just did a quick search for such articles, but mostly I found extremely boring things such as "name of person using the computer", "complicated code revealing location, make, operating system and installation year of machine", or "whatever automatically generated binary garbage Windows offers on installation".

Does no-one else care about choosing names with care?

Well, of course they do, but it seems that mostly only for personal use or in very small organizations. I find this strangely depressing.

Enemies of Carlotta: Presentation

I gave a short presentation on Enemies of Carlotta on Saturday at a small event about Python, E-mail, Debian, and related things organized by Linux-Aktivaattori in Turku, Finland. It's in Finnish, but if that doesn't matter to you, see the PDF version of the slides.

Friday, March 26, 2004

Random hacks: My is getting bigger the program is now 1539 lines in four files. This is getting seriously big. On the other hand, it is also getting more usable. At least I think so. Probably very few other people are going to be particularly interested in this (but in case you are, check the tarball).

Oliotalo: First four day week over

The first four day work week is now over. It went quite well. I spent a quite delightful day off on Wednesday and this was the first week in ages when I wasn't furious with everything and everyone Thursday and Friday. I claim that the experiment was a success and will continue this practice unless it becomes a problem.

Wednesday, March 24, 2004

Oliotalo: Working four days a week

Starting this week, I'm going to be working only four days per week. This doesn't actually reduce my work load, I have merely rearranged my work hours to not happen on Wednesdays. Instead, I work longer on Monday, Tuesday, Thursday, and Friday. I'm hoping this will both make me more productive and give me more free time.

I have found that I tend to get up to speed with coding only some time in the afternoon (assuming a semi-normal awake/asleep schedule), but then I can easily go on for a couple of hours longer than a normal eight hour work day would allow. Either way, I'm then too tired to do anything productive in the evening, so having two hours less free time on the evening of a work day means I don't sit and stare at IRC as much. Instead, I get to spend all those hours on Wednesday. I also save over two hours per week on commute time by not having to go to the office.

After two long work days, however, I do need a day off to recover and that's why I chose Wednesday as the day off.

Tuesday, March 23, 2004

Debian: Debian sauna snowballs!

There are now a whopping seven people interested in the Debian sauna happening. That's actually a pretty good size for a small informal gathering.

Sunday, March 21, 2004

Random hacks: rss2email considered useful

Joey Hess mentioned in his web log that he prefers to read logs and news web sites (well, the RSS feeds of both) using rss2email. I thought this sounded like a nice idea and have been testing it for a couple of weeks now. Now I think it is a great idea.

The most important benefit of rss2email for me has been that it has all but eliminated the neurotic clicking on reload to see if Planet Debian or various other web sites have been updated.

I don't have a neurotic need to read e-mail all the time. Most of the time e-mail is either spam or bad news or someone wanting me to do something. I read e-mail only when I don't feel like doing something else. This combined with rss2email takes off much of the pressure of keeping up with other people's web logs. I get them by e-mail, and can read them whenever. Even off-line.

Rant: Spammers make valid HTML, why can't you?

For various bad reasons, for the past week or so I've been running without a spam filter. As a result, I've seen quite a lot of spam. What amazes me is that a number of spam mails have been valid HTML (usually 4.01 Transitional). I even checked them with rxp -Vs and W3 consortium's validator.

If spammers can make valid HTML, why is it so hard for the majority actual valid web sites to do that? Especially commercial ones?

Random thought: On successful revolutions

On Thursday this week, over ten thousand Finnish university students demonstrated against proposed changes to laws regarding university studies. I have not followed the discussions and don't know what the whole thing is about. What did catch my interest was that some of my friends were upset about some anarchists trying to advance their opinions on other matters using the big demonstration as a launching pad.

It seems that these anarchists want to make large changes in the Finnish society and think that this can only be done via sudden and radical actions. Trying to subvert a demonstration for their own purpose is one way of trying to do that. I suspect they weren't particularly happy about it, either, as it is nowhere near a real revolution. Demonstrations tend to have pretty small effects, anyway.

In my experience, large changes that affect the whole society take a lot of work and time. Of course the public part of a revolution, which everyone sees and talks about, can happen quickly, but it takes a lot of preparatory work before that can happen. My experience is that of Linux and free and open source software.

It took from 1991, when Linux development first started, until 1998, when the term "open source" was launched, before Linux started to make a large impact on computing. That's about eight years of work by many people. The process of opening up Netscape's source code and marketing the term "open source" took only a few weeks in 1998, as far as the public was concerned. The revolution happened in 1998, but it started in 1991. Or possibly in 1984 when the GNU project started.

Very little of that work was marketing, publicity, public relations, or politics. Most of the effort went into getting things to work, to be useful, to be better than proprietary software. Then, when things were technically of sufficient quality, actual revolution part was possible and even easy.

I think there is a lesson here for anyone wanting a revolution: first spend a decade preparing, then it's easy to get everyone to follow you. If you have done all the work, everyone will want to follow you.

Review: Vidocq

Vidocq is a French mysterious detective movie set in Paris of the 1830's. It is mysterious, because the story has some supernatural elements, and a detective movie, because the story is about the solving of some murders. I do not know how truthful the setting of the movie is, probably not very much. As a semi-realistic fantasy movie it works quite well, however, and the historical accuracy, if any, is merely a bonus.

The architecture and clothing in the movie might be characterized as gothic, which I find it strangely attractive and romantic. More importantly, the story is also attractive, though not romantic. Except for the unnecessary Hong Kong style balletic fighting scenes, the storytelling, including the photography and the acting, is quite excellent.

Review: Blueberry

The movie Blueberry, directed by Jan Kounen, is loosely based on the Mike Blueberry comics by Jean-Michel Charlier and Jean Giraud. It is, however, utterly different, the same way a James Bond movie is loosely based on the James Bond books, but even less so.

If what you want is a movie adaptation of the comic books, then this movie is going to disappoint you. Since it is not really an adaption, please ignore the comic books and judge the movie on its own behalf. That way you too may consider it to be an almost boring western movie.

Part of the plot of the movie is that various characters take native American drugs and then the audience is treated to depictions of hallucinations which vividly remind one of screensavers, as Anu pointed out. These got quite boring for me, and therefore I would have preferred to have them much shorter.

Apart from the hallucinations, the movies was quite nice although not altogether different from traditional westerns. So many western movies have been made that it is difficult to do something completely new. On the other hand, Blueberry manages to do tell its story in a pleasant enough manner.

Random thought: I hate computers

I had a very bad day yesterday. I was meant to build a new home server and firewall machine. The hardware was set up, I only needed to install the software. I used the beta 3 version of debian-installer to install a base Debian system, and everything related to debian-installer went quite well. My ADSL connection was flaky all day yesterday, and this did not make installing things easier. Luckily, I had downloaded the larger beta 3 CD image an earlier day, so I got the system installed despite network problems.

After I had the system installed, with all the DNS servers and stuff as well, I moved it to the corner where my servers live. I did it gently and carefully, but still something managed to break. Now the machine won't boot. The fans and hard disks spin up, but BIOS won't give the boot beep, and the screen shows nothing. The result of a day of tweaking and cursing: a non-functioning computer and a dozen new gray hairs.

I don't think I ever want to tweak computers at the hardware level again. This wasn't the first time something like this has happened, but hopefully if I never touch anything except the keyboard, this was the last time.

Friday, March 19, 2004

Random thought: Aircraft fantasies

When I grow up to be big, I'll have to build myself a Bel Geddes #4 aircraft. I used to want a Zeppelin NT, but the Bel Geddes #4 is so much sexier.

Random thought: Typewriter fantasies

I have a weird recurring dream where I buy a mechanical typewriter, go to a summer cottage, and don't come back until I've written the book that lurks in my subconscious.

That's never going to happen in real life, though. I learned to touch type on a cheapish mechanical typewriter. I can still remember the pain of fingers getting stuck between keys. I suspect that if I ever have to use a typewriter for real again, I'll be a nervous wreck for a week.

Thursday, March 18, 2004

Random hacks: plugins or not?

I just realized today on the bus home that it should be simple to add plugins to, my new fledgling editor. Many successful programs have plugins and I wonder if they are a good idea. I have traditionally personally strongly preferred programs that have exactly the correct functionality designed into them with the best possible taste. I might experiment with plugins for and see if it attracts other people.

(I wonder how many content filters will start censoring my log now.)

Wednesday, March 17, 2004

Quote: Weird unit of the day

At work I'm writing some software that reads various things from a vehicle's CAN bus. Some of these things include time spans, which are specified in decihours, i.e., one tenth of an hour. These continue to amuse me after several weeks of dealing with them.

I'd already stumbled on nanocenturies and microfortnights in other contexts, though I've since forgotten where.

Sunday, March 14, 2004

Random hacks:

On Christmas day I played around with the GtkTextView widget in GTK+. It is quite awesome in its handling of Unicode and fonts and stuff. It is almost everything you want in an editor. More specifically, it is almost everything I want in an editor. After failing to find a satisfactory Unicode capable editor for a GNOME desktop (see earlier log entry), I figured yesterday I might as well see how hard it would be to turn GtkTextVew into a real editor.

I started with the three hundred lines of Python and a fairly simple Glade file I made on Christmas day. After two days of hacking, I have added a thousand lines of code, and now this thing is fairly usable. Yes, I'm now writing this log with the new editor. Have only added three bugs to the to do list while writing this entry.

Incidentally, 330 of the thousand lines I added today were the program I wrote the other day. The new SeX has builtin paragraph formatting!

Friday, March 12, 2004

Debian: Non-free General Resolution vote

Joey Hess's log entry convinced me. I have now voted for the removal of non-free.

Quote: Coding music

From Heather Alexander's March of Cambreadth:

follow orders as you're told,
make their yellow blood run cold,
fight till you die or drop,
a force like ours is hard to stop,
close your mind to stress and pain,
fight till you're no longer sane,
let not one damn cur pass by,
how many of them can we make die

This is so perfect for coding music that it scares me.

Random hacks:

I had trouble sleeping last night and was too pissed off to work on work stuff. Instead I decided to solve a problem I've had for several years: in my editor, I use fmt(1) to format paragraphs (vi users are probably with me on this, Emacs users have it built in). fmt is not terribly intelligent, even in the GNU version, in dealing with, say, text that has been quoted for e-mail or when every line begins with a programming language comment marker. GNU fmt has command line arguments for dealing with these, but they have to be adjusted for each paragraph, and that is tedious. The par program is in many ways more powerful than fmt, but it also requires more work for each invocation. Either that or it requires spending lots of magic on coming up with a working configuration and I'd rather spend the magic on writing my own stuff. (NIH, here we come again.)

The result of a few hours of tired, pissed-off hacking,, can be downloaded from my programs page. I've started to use it myself, but it probably needs some attention before it is generally useful.

The line breaking algorithm is very stupid at the moment. If the program works well otherwise, I might want to have a look at the TeX stuff for this.

(Why not patch fmt? is 330 lines of Python; I would not want to do the string manipulation in C. I hate doing string manipulation in C. See! I'm being totally rational about having to rewrite everything myself.)

Tuesday, March 09, 2004

Review: Sorcery & Cecelia or the Enchanted Chocolate Pot by Patricia C. Wrede and Caroline Stevermer

Sorcery & Cecelia or the Enchanted Chocolate Pot is a charming romantic story. It is set in a magical version of England in 1817 and is the correspondence between two young ladies over a few months. Katherine gets to go to London for the Season, while Cecelia is left behind in the country. This promises to make life very dull for Cecelia, but cleverly the authors introduce all sorts of plot twists that keep boredom in control for both the girls and the reader.

Dressing up the story as a sequence of letters is quite refreshing. It makes for a nice pacing of the storytelling: since each letter has to be fairly short, the authors do not have the luxury of long chapters and thus the plot advances at a pleasing speed.

The sequel is to be published in September this year. I can hardly wait.

Personal life: No new books last week

Stack of unread books

I did not buy any new books last week. This was the first such week this year. I think I should try to avoid buying new books until I have had time to read at least some of the stack in my bedroom (see picture).

Sherlock Holmes bought many books, but read few of them. He stored the books in stacks on his floor. I do no think that is a pleasant way to live. I prefer a state where I have read all the books in my home. In other words, I want to be Nero Wolfe, not Sherlock Holmes.

For many years I managed to live with only one unread book after the one I was currently reading. The large pile of unread books I now have is giving me stress: so much to read, so little time to read. If I don't buy any new books for a while I should at least be able to make a remarkable dent in the pile.

Of course, not everyone shares my attitude towards unread books. Several of my friends seem to enjoy having a shelf of books waiting to be read. I can't say I understand them, but I'm happy to smile at them in an approving manner.

Thursday, March 04, 2004

Personal life: Place of logging

A current fad in the Finnish web log scene is to show a photograph of the place where you write your log. This is mine.

That chair is where I mostly hack on my free time, where I write my log, where I do pretty much everything computer related at home. It is quite comfortable. The thing under my laptop is a lap tray. It is important for my comfort: the laptop gets too hot to have directly in my lap, but the tray protects me. Also, the bag of foam balls beneath makes it easy to position the tray (and thus the laptop) in exactly the right position.

Review: Flatlander by Larry Niven

Flatlander contains several novellas about Gil "The Arm" Hamilton, a police officer in Larry Niven's Known Space universe. The stories are detective stories in a science fiction setting, in the 22nd century. Hamilton has a telekinetic psi power: an imaginary third arm, as he says himself. It allows him to move small objects without touching them physically. This and Niven's vision of the future, both technical and sociological, give the stories a flavor that distinguishes them from the average detective story. On the other hand, that is pretty much the only important distinction: as detective stories, these aren't particularly interesting.

On the other hand, Niven's Known Space is a large and interesting place, very much the kind of thing that many science fiction fans like to read about. The world he paints in these and many other stories is at the same time familiar and very strange: you can recognize some parts of his imaginary future as being obvious developments from our reality, but many things are inventions of the author. Known Space also holds together pretty well: it is internally consistent.

To me, the most important part of these stories is the world. The characters and the plots are there to make it more interesting to read about the world: even if they are pretty boring, they give life to the world.

Well, not exactly boring. The stories are written adequately well, but they lack the wow factor that is so crucial for really good science fiction.

Random thought: Most embarrassing way to spend hour

Yesterday, I spent an hour fighting a problem where the a string in one of my programs would change every time I made a release candidate tarball. It would be OK in my editor, but would be wrong in the release tarball. The program parses CVS $Date$ keyword using strptime and the pattern string was the one that got garbled all the time.

Okay, you can stop laughing now. It was obvious to me too, after I stopped doing several other things at the same time. I fixed the string in my editor, saved the file, committed it via CVS, which updated all instances of CVS keywords in the file. This replaced the pattern with the time and date of the commit, thereby mangling the string.

Wednesday, March 03, 2004

Random thought: Usability in editors

The venerable /bin/ed editor in Unix uses a single question mark for error message. Legend has it that the original manual for this claimed that the user usually knew what the error was (I couldn't find it in 30 seconds with google, though). It was thus unnecessary to bloat the program with verbose error message text.

Well, the GNU project is well known for making bloat. Their version has a command to show the error text for the latest error:

$ /bin/ed
Invalid command suffix ← SEE THIS ATROCITY!

Sigh. Where will the world go next? Pretty soon we'll have displays where text is shown as pictures, using as much as a dozen bytes per character! It was bad enough when characters went from 7-bit to 8-bit, slowing down transmissions by 14 percent!

Tuesday, March 02, 2004

Quote: Programmers screw light bulbs

I got these from Cessu.

Q: How does an imperative programmer change lightbulbs? A: He smashes the old lightbulb in its socket and forcibly screws the new bulb into the socket. The fragments of the old bulb may short-circuit the whole system.

Q: How does a functional programmer switch lightbulbs? A: He creates another identical room, possibly sharing many parts with the old one, but so that a new lightbulb is in the socket. A few moments later the unshared parts of original room just disappear.

Monday, March 01, 2004

Rant: Finnish "Computer security guide" hacked

It seems that the Finnish government and Microsoft, and possibly some other companies, have put out a computer security guide for normal homes. The online version is at It was broken into and vandalized today. At the moment, the web site merely says "No web site is configured at this address.".

I have not read the original guide myself. It was supposedly distributed to homes for free, but I didn't get a copy. According to Kai Puolamäki's commentary, the guide lacks information about things like backups.

If had had proper backups, it should not have taken them more than an hour to set up a new web server (possibly redirecting DNS to another IP) and restore the contents to that server. The admins for the site were not prepared for this, which indicates negligence or incompetence.

The real bad guys here are, however, the crackers. Even if a site is silly and has bad security, there is no justification to break into it. Even so, I can't deny that this one was funny in a perverted way.