[ Content | Sidebar ]

Archives for 2009

Self-signed certificates on Nokia S40 phones

August 19th, 2009

I’ve been having a problem for a while with my Nokia 6300 phone not accepting the self-signed SSL certificate I use on my IMAP server (dovecot). This is a bit annoying because I can’t read emails on my phone.

Various Nokia forums suggest that you need to download the certificate over HTTP to install it. This is true, but there is an extra key step: the certificate needs to be in the DER format rather than PEM, which the phone doesn’t like. To convert, just use OpenSSL like this:

openssl x509 -in dovecot.pem -inform PEM -out dovecot.crt -outform DER

Place this somewhere you can access over HTTP and navigate to it using the phone. You’ll be asked if you want to save it, say yes and the certificate will be permanently installed in the phone. Now try accessing your mail over IMAPS and everything should work.

This trick should also work for other SSL applications (e.g. HTTPS), but I haven’t tried it.

A lighthouse, mini trains, and a nuclear power station

August 18th, 2009

Went on a family day out to Dungeness today. It’s a fascinating place: not only is it one of the largest areas of open shingle in the world, it’s got not one but two nuclear reactors (one currently being decommissioned), two lighthouses, and a mini train!

When I was about ten you could go on a guided tour of the power station which was amazing. Unfortunately, for reasons I’m not entirely sure of, the tours have been stopped. Oh well, lots of interesting stuff outside.

The mini trains are awesome: they’re exactly the same as their bigger cousins, but about one third the size. Want one!

I’ve tried to write semi-interesting captions today, enjoy!

Slough and its environs

August 16th, 2009

I’ve been up in the Slough area for the last few days as I’m shortly to be employed there. Slough was best summed up by the opening lines to this poem by John Betjeman:

Come, friendly bombs, and fall on Slough!
It isn’t fit for humans now,

Unfortunately, seventy years later this is still largely accurate. Here’s a photo of Slough’s iconic bus station:

CIMG0821

I can’t bear the thought of living in Slough, so I’ve been looking around some of the neighbouring towns. Lots of people at work commute from Ealing (London, yuck!), there’s Windsor (pricey!), leaving Maidenhead as a fairly logical place to look. Maidenhead: it’s… average. If you were to take every town in England and average them together I think you would end up Maidenhead. Not that this is a bad thing necessarily. It is blessed with a number of rather elegant bridges, like this one over the Thames:

CIMG0825

There is also a famous early railway bridge, but no photo today sadly.

Fingers crossed I might have a flat sorted out by the time I have to start work…

Azerbaijan in reality

August 13th, 2009

Browsing the second-hand book shops of Hastings today I came across this little gem:

Azerbaijan in Reality

Azerbaijan in Reality

This is a wonderful and informative book produced by the Azerbaijan Republic Ministry of Youth, Sport and Tourism. The text appears in both English and another language (Azerbaijani?). It contains information on Azerbaijan, its geography, people, and principle industries (oil). At the end is a section for tourists wishing to visit Azerbaijan (who wouldn’t?) and at the front is a brief introduction by president Heydar Aliyev.

CIMG0816

Keen Azerbaijan spotters will note that Heydar sadly passed away in 2003; his son Ilham Aliyev subsequently being elected. The book isn’t dated, but some of the information is quoted as being from 2001 so I guess the book is 6-8 years old. What a find! I’d love to know how it ended up in Hastings.

On the facing page to the president above is the Azerbaijan national anthem. Everyone sing together! and…

Azerbaijan! Azerbaijan!
You are the glorious motherland of heroes!
We all are ready to give our lifes [sic] for you!
We all are able to shed a blood for you!
Long live your three-coloured banner!
Thousands of people sacrificed their lifes!
Chests turned to battlefield!
Every soldier who gave his life for you,
Has become a hero!
We pray for your prosperity,
We sacrifice our lifes for you!
Our sincere love to you
Is established in our hearts!
To defend your honour,
To hoist your banner,
All the young people are ready!
Glorious motherland! Glorious motherland!
Azerbaijan! Azerbaijan!

Important sock-related developments

July 24th, 2009

For many years people have debated a great question: do socks come in left and right versions or are both socks the same? I have been much maligned for adhering to the heterogeneous sock philosophy. But recently NEW EVIDENCE has come to light! Behold!

Observe both socks are differently shaped!

Observe both socks are differently shaped!

Observe the LEFT and RIGHT markings!!!

Observe the LEFT and RIGHT markings!!!

Conclusive evidence! Sadly the manufacturer feels it necessary to label them as L and R since many people have forgotten a FUNDAMENTAL PROPERTY of socks.

Exploring

July 18th, 2009

Went on an exploratory bike ride to the hitherto uncharted area south east of York. Discovered a village called Elvington. The route I went on had about a mile over a bumpy gravel/mud track which was not fun: my poor bum! Anyway, these are the things a real adventurer must go through when travelling out into the wilderness. Onwards!

Here are some things I saw:

Bridge over the river Derwent at Elvington

Bridge over the river Derwent at Elvington

The curch at Newton-upon-Derwent Sutton-upon-Derwent (thanks to Ade for pointing that out)

Linux on a Samsung Q320: Part 7

July 13th, 2009

Argh! Another problem! Over the last couple of days I’ve being trying to figure out why the brightness fn-keys on my laptop don’t seem to work: they either set the brightness to maximum-bright or maximum-dim. (Although they inexplicably sometimes work.) At first I thought it was a problem with my earlier HAL hackery, but this isn’t the case as the HAL brightness scripts work fine when not using the fn-keys.

After a while I discovered the problem was that some of the fn-keys weren’t sending key release events (easy to see in xev or with lshal -m). Turns out this is a problem with lots of laptop keyboards: look at the thousands of lines of hacks in drivers/input/keyboard/atkbd.c in the Linux kernel source. The good news is that this is easy to fix: the Q320 uses exactly the same scancodes as an earlier Samsung laptop. The bad news is that you have to compile your own kernel. Ho hum.

Apply this patch to a 2.6.30 kernel and rebuild. Voila! And the problem is gone!

--- drivers/input/keyboard/atkbd.c.old  2009-07-13 00:34:14.000000000 +0100
+++ drivers/input/keyboard/atkbd.c      2009-07-13 00:35:19.000000000 +0100
@@ -1550,6 +1550,15 @@
                .driver_data = atkbd_samsung_forced_release_keys,
        },
        {
+               .ident = "Samsung Q320/P320",
+               .matches = {
+                       DMI_MATCH(DMI_SYS_VENDOR, "SAMSUNG ELECTRONICS CO., LTD."),
+                       DMI_MATCH(DMI_PRODUCT_NAME, "Q320/P320"),
+               },
+               .callback = atkbd_setup_forced_release,
+               .driver_data = atkbd_samsung_forced_release_keys,
+       },
+       {
                .ident = "Samsung SQ45S70S",
                .matches = {
                        DMI_MATCH(DMI_SYS_VENDOR, "SAMSUNG ELECTRONICS CO., LTD."),

I found the DMI_PRODUCT_NAME using dmidecode if you were wondering.

Will test it for a few days and if nothing is borked maybe I shall try to get it merged into the kernel. It would certainly be annoying to have to compile my own kernel for every release.

Shutting down and rebooting via HAL

July 12th, 2009

You know how GNOME/KDE have “shutdown” and “reboot” buttons that normal users can use to turn off the computer? Rather than using sudo or making /sbin/shutdown setuid, they use HAL which provides a nice power management interface. Turns out this is pretty easy to call from the command line so you can use it in Fluxbox, etc.

The DBus object is /org/freedesktop/Hal/devices/computer which has lots of interesting methods including Shutdown(), Reboot(), and Suspend(). For example, you can reboot the computer using:

qdbus --system org.freedesktop.Hal /org/freedesktop/Hal/devices/computer \
org.freedesktop.Hal.Device.SystemPowerManagement.Reboot

This is using the qdbus tool which is distributed with QT. If you get permission errors you may have to configure PolicyKit to let you call this interface. Here’s my PolicyKit.conf which works for me on Arch Linux. (You’ll also need to add your user to the power group.)

Here’s a simple script to wrap this up: hal-power. Usage example: hal-power reboot to reboot the computer.