Car exhaust attempts meiosis

We had a 12-hour power outage in my area.  This created some unusual problems, for example my brother and myself had to dig out some board games to replace our PC strategy games, notably RISK over RA2:

The United Nations army took a hammering...

The United Nations army took a hammering…

We also all took the opportunity to do some electrical maintenance around the house while the power was out, since no-one had any objection to flipping the main circuit breaker.  After that, we took a little drive out to get some food since we couldn’t cook in the house.

On the way back however, there was a loud crunch/clang followed by some harsh braking from me…  We took a look under the car and saw that the exhaust (which should comprise of two joined parts) was in two separate pieces, with both scraping on the road.  Attempting to drive forward would have wrecked the rear half, which was probably worth more than the car whilst reversing would have wrecked the front half, which was attached to the engine.  We needed to secure the exhaust before we could move the car at all.

After an initial search for my usual car-rope* returned nothing, we dug out my jump-leads and hacked together a solution:

Jump leads, stretched under both parts of the exhaust, and locked into the front doors was more than sufficient to get us home.  There were barely three inches of lead inside each door after stretching, so it was difficult to keep the leads in place while John closed the door, since I pretty much knew that my knuckles would get hit by the closing door.  Also, using the doors to clamp the leads meant that John had to take a back seat for the ride home…

The next day we got the car up on ramps, and saw the problem – the mechanic who had done my last MOT had also adjusted the exhaust a bit, and the two halves should clip together under normal circumstances but he’d fixed them too far apart.  It was a miracle that the exhaust stayed up this long, and pure luck that it didn’t collapse on a motorway at  80  69.5mph…

All in all, the jump-lead hack and some intense teamwork saved us from having to get towed at 1am, only a mile from home.

* i.e. Cat 5 ethernet cable.  This has proven useful many times in the past, not least for securing bikes to the car without a proper bike rack…

Wake-on-lan remote interface

This software provides a way to wake (via wake-on-lan) machines on a remote network.

After making my home PC accessible externally via Dynamic DNS, I needed a way to remotely power it on and off, since leaving it on 24/7 would run up a large energy bill.  I took one of my (many) Raspberry Pi computers and set up a script to log the MAC addresses of all machines detected on the network, along with corresponding IP addresses and hostnames.  This script runs periodically as a cron job, providing a list of machines by name or last known IP, and their associated MAC addresses.

A web interface allows any PC from this database to be chosen, and for a wake-on-lan magic packet to be dispatched to it.  Provided the PC is connected to the network via an ethernet cable and wake-on-lan is enabled on the associated adapter, the end result is that the chosen PC will turn on in response to me clicking a button in my web browser from 40 miles away.

The PC must be wired into the network in order to receive wake-on-lan packets, but there can be wireless links between the router/switch that the PC is wired to and the Raspberry Pi.  Wake-on-LAN magic packets are sent as UDP broadcasts in my script, although they could be in any type of container that will get routed to the target PC’s ethernet port.

Download: Remote Wake-on-LAN, MAC database scripts and web interface
Latest version (github): battlesnake/macs

Dynamic DNS server

This software provides a cheap dynamic DNS solution for anyone with a Linux VPS (or a friend who is willing to share one).

I occasionally want to access my home PC while I’m away from home, but my ISP doesn’t offer static IP addressing.  Thanks to a resurgence in the popularity of virtualisation, servers are extremely cheap to rent nowadays (as little as £3/month).  In addition to the server hosting this website (and others), I run a DNS nameserver (using PowerDNS) on one of my other virtual servers.  With this simple BASH script and a web interface, my server gained dynamic DNS capabilities and allows me to access my home PC despite the varying IP address.

The packaged script and web interface run on the nameserver, and a separate script is run on the target machine (in my case, the home PC), which curl’s the web interface periodically to update the necessary A-record.  It is important for the A-record to have a small TTL value (e.g. 60 seconds), in order to allow updates to propagate through DNS caches at a reasonable speed.  Look at the code for the PHP web interface to understand the syntax for the CURL request.

Rather than leave the home PC on 24/7 and waste electricity, I also created a remote interface to dispatch wake-on-lan packets.

Download: Dynamic DNS scripts
Latest version (github): battlesnake/ddns