My iMac Approaches Perfection Asymptotically.

I have written several times about the learning curve of turning my 27″ iMac into the computer that I am happy to use all day every day. Much of this process has revolved around me moving away from using the Mac OS X operating system as much as possible. I run Linux, and, as I’ve noted in other entries I have a very tweaked system.

But there was one thing about the Mac that was a problem from the start, and which I hadn’t been able to sort out. I like to listen to music when I work, but as I share an office, I have to be concious of the impact of the impact of music on others around me.

After installing Linux I found that plugging in headphones cut off the sound from the speakers, just as you would expect, but the sound would resolutely refuse to flow from the headphones.

I have finally found a fix, of sorts. The forum post which explains the solution is here.

Essentially a short Python script is created which resets the headphones configuration and allows sound through the headphones. Apparently it needs re-running every time you re-start the computer, but I can live with this. I already run a couple of scripts when I log into the computer in the morning (to turn on my preferred keyboard layout, launch Dropbox, X Screensaver, Synergy and other useful functions).

So now I can listen to music when I’m at my desk and not disturb others with my choice.



Synergy – Control For More Than One Computer At A Time.

I am not, by habit or practice, a tidy person. This is strongly reflected in my work desk which is awash with stacks of papers, forms and diaries. Unfortunately, I am also someone who has two computers on my desk (see many previous comments on the subject).

The computer I use most is a 27″ screen iMac. The screen is lovely, with excellent image quality.

However, I don’t particularly like Apple keyboards, so I don’t use an Apple keyboard. Instead I have a wireless Logitech keyboard (a  K230 for the record). The previous keyboard that I had didn’t have a number pad on it, so I added a separate wireless number pad (also Logitech, a N305). I’m also not that keen on Apple mice because I need at least two buttons and the direction of scrolling is all wrong, so I have a trackball, which I like because it doesn’t need lots of desk space (M570).

The brilliant thing about the Logitech kit is that they all link using Logitech’s ‘Unity’ wireless system, and, importantly, each Unity USB connector can support up to 6 devices. That means I can have the keyboard, number pad and trackball all connecting to a single USB connection, and I don’t lose a heap of precious USB ports.

I am very happy with this setup and can type quickly, mouse around accurately and enter data in spreadsheets efficiently.

Then there is my other computer. The keyboard is stiff and not particularly pleasant to use, and the mouse is an old Apple mouse (pre touch surface, even pre-rollable nipple thing) where the whole case of the mouse is the button. Its horrible.

So how do I manage this setup, and the challenges of limited desk space, preferred hardware etc. Enter Synergy, a simple system to manage multiple computers from a single keyboard and mouse.

Setting up Synergy appears to be easiest when you are sharing multiple Windows computers as Windows is provided with a nice handy app where you can name computers and define where their monitors lie in relation to one another. Users of other systems need to create and edit a text file to define these relationships. So I chose to make the iMac the server machine and the Windows machine a client. Following instructions was simple enough, and after having a few connection issues caused by misnamings of the two systems I was suddenly up and running.

I have a similar issue in starting the Synergy server on my Linux box that I have setting the keyboard, activating the screensaver etc, so initially I was tempted to append the instructions to activate the server onto the script that sets these things up. However, the only time I’m going to use the Synergy system is at work, so it doesn’t make sense to add this overhead to all my Linux systems. Instead I created a script which launches the Synergy server. I run this after my initial login (and after the keyboard setting script).

Using Synergy is simply a matter of mousing over to the screen edge which is defined as the point at which the two computers meet. For reasons of understandability this should be the edge of the screens where the monitors abut. Pause for a moment and the mouse will flip over to the other screen, and you are in control of the other computer.

One unforeseen advantage of this has been the way that the keyboard layout on the server computer, that is the iMac is the keyboard layout used on the other computer. As I have written elsewhere, I use a non-Qwerty keyboard layout. In Linux I can choose a Dvorak keyboard layout, but with UK punctuation (a £ sign, the @ sign being on the middle row, just by the return key etc). I also have the Caps Lock key and the left hand Ctrl key swapped so that I have a Ctrl key on the home row of the keyboard. Replicating the finer points of this in Windows is difficult as the normal Dvorak options are US English, Dvorak left handed and Dvorak right handed. Customisation is possible, but it requires installation of extra programs and understanding an arcane piece of software.

However, using Synergy with Linux as the server fixes this as the Linux keyboard layout is carried over to the Windows computer as I flip over. Bonus!


Always Fiddling… Fortunately Rome Isn’t Burning.

I’ve written a couple of times about the fact that when I use Linux my window manager of choice (currently) is Xmonad. It has been for a while, but that doesn’t mean it has to continue being the choice, if something comes along.

I have also talked about my one bugbear with Xmonad. It is less convenient when I use my laptop as the function keys need an extra button to be pressed. It ends up being a two handed job changing screens. I was looking to find a way of changing the function keys to avoid this problem, and ended up reading about i3, another tiling window manager.

Installing it on my Linux machine was, as ever just a matter of using ‘aptitude’, and it only took a minute. Then simply log out, and set the session type.

As with most of the tiling managers, when you log in the screen is blank, apart from a simple status bar at the bottom of the page. I managed to run a script which I have to set the keyboard layout, screensaver etc.  But then I couldn’t work out how to do anything else!

I found the following page, so I’m going to give it another go. The cheat sheet can be found here.

Running Out of Space on CyanogenMod Modded Samsung Galaxy SII.

I have an Android phone which I recently flashed so that it now runs the CyanogenMod version. In most ways this is a marvellous, though installing it was a bit fraught!

But in the last couple of weeks my lovely little phone has had a little indicator in the status bar saying it was running out of space. I really couldn’t understand why. The storage indicators showed that there was plenty of space.

A bit of research this evening indicated a quick fix:

Open the Terminal Emulator

Become 'super user' (type su return)

change directory to /data/log (cd /data/log)

rm *

This freed up a huge chunk of space which meant all of the apps that had stopped updating have been able to sort themselves out.


Kudos needs to go to the forum member rhlee at StackOverFlow. The post appears on the discussion here:

The majority of the discussion regards using the standard dialler to do a similar job to the above process, but this method doesn’t work on a CyanogenMod modded phone.

Making ScrobbleThis work on Linux Mint.

I have been a long time user of I like the idea of social music, and I have regularly looked at making my iPod report my music listening to the site.

This process goes by the name of scrobbling (no, I don’t know why!), and there are a few methods of scrobbling listed on the Rockbox website, but I was particularly interested in finding a command line version of the same as I was thinking about having the scrobbling process run automatically when my iPod was connected (a subject for another day).

I found a simple Python script here:

The download is small, and installation the work of moments. However, it didn’t run straight away. I also needed to do the following:

1) Install the Python module for communicating with On my Mint box this was achieved using:

sudo aptitude install python-pylast

2) Running the command scrobblethis followed by the path to the scrobble log produced an error about a module not being found in the file A little google foo showed that some users with the same error message had fixed it by changing the import command in from:

import common


import st.common

In my case however the import already read:

import st.common

So I added another line

import common

which seemed to fix things.

3) The last stage was to modify the local configuration file to include my username and password for

Once these things were done the process of uploading the scrobble file was just a matter of the command:


One advantage of this script (over some of the online scrobblers I have tried) is that the log file is automatically deleted when the upload is complete.

Xmonad: More Cool Functionality and How It Was Achieved.

I’ve written a few times about my Xmonad configuration, and what I am doing using this unusual window manager.

If you haven’t read my previous posts then here is a quick summary:

  • Xmonad is a tiling window manager. This means that when you first launch a program it launches ‘full screen’ (minimise and maximise buttons are completely ineffectual). When you open a second program on a  screen then the new program gets 50% of the screen and the original program gets shrunk to 50% to. Adding further programs gives each progressive program less space, but the windows are all tiled together.
  • I took my configuration from the internet. It is something I plan to investigate and customise myself in future, but for now it works well.
  • Xmonad is written in Haskell which means that it has lead to me discovering a type of programming that I had no idea existed. I intend to look into this and blog about it in the future.

So I started to use Xmonad. Now I like to have a certain amount of things launch when I first log in, but I was finding it difficult to trigger these in Xmonad. The advice I found on line seemed to point to one of two ways of achieving these auto-starts, but neither approach appeared to work for me (another thing I will revisit at some point!). Amongst the things I wanted to happen were:

  • Switch to the Dvorak keyboard layout (British version with UK punctuation).
  • Swap the left hand ‘Ctrl’ and ‘Caps Lock’ keys. This is a customisation popular among Emacs users (Ctrl is an important key in Emacs) as it moves the Ctrl key onto the ‘home’ row of the keyboard.
  • Start the Emacs daemon in the background. This means that all of the initialisation files are pre-loaded, and an Emacs terminal can be started quickly.
  • Start the Dropbox daemon to update the local copies of any files to match those of the ‘cloud’ storage.
  • Start conky, the desktop monitoring app. My work configuration for conky is so extensive that it is split into three separate files which load at intervals.
  • Start the screensaver.

I have decided to do all of these things using a simple bash script. This way I don’t have to remember the complicated bit (the full command for setting the keyboard layout is the tricky bit), and I only have to run one very simple command.

There are currently a couple of minor issues that have arisen, and which needs a little bit more work, but things are going in the right direction.

  1. On my work machine the conky startup actually runs a script that then runs three separate instances of conky, each with a different configuration file, and in a different location. The three instances start up with a delay of 20 seconds each. Launching a program before this process is complete can end up leaving the output of conky ‘overlaying’ the window. Mostly this is an aesthetic issue, but it also means that at times I can’t reach the desktop to click on a button because conky is in the way.
  2. I have a folder which is configured so that scripts which are placed in it can be called just by typing their name. I am planning to make this folder a part of my ‘Dropbox’ configuration. Then I can have the script made universal across my various machines. There are some issues that will need to be addressed before this happens. These include the fact that I am using a different approach to managing the desktop wallpaper on my home machine to the approach I have for my work machine.
  3. I want to change the keyboard customisation for Xmonad. On my laptop I need to press a separate key to select the function keys (F1-F12). As these keys are used in combination with Alt and the ‘modifier’ key in Xmonad I have to press three keys to switch desktops. I plan to change the ‘desktop select’ to address this issue.


Cyanogenmod – Success, Followed by Stress, Then Success Again.

It started with a geeky chat in a phone shop. My other half wanted to upgrade her iPhone 3 to a newer model, so we went off to see a nice man in a shop.

I had recently changed my phone, and was newly re-enamoured of all things Android, but went along to act as technical advisor in case the questions got a bit too technical.

I was pleasantly surprised that the sales guy had the ability to walk that line between customer service and technical nouse, and we had a good chat. I ended up telling him that I had an iPod, but that it was hacked to run Rockbox (so that I could play ogg media files), and that my Kindle was hacked so that I could add my own screensavers. He then asked me if I had installed an alternative Android build on my phone.

At the time I baulked at the idea. My phone was still very new, and I was basking in the speed increase that I had enjoyed moving to my Samsung Galaxy SII. The idea of risking bricking it (however minor that risk was) meant that I wasn’t going to risk it.

But that was then, and now, I have got used to my phone, and, in all honesty, it was beginning to feel a little sluggish. It was time to look at the alternatives.

The suggestion from the phone shop guy and his erstwhile colleagues was Cyanogenmod. This seems to be a popular Android build, well supported on my Galaxy SII and with a busy community forum which would prove useful if I ran into any problems. I followed various bits of instructions, but most of them came from the Cyanogenmod site itself. There aren’t any releases which are marked as Stable at the moment (a fact which almost caused me to abandon the whole idea), but the release candidates are popular, and reported to be pretty stable.

The process takes a couple of stages (full instructions here):

  1. Download ClockworkMod Recovery and Heimdall Suite and install them on your computer. These programs are available in Windows, Mac and Linux versions, but obviously I was using the Linux version in my case.
  2. Turn off the phone, connect it to your comuter via USB, then turn it on in download mode (this involves holding your phone in a Vulcan death grip!)
  3. Install the kernel zImage using heimdall (see the wiki instructions for the full command). I had to use the 32-bit version as the 64-bit one wouldn’t work for me.
  4. Reboot the phone into clockwork recovery mode using a different Vulcan death grip.
  5. Copy the Cyanogenmod code to the phones SD card. If I do this again I will make sure that I also copy over the ‘gapps’ programs at the same time. These provide the core Google Apps, and are very useful in getting the phone back up and running properly.
  6. Boot the phone to the Recovery mode (Vulcan Death Grip!)
  7. Select ‘install from the SD card’ to install the new software.
  8. Reboot and enjoy your new installation.


Most of this process went without a hitch. However, when I booted the phone I found that the SD card was unreadable. This had a number of knock on effects. The most obvious was the extremely limited functionality that the phone had at this point. Things like the camera refusing to work because there was nowhere to save the files. It also meant I couldn’t install the gaps software. When I tried to use the Google Play site to install apps I was unable to do so. Partly because there was no place to store them, and partly because the Play website was of the belief that they were already installed.

The solution was to reboot the phone into Clockwork Recovery Mode and then format the SD card. This wasn’t a problem as all the contacts information was stored in my Google account, and all the photographs and videos are uploaded to my Dropbox.

Once I had done this the SD card was accessible, and could be used to install gaps. Another ‘normal’ reboot and a Google login later the phone recovered all my contacts, and the Google Play app was making it easy to re-install all my other apps.

I have been selective about what apps I install. I haven’t played ‘Stupid Zombies’ for ages, so that doesn’t get a re-install, things like that.

But I did hit a bit of a snag, which took me a little while to circumvent.

Authentically Awkward.

As I log into a lot of different websites, and I also lecture users on their user security, it is beholden on me to use best practise in terms of security. I have strived to use different passwords on different sites, and I do this with the help of a password manager. I use an online manager as I am often on different computers, and on different platforms. My single password for the manager is long, and secure, but as this is an obvious possible vulnerability in my security setup, I have configured a two-stage authentication using Google Authenticator. I will write about this in another post, but for the time being, its an app that runs on my phone and gives a new six digit code every thirty seconds. This is synced with the sites that are protected in this way.

Unfortunately, when I had to reinstall Google authenticator there were lots of hoops to leap through to get it working again.

The password manager required me to disable the two stage authentication, then sign in and re-enable it from scratch. WordPress required me to email them and get a reset code. And as for Dropbox’s website? I’m still working on that. Fortunately Dropbox is still working as a service, but I can’t log on to the website as things stand!


The whole process has been pretty straightforward, and early indications are that the phone feels fresh and sprightly again. How much of that is down to a clearing down of the installed apps I’m not sure yet, but time will tell. The customisations are a little different, and I’m still working them all out. But I’ll get there, and in the meantime, it is happily functioning as a phone, and, most importantly, as far as my daughter is concerned, the YouTube app is back in place, and she can watch videos.