Arnt Gulbrandsen
About meAbout this blog

I give up

The newspaper yesterday drove me over the edge. I admit it: The word hacker hasn't been usable for someone like me for a long time, I just didn't want to admit it.

A long, long time ago I had a keycard that didn't do what I needed. The keycard system was a compromise between what the organisation needed and what the keycard vendor could deliver, and it was mostly okay. Not 100%.

With my usual luck, one of the exceptions turned out to apply to myself. I couldn't get all the access that I needed while also being locked out of everything else. But I'm a hacker, so I poked around a little and made myself my own card, with enough access. Problem solved.

I didn't hide the card (you could see that it was homemade) or keep it a secret. I didn't push the card into the face of anyone who would feel duty-bound to object, but keeping it secret would be wrong, so I didn't. And I didn't use the card to go anywhere I shouldn't, either.

Many hacks are rule violations in one way or another.

No rule is perfect. A rule that tries to be perfect grows unmanageably complex, which is a failure in itself. Good rules are simple enough to remember and understand, and that means that good rules will mishandle some cases, and breaking the rules can be right. Sometimes. But if you can't be open and forthright about a particular rule violation, then I intuit that it's not one of the justifiable violations.

That applies to hacks too. If they have to be secret, they're very likely wrong. But not because they're hacks. Being a hack doesn't make something wrong. Being unjustifiable makes it wrong.

A justifiable hack is the complement of a good rule.

I may still have the mentality, at least I wrote the preceding paragraph with conviction. But yesterday something clicked and I gave up on the h— word. The word has been used for too many unjustifiable acts, over too many years. Sigh.


Android boot with animated GIF

I've hated the Cyanogenmod 11 boot animation since I first installed Cyanogenmod on my phone. Admittedly I don't see it often, but I hate it. These walking fingers, possibly drawn by Will Holmes, would be so much better. So I put together a shell script to convert animated GIF files to the format Android needs.

Now and then phones are lost, particularly at schools, and I have two children, so I added an option to add text.

Reddit's mesmerizinggifs is full of suitable input files. To download today's highest-scoring animation and annotate it with Nirmala's phone: (more…)


Custom filofax paper

The two pictures show things I usually bring along in my hand luggage on the plane. Guess which one the security screeners want to look at most often.

Correct! The razor gets a brief glance or no attention at all (usually), the organiser looks odd on their screens and is often inspected. Mine was going to become a 9600bps modem when it grew up, as I have told many a security screener.

Ever since I got my first duplex printer I've made my own paper for it. Nothing very fancy, really. Four constraints only: ⓐ I like to write on the right-hand side, ⓑ occasionally I want to measure something so there should be a ruler, (more…)


The return of the advent calendar

I'm glad that my four-fours advent calendar enjoys a small following. I have even heard that certain programmers have been seen arriving at work before lunchtime, going straight to the calendar on the way in.

The original idea for the calendar came from the column Numbers Count in PCW magazine sometime in the eighties. A stylish column in a fine magazine: It published mathematical problems and occasional puzzles, and did not waste much space on answers. One of the puzzles was to count from 1 to 20 using four sevens. As I recall, I found 19 to be the most difficult.

I first tried to extend that to 24 to make an advent calendar, but had to give up on 23, which blocked me for a few years. Four fours was much easier. This year I tried four threes. Again, 23 looks poor, so but one can always choose to pay less attention to that and more to 24, for which I found several good possibilities. Which is the most elegant 24, 3!×(3⁄3+3) or 33-√3×3? Or 33×3-3 perhaps?

Again, there's both an postscript file and an advent3.pdf PDF version.


SEO at Trolltech ca. 1996

My cron-driven alter ego ran several scripts on the Trolltech web server. This is about one I wrote in 1996 and ran every half-hour to make sure that qt-related subjects were well covered by the search engines. At the time, some search requests didn't give as good results as they could have, and I thought the likely reason was that the search engines hadn't crawled the right pages.

But the pages tended to be in the Trolltech referrer log, or if not, then some other page very close to them were.

So I wrote a crontab script to watch for new referrers in our apache logs, and whenever it saw one, it did the following.

First, get rid of spam (yes, even then there were spam pages). The test was simple: At most x% of the text could be links, the page should mention one of a set of keywords, the page could contain at most y links, and at least one link had to point to Trolltech.

If the page passed that test, the script tried to clean up the URL a bit (delete session cookies, delete index.html). Next it tried to locate a higher-level index page linking to the candidate page and other related pages (since submitting an index page gave the search engine more to work with).

Finally, the script would submit either the payload page or the index page to Altavista, Hotbot, Lycos and a fourth engine whose name I've forgotten. I don't think it was Google, Google came later.

It worked very well. Searches for Qt-related subjects gave better results than before, and yes, the search engines saw more links to The script ran until shortly before I left Trolltech in 2001. By that time Google had learned to crawl well, and the script laid unused and forgotten until I found it today, while going through and wiping my old hard disks. (Update: The reason I don't know the name of the fourth search engine is that I had put the submission URLs in a configuration file.)

Update: The fourth was, of course, Excite, whose existence I had quite forgotten.


An advent calendar for nerds

By popular request: my postscript hack to produce a four-fours advent calendar.

Each of 24 printed pages bears a label such as 4+4/4-4 or 4+4×4+4. Print, fold e.g. as shown below, insert pralines, (more…)