Craig Mayhew's Blog


Latest blog posts

by Craig Mayhew

Hacking AWS CloudFront Pricing

Cloudfront has a complex pricing structure. AWS charge you based on bandwidth used, number of requests, region serving the traffic, and the protocol used.

HTTPS requests are typically 1/3 more expensive than…

DNS, the original CDN

The Domain Name System has been around since the 1980s, and often doesn't get credit for how abundent and efficient it is. Most people know it as a way to translate website address such as into an ip…

Open Source

Open source has been the mainstream paradigm for some time now. Although I am a little late to the party with some of my code, I am continuing to open source as much as possible, as quickly as possible. This website is…

CRC are hiring and created an interesting video

This is what happens when you ask developers to create a recruitment video: Join CRC from Client Relationship Consultancy on…

RaspberryPi Automated USB Eraser

Ever needed to securely wipe a USB drive with minimum effort? How about doing it every day? This project hoped to simplify the process. All you need to do is plug in a usb drive and the process starts automatically. A…

My Reprap Mendel

In 2010 when Beth and I started building the reprap, we anticipated it would take us a month or two. We we're wrong. We had almost no tools, no work space and limited engineering knowledge. Sometimes because work was…

Economics of SETI on AWS spot instance

I needed an excuse to use spot instances on AWS to test them for some upcoming projects. I chose SETI and I have to say it was a nice simple experience. It took about 30 minutes to build the linux VM, set it up with…

NX Server on CentOS 6

Install nxserver

yum install nx freenx
cd /etc/nxserver
cp node.conf.sample node.conf
vi node.conf
Ensure that this line is not commented out:

Setup NX Server


Script Hash

Developers have a responsibility to protect their users as much and as often as they can. I would like to live in a world where everyone leaves school with the know-how to protect their passwords with something such as…

New blog - using tiny php framework and mongodb

I have replaced my ancient wordpress blog with a lean custom php framework. The blog entries, tags, categories and comments are now stored in mongodb rather than mysql. This has speed advantages in the case of a high…

Upgrading turnkey redmine from 1.3.0.stable.8673 to 2.0.4.stable

First, upgrade rails. This will take some time, go and make a tea/coffee.
#gem install rails

#cd /var/www
#mv railsapp railsapp-old
#hg clone --updaterev 2.0-stable…

RaspberryPi Power Management with a TellStick

#sudo apt-get install libftdi1 libftdi-dev libconfuse0 libconfuse-dev cmake

Download the latest source code from Telldus at: you can use the wget command…

ZFS vs 7Zip for virtual disk backups

This details a real world example of the benefits of ZFS dedupe.My backup disk contains 2.4TB of 7z files. Each file is a website backup, a database backup or a 7z backup of an entire virtual machine / server. Many of…

When did I get old?

Sitting down for our regular Sunday breakfast at Pitcher & Piano on the marina. I'm perusing the FT feeling more and more negative about the economy, but hopeful that interest rates will stay low so my mortgage gets…

Future of The Super Capacitor

Super Capacitors have been closing the gap with batteries over the last decade. Maxwell Institute currently dominates the Wikipedia article for super capacitors and has devices that store enough power to be a phone…

ZFS on FreeBSD

For this test I will be running FreeBSD in a VirtualBox virtual machine. These instructions will work regardless of this.Download the 64bit iso of FreeBSD. I am using version 9.1.Install FreeBSD form the livecd. I…

Switching from Vmware to Virtual Box

So I accidentally let one of my SSDs completely run out of space. My VM running on this disk then promptly crashed. I knew I had to repair it - but while I'm at it - I'm going to convert it to Oracles virtual…

RaspberryPi Power Management with a PIR Sensor

This is a simple guide to setting up a PIR sensor with a raspberryPI to send a wake-on-lan packet to one or more computers. The idea being that as I walk into my office, everything boots up or comes out of hibernation…

My Workstation Software

I'm now running:

Virtualized Windows 7 64bit
I now work from a virtual machine. It is one of many workstations and servers now running on a single chunk of hardware. All main drives are 256GB ssds (VMs are…

Earths processing capacity in my lap

I wondered how long one needs to wait before owning the current worlds computer processing power for under $1000.

A few studies have been done to measure the world's processing power. In 2007 the entire world's…

Tweets Backup Script

So I wanted to backup and archive my tweets. I threw together this quick and dirty script to retrieve the last 200 tweets of a twitter user (In this case, me).

Latest source code available here: …

How I complied with the EU Cookie Law

I am a keen believer in law. It stops me being killed for my wallet while walking to the shop, keeps my house from being broken into while walking to said shop and my family safe.

So when a new law is passed - I do…

UK Spaceport

The BBC caught my eye with a recent article on the possibility of a UK spaceport. This is a nice idea but I doubt we have any near term use for it.

What we really need…

Browser Compatibility Testing in IE

Oh the fun... Hopefully this will help you with testing in IE.

Internet Explorer Application Compatibility VPC Image

Utilu IE…

How to generate negative mass, traverse hyperspace and walk through walls, even with a dog.

I came across this recently, it had me in stiches and I have no idea if it's serious.

It's a patent application for walking through walls. There are several gems in here including "Upon reading his explanation, I…

Titanium on Windows: Error locating JDK: set $JAVA_HOME and make javac and jarsigner available via your $PATH

Right click on my computer and then left click proeprties in the menu that appears.
Goto "Advanced" tab
Click "Environment Variables" button at the bottom
Click "New" under system variables.
Set variable name…

Intel 3.6Ghz Core I7-3820 with 32GBs of RAM and 7zip

Recently upgraded one of my machines (all changed except the power supply, some drives and the case).

I've gone for the 2011 socket motherbaord P9-X79PRO due to it allowing for 8 DDR3 RAM slots and this incredible…

P9X79-Pro BIOS Flashing & RAM issues

So I've unboxed my P9X79-PRO, screwed it in the case, fitted the cpu, heatsink and RAM. On the first boot it sits there with status code AF on the motherboard LEDs and the red LED solidly on to signify a problem with…

25th Birthday

Absolutly awesome birthday. I've finally managed to upload the videos from my first flying lesson in an Ikarus C42. I took off at a local private airfold at 11:15 this morning (I was just a passenger for take off and…

Firefox Tweak - Memory Cache

A quick way to increase the responsiveness of firefox is to turn off the disk cache and turn on the memory cache. This will keep a cache of recently visited websites/images in the computers RAM instead of on the hard…

Short, elegant Regular expression for primality testing


I was thoroughly impressed with this regex. I'm not going to reiterate what other people have already explained. So instead I will place links to other blogs that explain this very cool regex…

Christmas/New Year 2011

This year has been a good haul, some awesome presents from B and family.

I'm a fan of difficult puzzles (ideally if there is a prize) to the point of sleep deprivation. Let me show you the Isis puzzle. It's…

Increase Size of Windows 7 Partitioned Virtual Disk (vmdk)

Login to your vmware server.
Backup your virtual machine and all snapshots (The raw files on the physical disk - particularly the vmdk files as this will be what we are modifying)
Login to vmware gui.
Power off…

Critical SSL Weakness Found

Researchers Thai Duong and Juliano Rizzo claim to have found a weakness in SSL encryption. It allows them to view anything that is encrypted with SSL and therefore supposedly secure. It affects TLS 1.0 and below which…

Thoughts on Bitcasa's unlimited online storage

Are we finally in the age of truelly unlimited storage? It would be nice but I think the encryption issue will let it down.

Bitcasa think they can offer you unlimited storage for $10 per month. They achieve this…

Ubuntu screen brightness on EliteBook 8530w

Ubuntu versions 10.04 and 10.10 had various issues with the screen brightness on my HP EliteBook 8530w. It wasn't possible to adjust the brightness which was a real problem if the screen dimmed while power…

Upgrading Ubuntu to 10.10 - blacklisted blcr-dkms_0.8.2-13 Error

If you get the following error when your upgrading:

An unresolvable problem occurred while calculating the upgrade:
Trying to install blacklisted version 'blcr-dkms_0.8.2-13'

To fix, simply search for the package…

critical zero day wordpress security flaw with timthumb.php

In a nutshell, timthumb.php is used to resize images in many wordpress themes and it doesn't check images from remote sources to make sure they really are images and not a malicious script.

To fix you need to change…

Upgrading turnkey redmine from version 0.8.x to 1.0

Upgrading the turnkey vm of redmine can be painful:

Hopefully this will take away some of the pain :)

cd /var/www
mv railsapp railsappOLD
svn co railsapp

Email Charter

Would like to spread the word on this as email is taking up an increasing amount of my time (and server diskspace/bandwidth!).

I already follow most of these rules but will be making more effort with number…

Remote Desktop Optimization for Firefox 4

Firefox 4 has added some eye candy that greys out the webpage when an alert appears. This looks nice but is very slow over a remote desktop connection as it forces the entire window to be sent again to the client.


CUDA Development in Visual Studio 2008

When I started developing in cuda I had a bit of a nightmare setting up the development environment. This youtube video saved the day. Many thanks to Yuber Núñez for taking the time to make…

Automatically reboot minecraft on crashes

The latest version of minecraft has been extremely unstable for me, so I've written this quick script to automatically check if minecraft is running - and reboot it within 30 seconds if it isn't. You will need php…

Generating SSL Certificates for Apache

Generate a key:

openssl genrsa -des3 -out server.key 2048

Generate a certificate signing request (csr):

openssl req -new -key server.key -out server.csr

Country Name (2 letter code) [GB]:GB
State or…

OpenSim 0.7.1 RC1 and the shiny new media on a prim

I've installed the release candidate and had a play with the new media on a prim feature. At the moment it's only supported by the Second Life viewer. So, even though the OpenSim server supports it, none of the open…

Tiny little universe

After my last post about second life, it's time I got back on track about what I wanted from second life. For me, second life didn't allow me to design without limits. Mostly because it has an economy, an economy is…

Windows 7 registry file open with association

For anyone that has accidentally clicked on an apllication, clicked "open with" and set it to open with another application by default. Here is how to fix it.

If you are lucky enough to still have a web browser open…

SSH Port Forwarding

A very quick reference for anyone that wants to tunnel data via SSH. In this case I am using RDP over SSH.…

Folding@Home Growth Forecast

Native petaFLOPS Barrier
Date Crossed

September 16, 2007

early May 2008

August 20, 2008

September 28, 2008

February 18, 2009

Is growth in the processing…

Active SETI? - no thanks

TV and Radio signals from Earth have now traveled about 60 Light years. Luckily, even if the TV/Radio signals were intercepted by aliens, the signals would be very weak and jumbled together. It does give away our…

© 2005-2024 Craig Mayhew