I’ve just written a Python utility to help me copy my SMSes from my N95 to my HTC Desire. I’ve uploaded it to github in case anyone else needs to migrate text messages from a Nokia phone to an Android-based one.
To use it:
- export your messages to CSV using Nokia PC Suite
- convert the CSV to XML using nokia2sbr.py
- copy the XML file to sdcard/SMSBackupRestore/ on your Android’s SD card
- install SMS Backup and Restore and use it to restore the XML file
If you want to copy both sent and received messages you’ll need to repeat the procedure for the Inbox and Sent folders on your Nokia.
Edit: Now that commons-daemon 1.0.2 has been released and included in MacPorts, an easier way of building a universal jsvc is to install MacPorts, set universal_archs to “i386 x86_64” in macports.conf and run “sudo port install commons-daemon +universal”.
Here’s how to build Apache jsvc (commons-daemon) on OS X 10.5 so that it is capable of launching Java 1.5 32 bit, 1.5 64 bit or 1.6 64 bit. This post is mainly for my own reference, so it hasn’t been tested thoroughly…
First, get the latest commons-daemon code from svn (the 1.0.1 release won’t work – you need the fix for this):
svn co http://svn.apache.org/repos/asf/commons/proper/daemon/trunk commons-daemon-trunk
Now the recipe:
CFLAGS="-g -O2 -arch i386 -arch x86_64" LDFLAGS="-arch i386 -arch x86_64" ./configure
sudo cp jsvc <prefix>/bin/
This jsvc will start a 64-bit JVM by default. To run a 32 bit JVM, do
arch -i386 jsvc <jsvc args>
or, if you are using tomcat6 from MacPorts and have the universal jsvc in /opt/local/bin:
JSVC_ENV="arch -i386" tomcatctl start
Here’s how to get the Carbon GUI version of Emacs 22.3 running on Snow Leopard. It won’t compile on Snow Leopard, so you need to compile it on Leopard.
- a mac running OS X 10.5.8 with Xcode 3.1.x installed
- a mac running OS X 10.6.0 with Xcode 3.2 installed
- the Emacs sources, emacs-22.3.tar.gz
On the 10.5.8 mac, extract the emacs sources and compile them:
tar xzf emacs-22.3.tar.gz
./configure --enable-carbon-app && nice make -j2
On the 10.6 mac, copy the emacs-22.3 directory from the 10.5.8 mac and install. The path ‘/Volumes/francis’ in the commands below is my home directory on the 10.5.8 mac, which I mounted on the 10.6 mac in Finder:
ditto /Volumes/francis/Code/unmodified/emacs-22.3 emacs-22.3
sudo make install
You should now have a working /Applications/Emacs.app on your 10.6 (Snow Leopard) mac :-)
I have recently been working with VMware Fusion VMs at the same time as running other memory-hungry apps such as IntelliJ IDEA and NeoOffice on my Early 2008 MacBook Pro 15″. Even with 4GB of RAM, the maximum officially supported, the machine would still start paging heavily from time to time. After reading this thread on mactalk.com.au I decided to try replacing one of my 2GB DIMMs with a 4GB one. I bought a G.Skill 4GB DIMM from memoryc.co.uk and it’s working great. Here’s the obligatory System Profiler screenshot:
System Profiler Screenshot
Note: I wouldn’t recommend using 2 4GB DIMMs for a total of 8GB because people who have tried it have reported problems.
I have been using Symbian OggPlay (a music player for mobile phones) for quite a while, first on a Nokia N70 and now on an N95. It doesn’t have support for the volume buttons on the N95, so I decided to add it. The N95 has a volume control on the side of the phone, and another one on the remote control in the headphone chord.
I used the remote control API to handle the volume controls, and noticed something strange: the actions reported to my code when the volume control on the headphone remote is used are different to the actions reported when the volume control on the phone is used. Here’s what is sent to my code’s
Volume control on headphone remote
When the volume up (or down) button is pressed, an
ERemConCoreApiVolumeDown) command is immediately sent with a button action of
ERemConCoreApiButtonPress. When the button is released, another
ERemConCoreApiVolumeDown) command is sent with an action of
The headphone remote never generates commands with action set to
Volume control on the side of phone
When this volume control is used, a different sequence of commands is reported depending on whether the button is held down for a short or a long time.
When the button is held down for a short time, only one command is sent and its action is set to
When the button is held down for a long time, first a command with action
ERemConCoreApiButtonClick is sent as soon as the button is pressed, then there is a short delay and a command with action
ERemConCoreApiButtonPress is sent. When the button is released a command with action
ERemConCoreApiButtonRelease is sent.
If you would like to look at my code, the patch to OggPlay is at http://www.devrx.org/software/symbian/oggplay/symbianoggplay-mediakeys.diff.
In order to build applications that run on Mac OS versions prior to 10.3.9, you need to use gcc 3.3 (see this Apple documentation for details). This is a problem if you have an Intel Mac running Leopard, because the Xcode 2.5 installer will only allow you to install gcc 3.3 on Tiger. However, there is a way to get it to install anyway… Be warned that Apple probably had a good reason to prevent gcc 3.3 from being installed on Leopard, so this may break your system and/or the binaries that you compile. However, it did work for me and allowed me to compile a small application that ran OK on OS X 10.3.7/PPC. Here’s how to do it:
- Install Xcode 2.5, including the 10.3.9 SDK.
- Copy gcc3.3.pkg from the Packages/Packages directory in the Xcode Tools disk image to your desktop.
- Open the copy of gcc3.3.pkg (right click it and choose “Show Package Contents”).
- Open gcc3.3.pkg/Resources/VolumeCheck in a text editor.
if( CheckVersion("$SYSTEM_VERS", "10.5", "ProductVersion", ">=" )) to
if( CheckVersion("$SYSTEM_VERS", "10.6", "ProductVersion", ">=" )) and save the file.
- Double-click on your modified copy of gcc3.3.pkg. You will now be able to install it like any standard Installer package.
- “If it breaks you get to keep both pieces.”
Recently one of the hard drives in my Linux server failed. I did have a backup but it wasn’t as recent as I’d like and didn’t include some recent emails that I wanted to keep (it’s my main email machine – I did have copies of the emails on my laptop but merging them with the server backup would have been a bit tricky).
At first the filesystems on the failed disk wouldn’t even mount, so I ordered some new drives and resigned my self to restoring from the backup. When the new drives arrived I decided to have one last go at copying my files from the failed drive… and this time the filesystems would mount! Unfortunately the faulty drive wouldn’t talk to my computer for long enough to copy the data off (part way through the copy it would stop responding to the computer and I would have to power-cycle the computer for it to be able to see the disk again).
At this point I had a look on the internet for tools that might help me recover my data and eventually found ddrescue. ddrescue is a clever tool that can copy data from one disk to another, skipping over areas that it can’t read. It logs which areas it couldn’t read, so that it can retry just those areas without having to read the whole disk again. I also read about the “freezer trick” – apparently some failing hard drives will work again briefly after being in a freezer (inside a watertight bag) for a few hours).
So, I ran ddrescue and it managed to read most of my drive. I then froze the drive for about 8 hours and ran ddrescue again. It was able to read some of the previously-unreadable areas, but I’m not sure whether this was because the drive was frozen or not. Anyway, in the end there was only about 10KB of 400GB unreadable, so I was pretty happy.
The next thing I did was improve my backup regime ;-) My server now has 2 drives mirrored using RAID 1, and a 3rd drive that is synchronised with the main drives every night.
After years of resistance / indifference I’ve finally got a blog. Can you guess why?
It’s (hopefully) a pretty original reason… because my Mum told me to!
So what am I going to be writing about? Probably mostly technology rants (sorry Mum!) but I’ll also write some more personal posts; get in touch if you’d like to see them.