Atomspheric CO2 (PPM)



Uptime verified by

7 June 2013

Setting up CircleCI with Symfony 2.3

I've just set up my latest Symfony project on CircleCI and it's working really well. CircleCI is very good, and the staff are amazingly helpful (even though I haven't given them any money yet). I spent a morning trying to set up Travis, without any luck. Seems to be some issue with private repos owned by organisations.

If you're trying to do your parameters the new Symfony 2.3 way, it takes a little extra work. And if your tests need the database, it takes a tiny bit more.


    version: 5.4.21
    - composer install --prefer-source --no-interaction
    - cp app/config/ app/config/parameters_test.yml
    - app/console doctrine:database:drop --env=test --no-interaction --force
    - app/console doctrine:database:create --env=test --no-interaction
    - app/console doctrine:migrations:migrate --env=test --no-interaction


  database_name: circle_test
  database_user: ubuntu
  database_password: null

Using environment variables didn't work that well for me, because I've got a local testing environment as well. So keeping two versions (local and CircleCI) of the testing parameters file seemed to work better. I'll still probably use environment variables for production, although that would be something else that didn't get tested.

12 April 2012

s3cmd sync –follow-symlinks

I had trouble getting s3cmd to do Amazon S3 synchronisation with symlinked backup files. It seemed to be comparing the local link file with the destination file instead of comparing the file that is linked to. Probably this isn't what you want because the symlink size will never match the destination file size, so it will always upload the file.

For s3cmd version 1.0.1 I changed this on line 684 in the s3cmd file:

# sr = os.stat_result(os.lstat(full_name))
sr = os.stat_result(os.stat(full_name))

Swapping Python's os.lstat() (which doesn't follow symlinks) for os.stat() (which does follow them) means that it will compare the "correct" file sizes. This method is only used to calculate file size and modification time, so it should be OK. So far I haven't noticed other side effects, but we will see. My hope is that --follow-symlinks was added later, and they didn't think to change this line.

Note: I'm guessing this change will break (or at least complicate) using s3cmd when you don't want to follow symlinks.

6 March 2012

RevealCloud server monitoring

I've been using RevealCloud for about four months and it's pretty sweet. I've been through a few server monitoring tools over the last 10 years and all of them tell me there's a problem with the site when it's too late to actually fix it with SSH. Mostly it's because I've let the disk fill up or there's a memory leak in Apache (or more often silly old lighttpd), so it's good to know about stuff starting to break. Which is just what RevealCloud does. It runs a little process and monitors stuff, sends it to their server (so you get nice graphs of that stuff) and sends you an email when certain things are outside boundaries you set up. It works extremely well. And so far I've had no false alarms, which is so terribly wonderful.

I've started turning off my other monitoring software (especially Monitis, which I was actually paying for).

13 July 2011

umount: /media/xxx mount disagrees with the fstab

There's an issue with mount.cifs where if Windows/Samba shares are entered into /etc/fstab without a trailing slash non-root users will not be able to unmount shares they have mounted.

This works:

//server/MyLibrary/      /media/Personal cifs    users,rw,user=user%pass,uid=xxx,gid=xxx    0       0

This fails:

//server/MyLibrary      /media/Personal cifs    users,rw,user=user%pass,uid=xxx,gid=xxx    0       0

27 July 2010

Netgear Stora with Apple Time Machine

It seems that some versions of Mac OSX have some broken sparsebundle handling over AFP (Apple Filing Protocol). Time Machine uses sparsebundle's for backups. The consequence is that using Time Machine with a network-connected external hard disk (like the Netgear Stora) fails. I've spent a lot of time on various forums, reading Apple support articles and reading Netgear support articles. None of the suggestions helped, with the eventual exception of some vague advice to create the sparsebundle file manually. That advice, in fact, worked.

I did something a little like this.

  1. Open Applications > Utilities > Disk Utility.
  2. On your local hard drive, create a new disk image with a large Volume Size (200GB in my case), Volume Format 'Mac OS Exended (Journaled)', Partitions 'Apple Partition Map', Image Format 'sparse bundle disk image'
  3. Find out the name of the sparsebundle the Time Machine wants using the Time Machine Buddy widget. Start a backup and watch the log when it fails.
  4. Move the sparsebundle on your local hard drive to your network drive. If Time Machine is saying it can't create '/Volumes/sharepoint/MachineName_0023ef94d1fc.sparsebundle' then move the file there.
  5. Try starting the Time Machine backup again. You may need to mount the sparsebundle image first.

My log before this process...

Starting standard backup
Mounted network destination using URL: afp://user@
Backup destination mounted at path: /Volumes/share
Creating disk image /Volumes/share/MachineName_0023df97d1fc.sparsebundle
Error 45 creating backup disk image
Failed to create disk image 
Backup failed with error: 20
Ejected Time Machine network volume.

My log after it...

Mounted network destination using URL: afp://user@Stora._afpovertcp._tcp.local/share
Backup destination mounted at path: /Volumes/share
Disk image /Volumes/share/MachineName_0023df97d1fc.sparsebundle mounted at: /Volumes/200GB

Backing up to: /Volumes/200GB/Backups.backupdb
Event store UUIDs don't match for volume: Macintosh HD
Backup content size: 81.5 GB excluded items size: 9.7 MB for volume Macintosh HD
No pre-backup thinning needed: 97.80 GB requested (including padding), 197.78 GB available

Can't account for difference between IP URL in failed backup and Stora.afpovertcp.local URL in successful backup.

3 December 2008

Intrepid Ubuntu on Acer TravelMate 8220 with Wireless

As per Ubuntu Hardy. Even makes the little indicator LED work, which I've never seen work before.

1 December 2008


Instant messaging used to be the best thing since email. Sometimes better. It is no longer. And even though email has somewhat fallen from our graces, I feel that IM has no value at all for conversing. It still gets used for snippets of conversations, but that's all. I'm sure it's far more to do with what I am like, relative to what I was like at 15.

I think the main difference might be that now IM is a tool to occasionally help me get other things done. I never just sit in front of it and talk to people. And you can tell that other people don't either. Switching between a lot of different tasks while talking to someone does not make for good conversations. Usually someone forgets to reply and the chat just ends prematurely. I somehow miss the insecurity of hovering over an ICQ message box waiting for the next little tidbit. Although not really.


Oh my good gracious. Calendar syncing between Google Calendar and iPhone lands is finally here for free. And it actually works real good. Quite the surprise.

To get it working check out the gloriously straight-forward NuevaSync.

29 August 2008

Acer TravelMate 8200

I bought a totally sweet Acer TravelMate 8200 for $330 from GraysOnline. It's got 2GB RAM with an Intel Core Duo 2GHZ. It's super quick. Even has a dual layer DVD burner and a 256MB ATI video card.

I just put Hardy Heron on it and it all worked fine. Except for the wireless, which required me to apt-get install linux-ubuntu-modules-.... The wireless light still doesn't come on with the wireless button, but it does turn the wireless on and off.

I'm not even going to bother dual-booting Windows XP on this laptop. That's partly because I'm so amazingly elite, but mostly because all I do on Windows is play Rome: Total War and it's hurting my social/love life.

Acer TravelMate 8200

14 August 2008

locale: Cannot set LC_CTYPE to default locale

I get this problem a lot.

perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
        LANGUAGE = (unset),
        LC_ALL = (unset),
        LANG = "en_AU.UTF-8"
    are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
locale: Cannot set LC_CTYPE to default locale: No such file or directory
locale: Cannot set LC_MESSAGES to default locale: No such file or directory
locale: Cannot set LC_ALL to default locale: No such file or directory

I think possibly this solves it.

$ sudo apt-get install --reinstall language-pack-en

It says comforting things like...

Generating locales...
  en_AU.UTF-8... done
  en_BW.UTF-8... done

Update: Except it didn't work. But maybe this will.

$ sudo localedef -i en_AU -f UTF8 en_AU.utf8

18 July 2008

Dell 2408WFP Widescreen Monitor with Ubuntu Hardy

It took me a while to figure this one out, because I'm totally unelite.

Section "Monitor"
  Identifier    "Dell 2408WFP"
  Option        "DPMS"
  HorizSync 30-83
  VertRefresh 56-75

Section "Screen"
  Identifier    "Default Screen"
  Device        "ATI Technologies Inc RV380 [Radeon X600 (PCIE)]"
  Monitor       "Dell 2408WFP"
  Defaultdepth  24
  SubSection "Display"
    Modes       "1920x1200" "1280x1024" "1152x864"  "1024x768"  "832x624"   "800x600"   "640x480"


16 June 2008

Apache again

I've finally ditched lighttpd + fastcgi and replaced it with Apache on smurf. Lighttpd was good, but fastcgi was a total dog. It broke all the time and it got to the point that I didn't want to host my friends sites anymore. Every time I went on holidays fastcgi seemed to fall over and all the sites would be down for a day or three.

So I've gone back to the stable world of Apache, although not on the important server. In all the years I used Apache and mod_php it gave me no problems at all. A total rock. I was seduced by lighty's memory footprint, but I was a fool.

I'll move the other server over to Apache as well at some point, the one with Thoughtful Foods and KSAsub.. I thought rewriting all the configuration files was going to be a pain, but it was actually really quick. RewriteCondition with -f is bloody marvellous.

10 November 2007

Significant Digits in R CRAN

I get a bit sick of scientific notation in R. And when I try to turn it off, I get sick of all the decimal places. These options seem to mostly stop scientific notation and give a happy number of decimal places.

options(scipen = 6) # bias against scientific notation
options(digits = 1) # show fewer decimal places

12 October 2007

iTunes Rating Distribution

I have spent a bit of thought trying to work out the best way of rating my iTunes music. Most of it I haven't rated, or have rated only by album. It's mostly an academic question, because there isn't much you can actually do with the ratings once you've stuck them in.

At first I found myself rating everything as three stars or more. I thought, if it's rated less than three then why not just delete it. Those were times of precious disk space for me, but it does make sense in general. Scrolling through a whole lot of junk music is a pain, even if you've got endless disk space. Not mention that obsessives like me obtain a great deal of satisfaction from having a neat music collection, with all the ID3 tags in good working order.

So I thought I need to reinterpret the ratings. Normally one star means something is shite. In my case I wanted one star to mean "just good enough not to get deleted". So I started doing that. And it worked pretty well. Most of my playlists drop stuff with one star, but the music is still there if I want to listen to it - which occasionally I do.

I also thought about the top rating - five stars. Should I keep it reserved for only the best, life-changing music? Should I assume that music goodness is uniform and give five stars to 20% of the collection? Or is it some sort of normal distribution (or something non-symmetric but similar)? Tough questions I know. Should I worry about trying to make my ratings comparable to other people's ratings. What about rating inflation? Will I one day need a 6th star? And when I'm in a good mood I'm likely to give everything good ratings. I find that every time I really enjoy a song I end up giving it four stars because giving it five makes me feel like a rating floozy, and giving it three just feels mean. I suspect there's a decided spike at four, and this troubles me.

Another problem is that I never take the effort to rate anything that I don't like. So everything has four stars or no rating at all. Which is totally useless. I've started bulk rating whole albums, hoping that over time I'd use some Bayesian logic to gradually make each song rating more appropriate. I did this just to get some data in there but it isn't very satisfying.

I'm inclined to think that I should maintain some sort of histogram and try to ensure that the ratings distribution sticks to something reasonable. Perhaps just a uniformish distribution. Hopefully, I'll subconsciously adjust my ratings based on short-term distortions in distribution over the long-term it stays reasonable.

Clearly, plenty more thought needs to be done on this. Although I can't help but wonder if my life would be better if I completely removed the whole rating column from iTunes altogether.

29 August 2007

Is the CIA using Plone?

CIA using Plone?

How cool would that be? What Plone may lack in goodness, it more than makes up for with open-sourceness.

19 August 2007

Google Apps

Google Apps is a beautiful piece of online software. I'm hopeless at maintaining servers and all that jazz. I always screw up the packaging for accidentily delete everyone's mail so I have room for more videos of fish. Google Apps makes email so easy. It makes a few other things really easy too, but most of other things it makes easy aren't that useful. But the mail. Very good.

17 August 2007

Convert .docx to .odt

You can convert Microsoft Word Open XML (.docx) files to OpenDocument (.odt) formats using the open source ODF Converter software on Sourceforge.

The ODF Translator Command Line is the version that worked most easily for me. Apparently it will import and export to Microsoft Word, but that didn't happen for me. And the command line version doesn't require you to have Word at all. Once you've unzipped the command line tool, you just have to run this from the Windows command line.

OdfConverter.exe /I file.docx /O file.odt

Then you're done. If you don't have OpenOffice or Word to convert it back into a normal old-fashioned .doc file, you can import the .odt file into Google Docs and export it from there.

16 August 2007

XCache with PHP5 and Lighttpd on Ubuntu Dapper

PHP is been pretty slow for me since I left Apache 2 and the PHP code caching behind. I tried turck mmcache with PHP4 and it worked pretty badly. It sped things up, but lighttpd started freezing up every few hours. It was probably FastCGI screwing up and it might have been fixed with FastCGI since then. But I'm all PHP5 now, so I needed to use something else. The Lighttpd guys suggested (and maybe created) XCache so I tried it. It only took a few minutes to install and it's working sweet. WordPress page loads are down from 300ms to 50ms. I just hope it doesn't screw other things up.

I used the XCache installation instructions but had to do things a bit differently.

  1. Downloaded the XCache source from

    ~/src $ wget http://... (the release url)
    ~/src $ tar -zxf xcache-*.tar.gz
    ~/src $ cd xcache
  2. You have to install php5-dev and make if you haven't got them

    ~/src $ sudo apt-get install php5-dev make
  3. Run the PHP/XCache installation stuff

    ~/src/xcache $ phpize
    ~/src/xcache $ ./configure --enable-xcache
    ~/src/xcache $ make
    ~/src/xcache $ sudo make install
  4. Edit the php.ini file to tell it where the file is located. Mine was at /usr/lib/php5/20051025/ You need to edit the xcache.size setting (I used 32M, but others use 64M) and the extension (or zend_extension) setting.

    ~/src/xcache $ find /usr -name
    ~/src/xcache $ sudo vi /etc/php5/php.ini
  5. Check that it's working

    ~/src/xcache $ php-cgi -v
  6. Restart lighttpd

    ~/src/xcache $ sudo /etc/init.d/lighttpd restart

3 August 2007

Forecastfox Profile

My profile for Forecastfox, which is totally sweet.


16 July 2007

Windows Save As Bug

I found a bug in the Windows Save As dialog. It's only a little one - it's really a display bug - but it's surprising after 10 years or so of the same dialog.

  1. File > Save As
  2. Click on an existing file (it becomes the name of the file you're going to save)
  3. Rename it to something else (the file is renamed but the File name field is unchanged)
  4. Click Save

Windows asks you if you want to replace the existing file, even though the name you have is different to the existing one.

0.103 seconds