Fix Perl locale warning on Mac OS X 10.5

With the default settings on a Mac OS X 10.5 system, perl scripts will issue a warning that the locale has not been set properly. The warning will look similar to this:


perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
LC_ALL = (unset),
LANG = "UTF-8"
are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").

To fix this issue, create a folder in you home directory called .MacOSX (if it doesn’t already exist). Create a text file in that folder, calling it environment.plist and giving it the following content:


<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist SYSTEM
"file://localhost/System/Library/DTDs/PropertyList.dtd">
<plist version="0.9">
<dict>
<key>LANG</key>
<string>UTF-8</string>
<key>LC_ALL</key>
<string>C</string>
</dict>
</plist>

You then need to log out and back in again for the changes to take effect.

Warning: Nokia update wrecks Lifeblog

On January 25th Nokia Beta Labs published Share Online 3.0, an update to the media sharing services in the phones. Do not apply this upgrade if you want to use additional service providers than Flickr and Vox, such as lifeblog4wp. After applying the upgrade, the service provider list is back to the default two entries and any additional service providers will be removed. What is worse, there appears to be no way to add them as the entry “Add Service Provider” has been removed from the menu.

The application to watch out for is Share Online ver 3.0.07.51 for Series 60 version 3.1. I seriously hope this is just a mistake on Nokia’s part and that it will be fixed in any upcoming stable release.

If you have installed the upgrade it does not appear to be enough just to remove the application from the Application Manager. So to get back to the previous functionality the phone must be restored to factory settings by typing *#7370# and entering the security code (default 12345). You will lose all your settings and content.

If you despite of this want to get this upgrade it can be downloaded from here. You have been warned.

Nokia releases geo-tagging software

Both Nokia N95 and N82 have built-in GPS receivers but until now Nokia has not integrated that function with the camera. Yesterday, Nokia released an application called Location Tagger through its Beta Labs that does precisely that.

Once installed, the application icon turns up in the application folder. The application is very simple and by just running it and putting it in the background. The status of the GPS reception is shown by a small icon at the top of the display. The application will maintain its location through the GPS receiver and automatically store the position as EXIF data in the image files. Other applications can then use that information for different purposes, e.g. to show where the images were taken on a map.

The GPS receiver in the phone is known to be quite good at draining the battery in no time. Luckily, the Nokia developers have thought of this and the application automatically turns off the GPS receiver after a couple of minutes after the last picture is taken. By default, this period is set to five minutes.

Below is a dump of EXIF tags on a picture taken by my Nokia N82 with Location Tagger.

Location Tagger

Location Tagger can be downloaded from here.

Now, I just have to adapt my WordPress photoblog to be able to show the position and link to Google Maps.

Moblogging with WordPress and Nokia N82

OK, so despite its flaws, Nokia N82 does have its bright sides. The camera is actually quite good when there is sufficient ambient light around as can be seen in the picture of downtown Dallas below. My point of reference is my normal camera which is a Canon EOS 20D so I have been utterly disappointed by earlier phones with camera function. In low light, however, the supposedly fantastic Xenon flash on the N82 is no match to a proper flash. Ahhh, all these compromises…

Downtown Dallas

The phone also comes with Nokia’s Lifeblog feature and the camera is preconfigured to use the Flickr or Vox online services. That may be very well for most people out there but I am the kind of guy that wants to set up the system myself. So I just had to find a blogging platform that could be interfaced by the Lifeblog application in the phone.

One of the blogging platforms I tried to make work was of course WordPress and I quickly found the lifeblog4wp project and tried it out on various releases of the software but just couldn’t get it to work. Then, early January an update to lifeblog4wp was uploaded to the project’s web page on SourceForge and I tried it out on a clean installation of the latest version of WordPress. Lo and behold – it worked!

So for anyone out there who has, like me, been frustrated about the problems of moblogging from Nokia N82 using lifeblog4wp – use WordPress 2.3.2 and the version of the script uploaded on 2008-01-05. Then just follow the instructions within the lifeblog.php file.

Blocking spam to postfix postmaster

RFC822 from way back in 1982 stipulates that any SMTP mail server system must accept mail for postmaster@<domain> so that someone may send email to the administrator of the email system without knowing any personal email addresses.

When setting up my postfix server I set up DNS Blacklists (DNSBL) to block email being sent from known open relays to minimise the number of spam. This was a great success and I now very rarely receive any spam to my personal address. However, a year or so back I noticed that email were coming in to the postmaster address, past any spam checks. I quickly learned that postfix by default disables any blocks for the postmaster address and when I searched the Internet it looked as if a recompilation of postfix was necessary.

Then, eventually, I found that if the value address_verify_sender is set to something else than postmaster@<domain> DNSBL could again be enabled for the postmaster alias. The value address_verify_sender is used when the mail server verifies the sender. It can be set to null but that will probably lead to problems since many mailservers will not accept it. The solution is simple – I created another alias in /etc/aliases and set the same alias to address_verify_sender in /etc/postfix/main.cf.

Now DNSBL is in place for postmaster@<domain> but it is disabled for the address used for verification. However, that address is not as easily guessed and doesn’t get any spam. Legitimate email to postmaster@<domain> still gets through so I don’t feel that this is in violation to RFC822.

Nokia N82 disappointments

Nokia N82

I remember back when I had a Nokia 8210 how it seemed so much more intuitive than the competition. The menu structure was logic and the software seemed very consistent.

Since then I have had a number of phones from Sony Ericsson as well as a couple with various versions of Windows Mobile. Late last year it was time to change phone again and this time I had noticed the very promising Nokia N82 which had more or less everything I would want from a phone:

  • All modern bands – including HSDPA
  • 5 MP camera
  • Wi-Fi
  • Built-in GPS
  • Ability to synchronise with the Exchange server at work
  • Support for Mac OS X

In the media the phone was said “to have it all”. I was sold. The phone arrived a week before Christmas but since then the gloria over this particular model has waned due to the following shortcomings (which, I assume, are not specific to N82 but should apply to any N-series phone using Symbian Series 60) :

  • Incoming mail alerts or number of unread emails are not show on the standby display. Apparently, this is an E-series feature. So much for “has it all”.
  • The phone can’t even multitask! Come on Nokia, this is 2008! Instead, I have to wait until the phone has synced IMAP accounts before I can read even messages already on the phone.
  • It is not possible to create “access point groups” so that the phone could automatically decide between WiFi and mobile connections for applications. Again, this is an E-series feature (why?). The result is a constant fiddling back and forth in the various applications.
  • The address book stays on the most recently displayed person even if it was hours since I used the phone. I could accept (even like) it if it did it for a minute or so since you might want to call another number for the same person if you don’t get a response on the first number. Most of the time, though, I will want to call a different person when I pick up the phone again and then I have to start by pressing “back”. Totally unnecessary and poorly designed Nokia.
  • All meeting requests default to zero minutes. I would prefer it if I could set a specific default time so I don’t have to enter the end time.
  • Having GPS in the phone is great but it feels a little bit cheap to ask for extra for the navigation (especially since Google Maps has a mobile application available for free).
  • The GUI is inconsistent about how applications are exited. Usually one presses the right button until one exits the application but sometime one has to press the left button and select “exit”.
  • The calculator can’t do math. 2+3*4 equals 14 but the phone (like all cheap calculators) has no knowledge of operator precedence.

The unwillingness of Nokia to fulfil the combined needs of those who want to use their phone as an important business tool as well as for pleasure means that my next phone most likely won’t be a Nokia.

Steve, please bring out an iPhone with 3G for the Swedish market!

Migrating from Drupal 4.7.3 to WordPress 2.3.2

I used to run this blog on Drupal 4.7.3 and really hadn’t upgraded the software in more than a year. For some reason, the whole blog felt very slow and it took ages to get into the administration pages. It was clearly time for change. The question was whether I should upgrade to Drupal 5 or switch platform altogether. To be honest, I really didn’t actually use any of the more CMS-ish features of Drupal and I have a couple of other sites on WordPress so I thought long and hard about switching to WordPress.

But what about all the previous content? Sure, I hadn’t written that much but there was a little and it is always nice not having to start from scratch. Unfortunately there didn’t seem to be any recommended solution for migrating the content. Some other bloggers had posted MySQL scripts that could take the data from one format to another but it was supposedly very uncertain if it was going to work with my combination of versions. Now, I have no problem whatsoever in writing SQL scripts and do so ever so often in my job – I just felt that there had to be a simpler way. And there was.

It turns out that WordPress has a very nice RSS import feature and I had set up Drupal to provide an RSS feed. I just switched on the setting in Drupal that makes the RSS feed include all the text and not just the teaser but then I had one small issue – Drupal doesn’t let you show more than 30 posts in the RSS feed.

It was time to get dirty and jump into the PHP code. 43% down in the file /modules/system.module there is an array with the number of posts to show. Just stick “, 9999” (or some other large number) at the end of the list and go back to the setting page in Drupal and pick it. Then just save the RSS feed and import it into WordPress. Ta da!