Wednesday, 6 January 2016

Monitoring Domain Name Expiry with Nagios / Icinga

For a while now I have wanted a way to actively monitor my domain names to alert me to their pending expiry. I didn't want to rely on my DNS provider emails as I simply don't trust they will come through and not end up in my junk folder.

After hunting the internet I couldnt find anything useful to plug into Nagios / Icinga, so I wrote my own. It can be found in my GitHub account here:



By default it will warn at 30 days, and go critical at 7 days.

It is written using the underlying linux whois command line. Some extremely basic string parsing is used to discover expiry date information. The Ubuntu python3-dateutil package is used to understand the written dates for comparison.

Currently I am using this to monitor a handful of domains using the following TLDs:
.com, .org, .net,, .uk,,

Please let me know if you have any suggestions on improvements.

Sunday, 1 February 2015

Using OpenVPN to access your home from the outside

I have become a big fan of OpenVPN recently and it is a much safer way of having access to your home equipment than exposing your entire home network directly to the internet.

Also, it means you can run any number of IP based services without being limited by your single public IP given by your ISP, and we all know IPv4 addresses are running out.

I bought a TP-Link ethernet router (TL-WR1043NDv2) after watching a video on OpenWRT / Gargoyle and finding out that the custom Linux router OS was officially supported. It was a very quick task to flash the device and I had OpenWRT / Gargoyle running, but I am happy to have done so.

First of all, Gargoyle proved to be much more stable than the stock firmware.

Then I discovered the OpenVPN integration. A few button clicks and it was all configured. There was some other things I needed to do:
  • Use a dynamic DNS provider: I chose for this as it was free, but more importantly I could update my public IP address directly from wget / curl / linux command line.
  • Configure my stock ADSL router to DMZ and route all traffic to the Gargoyle router.
Once this was all done I jumped on my Android phone and tested it using the OpenVPN Client. Success!

Why did I do this? To access my Raspberry Pi security camera of course!

I love open software and recommend everyone else checks if open source software is supported before buying your next hardware device. I don't mind paying for good software, but there's something liberating about the freedom open source provides. More open source developers need to have great big Donate buttons always available!

Wednesday, 13 August 2014

Upgrade SSD without re-installing Windows

Recently I bought a new SSD. Faced with the hassle of reinstalling Windows and all the apps associated I thought there must be a better way. Happily there is and its already documented.

Use Linux and clone the disk across.

Short answer: Attach both disks to machine, doesn't matter how, USB or SATA or both is fine.
  • Boot Linux (Ubuntu 14.04 look for "Try Ubuntu without Installing") 
  • Open terminal and identify disks using "sudo fdisk -l" (warning, make sure this is right or you'll destroy your original disk) - for me, /dev/sda was original, /dev/sdd was new. 
  • Once you *know* you have the right details (double check, this parts dangerous) then clone the disks using "dd if=/dev/oldDrive of=/dev/newDrive". 
Using dd to clone the whole disk (otherwise known as block device) will take the whole partition table and master boot record across to the new disk.

When done, remove the original disk and install the new disk properly, turn on the machine and you're almost done.

Final step: re-size the partition to use the whole space in the new disk

Tuesday, 29 July 2014

pt-query-digest on Windows (Percona Toolkit)

At my current job I am forced to use Windows 7 and do not have access to a Linux virtual machine (I would prefer to use VirtualBox running Ubuntu on my local machine for access to Linux tools).

Instead, to get access to Linux style tools, I have to rely on Cygwin. Cygwin is a great project offering many tools for use within the Windows environment. Percona Toolkit requires Perl, a common scripting language on Linux.

Thankfully, Cygwin provides a Perl interpreter which works well with the Percona Toolkit. You may need some additional packages installed, but this isn't too much hassle using the Cygwin setup program.

Tuesday, 27 August 2013

Download Google Location History Reporting

To download your Google Location Reporting History please make sure the following:
  • Location Reporting History is enabled on your device.
  • You are logged into your Google Account.
  • Click the following links to download your personal Google Location Reporting History.
  • All times are in UTC.

Saturday, 8 June 2013

Long duration (3 day) time-lapse photography on Android with Tina Timelapse

Time-lapse photography is a cool thing to play with and can be useful in many situations such as watching plants grow or paint dry or clouds fly past - all very interesting things when it happens hundreds of times faster than in real life!

But how to do it on the cheap with a spare android device and how to surpass the issue of running out of space?

Very high load on Ubuntu 12.04 Virtual Host with idle KVM linux guests

I have just managed to resolve an issue where my Ubuntu 12.04 64bit virtual host machines were running at an extremely high load even though everything on them (host and all guests) were running idle. The answer was all about VirtIO drivers. Read on for more...