Thats all my domains now moved over to the new host.
7 years ago I started hosting with Digital Ocean. At exactly 0218Hrs on Friday 23/08/2013 I made my first $5 droplet – and that $5 droplet worked exceptionally well. I had automated backups and with VAT it came to around $7.20 every month. Not a lot by any stretch of the imagination.
The existing VPS was destroyed at 1655Hrs, Monday 30/03/2020 – meaning that droplet ran for exactly 2411 days, 14 hours and 37 minutes. Or 6 years, 7 months, 7 days, 14 hours and 37 minutes – give or take a few seconds. Its a good thing I waited until today to destroy the droplet otherwise there would be an extra calculation due to the DST difference!
But anyway. Onwards and upwards. My new host is £1.20 per month for each server, with a £10 setup fee. I currently have 2 separate servers running – for both reliability and to ease strain as a new customer. So far I’ve spent £16.80 per server for 3 months. Thats £5.60 per month each, so £11.20 per month. Making it a tad more expensive.
Just for information. I just spent the last hour dealing with Digital Ocean’s Billing API to obtain all the following figures – then attempting to use jq to parse this data – and finally excel to do some quick calculations. I also used , and  in my quest to save time.
Im going use the rounded up value of 6 years and 8 months for the following math – exactly 80 months.
I’ve had a total of $110 in Digital Ocean credit over those 18 months — this includes welcome credit and referrals. Over the 80 months I spent exactly $427.04. Minus that credit brings the total cost to $317.04, so per month that equates to $3.96. Not bad, and still under the $5 cost it should have been! Converting that into UK Pounds equates to roughly £3.15 per month.
As I said my new server is only £1.20 per month, but there’s two of them, so £2.40. A whopping 75p per month saving.
However – I still have to factor in that £10 (each) per server set upon cost – and if I take the average of 80 months £20 becomes £0.25 per month.
All totalled, It looks like i’ll be saving around 50p per month.
Damm. I wish I had done the math before the moves.
Last night I figured I would give the Nvidea GeForce Now service a quick bash. All the details about the service are on its website, however it provides you with a cloud gaming computer for free (with a 1 hour play limit per session), or for £5 a month, up to 6 hours playing (plus some added extras).
I have an old gaming PC. It struggles to play anything modern. I don’t really want to spend any decent amount of money getting the components together and building/upgrading a PC.
I have a 2012 mac mini which is my main computer, and a 2017 Surface Pro that I use for general tasks that require windows, in addition to my other iOS devices. Both the mac and the Surface Pro handle the GeForce Now service like a champ. It’s a shame there’s no iOS app at present, but it is available on Android.
To help illustrate this point I loaded up Destiny 2 and used the free GeForce Now service. I sat with the Surface Pro in the living room perched on my lap, Xbox controller connected (because I really can’t play with a keyboard and mouse on a game that I’ve spent years playing both it and its predecessor on a controller) and it worked almost flawlessly. Given it was a wireless connection (but 5Ghz) I had a couple of streaming hiccups – both of which lasted under 1 second and the game (and I) recovered from. This was while watching the launch of the Antares Rocket Cygnus NG-13 live via NASA TV.
We’re living in the future.
I know this won’t appeal to hard core gamers, and possibly not even to streamers because of the bandwidth that will be required, but for me, a filthy casual, it’s perfect. I can now get Destiny 2 at 60fps that’s buttery smooth (and actually loads the menus exceptionally fast). The 1 hour playtime doesn’t bother me just now – but to honest – this is the kind of service I won’t mind paying £5 per month for.
There comes a time when everyone makes a mistake with computers. Garbage In Garbage Out and all that jazz. I seem to just like shovelling a large amount of Garbage into my servers. Take this evening for example.
I have one domain left to transfer to my new servers. The third last one was this blog and that went almost without a hitch. There were some wordpress-related things I hadn’t accounted for but nothing I couldn’t handle. The penultimate one was another wordpress installation that went much smoother after I transferred this blog.
And then I started preparing the move for the last domain. I’m being careful with this one because I know things will go wrong given half a chance. I’ve been checking and re-checking everything and decided to start to the process this evening.
First up was to update the existing code on that domain so that I could transfer everything fresh. That has a small hiccup which ended with me erasing (thanks to an errant FTP command) almost every folder and leaving but a handful of files behind.
Panicking, I managed to copy a new instance of the software over however in my haste this overwrote the main configuration file. Thank goodness I managed to remember some very old username/password/database combinations.
That ended up being rescued and is now working fine on the old host.
Whilst running about I then tried to login to my new host and managed to type with my ham-fists the incorrect password a few times and put my own IP address in a fail2ban jail.
I managed to get a remote KVM Console running via my hosting provider, and took myself out of the fail2ban jail. Now, I’m not entirely sure why I thought this was a good idea but I seen this button and figured I should click it.
Now I’m no new entrant to linux and its ilk. I’m also not a stranger to Windows – and my organisation requires the use of Ctrl+Alt+Del to initiate a login. Completely forgetting that Ctrl+Alt+Del on Linux restarts the server I click the button. No confirmation. No warning. Just a graceful restart.
I’ve recently found myself in that awkward situation where I’ve chosen a (very) secure password for a root MySQL user and I’ve forgotten it. I suppose its the most secure password I’ve had then because even I cant use it to login to the MySQL database – not that you should be using a root account under any circumstances – this was debugging.
I’ve had this happen before and I’ve used the
trick that stops the MySQL server, starts it up with no password, allows you to change the password, then stop and restart the server with the new password in force.
Ideally I wanted no downtime (even for those few precious seconds). As usual, google ended up pointing (to me) to a unknown way to reset the root password using another account that has full root privileges in a standard Ubuntu install.
I don’t post too much personal stuff on this site. I never have. However, I’m getting married this year, and, as is the done thing now, I’vewe’ve decided to have a wedding website.
I’m not going to post a link to it, again – personal, but I am happy to discuss what I’ve done and how I’ve done it.
First off, I had to figure out what the website would be for – there’s the standard of letting guests know about the location, the date, the time, the plan, the food etc – and I wanted it to be custom. I’ve never been one to pick an off-the-shelf product when I can roll my sleeves up and get handy with code.
I also wanted an RSVP system – something fast and efficient that would be easy to use.
I started by looking at othersites. We have a few weddings to attend this year and browsed a few of the sites offered. They all offered the functionality I was looking for but just not what we wanted.
I started off with hosting. As per this post, I’ve now found decent, reliable hosting at a frankly absurd price (£1 per month! – Affiliate link). As long as you have some System Administration and Security know-how – its a cinch to set up.
I’ve also bought myself an email hosting service that was discounted during Black Friday from MXRoute. It came to a total of $10 annually. It also now routes most of my other mail. This is also important as I didn’t want to use the built in PHP Mailer.
Next, I went with the tried and tested versatile can-do-anything site maker, WordPress. I had toyed with the idea of self coding everything but after seeing what was available, there was absolutely no need.
I kept the standard theme from WordPress, Twenty Nineteen and set about making the pages. My next hurdle was the RSVP, and there’s a plugin that’s designed just for that, which I ended up getting direct from the authors site – however it looks like I managed that timing particularly well as they only offer it via the WordPress site now. Functionality looks similar but your mileage may vary.
To keep the whole lot safe I’ve installed a couple of more security conscious plug-ins to stop spray and focused attacks, and replaced the built in wpmail() function with a plugin that allows me to specify my own mail server.
Designing the invites was done via a Wedding stationary company, but for the RSVP code also came in handy. I created a very small snippet that took a selection of letters (with obvious easy-to-mistake letters removed) and set about making unique 3 letter codes for each guest to RSVP. That, coupled with an Excel spreadsheet to get all the data in a nice format meant a bulk upload to the RSVP plugin was easy.
For making the RSVP cards I decided to purchase a small Brother QL-700 – normally £40 but I managed to get a (hardly) used one for £20. 62mm labels with unlimited length came in at a pitiful £5. The Brother software is actually pretty flexible and can take an Excel (or CSV) file as an input database and allowed me to print, to sticky labels. I made use of the append
(C1 & "TEXT" & C2)
function in excel to get all the individual columns set the way I like and the software allowed certain columns to be input as a QR code.
It turned the Excel spreadsheet from similar to this
And allows labels for postage to be printed.
The website will stay the way it is until the day of the wedding, at which point I’ll make the whole thing a PDF document, and remove the site and replace it with any images that are shared with us by our friends and family attending, with an option to download the original in a PDF form.
I’ve always been careful lucky when it comes to my devices and I’ve never cracked a screen or body. I’ve always had my devices in cases and generally use screen protectors.
My iPad Pro was the first I didn’t use a Glass Screen Protector – and I’ve paid the price. Don’t get me wrong – I had one fitted as soon as it was picked up, but the Apple Pencil never worked right with it so I had to take it off.
The iPad is approximately 1 year and 2 months old and I didn’t have Apple Care. That’s important, because if I had Apple Care (an extra £129) the cost of repairing this small mishap would be £39 – a total of £168. I’ve never had any accidental damage so I’ve never needed any type of insurance. However, because of the glass crack I figure it would be better to have it replaced. The cost for what Apple deem an “out of warranty” repair is £496.44 – or about 65% of the cost of a new iPad Pro 64Gb 11″.
I’m now trying to figure out the most cost effective way of having it repaired/replaced.
It’s Annual Leave time. Seeing as I’m not going away anywhere that means I have to fill my time with other things. This time, I’ve decided to migrate hosts. Oh the joys.
I have approximately 10 domains to move, database to migrate, files to transfer and DNS changes to propagate. This is going to be fun.
Why? Cost. I currently pay around £9 a month for my current hosting, which is to a company based in the US. I recon I can (safely) get it down to around £2 per month, maximum. Thats roughly 77% less. The hosting for the sites I do isn’t mission critical. Its still just a hobby. The £2 a month hosting should be more than adequate for my needs.
Because I’m lazy I figure a script will help with some of the automation. I’m using Apache VirtualHosts, and because each domain requires a separate VirtualHosts configuration file, I created this script. It doesn’t have the full configuration in it, but its enough to help you get started. I also output the command required to enable each configuration into a separate file, which can be viewed here.
Update 1: Most of my sites have been transferred over with no issues. All DNS records have been updated and appear to be working fine, apart from Virgin Media dragging its heels and apparently (still) not adhering to TTL values.
This one, and my busiest have yet to be moved. Im contemplating moving these two to a separate server, and at £1 per month, I don’t see why not.
Well. That didn’t go to plan. I managed to hook the PiDashCam up to the car. It powered on fine, and has recorded, however I forgot to change the settings and it recorded in 10 second blocks. I also mounted it incorrectly, so it sort of sat at an angle. I also went out when it was a bit dark so the images are really not great. The worst part, however, is that the Raspberry Pi Zero didn’t seem to grab the time from the RTC Module. I’ll need to do some digging and figure out exactly where its all went wrong…
The camera, although a lower resolution, appears to capture more of the image. Its a shame it appears very hard to see properly, but I’m hoping thats to do with the camera_mode, or possibly the sensor. More tinkering required!
I’ve also been thinking about having a simple way to change the camera_mode when recording. I think I’m going too implement a 3 LED system, using Binary counting, so show which camera_mode I’m using. I’ve have a (very) quick look at Alex Eames code for button presses here and think I can change this so that a quick press is camera_mode, a longer press is stop recording (useful for when I have it hooked up in the house to view files instead of running pkill every time I log in), and a long press is shutdown. Ultimately the first press can be used as a “protect” marker on files should it be required, but I’m getting ahead of myself!
# The following Python code has been copied from https://github.com/raspitv/bikedashcam/blob/master/dashcamcorder.py - Alex Eames and Raspi.tv
# this will run until button on GPIO13 is pressed, then
# if pressed short, stop recording
# if pressed long, close program
# if pressed very long, shutdown Pi gracefully
print "Waiting for button press"
print "Stop button pressed"
# poll GPIO 13 bottom button at 20 Hz for 3 seconds
# if still pressed at the end of that time period, shut down
# if released at all, break
for i in range(60):
if 25 <= i < 58: # if released between 1.25 & 3s close prog
print "Closing program"
if not GPIO.input(13):
if i >= 59:
So, after being alerted by the Raspberry Pi Weekly mailing list to a liveblog by Alex Eames detailing his process for building a biking “dash cam” I thought I better start detailing what I’ve done, what I’m currently doing, and what I plan to do with my PiDashCam project which has taken a back seat for a number of months years. I’ve watched the videos Alex has made, but not yet looked at the code. My first post was using an Original Raspberry Pi with no camera attached, hooked up to a GPS module to ensure I got valid GPS data, and a small SPI screen so I could view the data
Unfortunately work and life took over and apart from spending a few odd minutes here and there over a number of months, no real advances were made apart from this update in which I was now testing with the Raspberry Pi Zero W, and figuring out how to get it talking to the GPS module, with the accelerometer, button and RGB LED all hooked up (but still no camera).
I’m now going to try and update here with that I’ve decided upon, some new design goals and design directions, and the code needed to run my PiDashCam, in addition to stripping back to the bare essentials (you know, like being a camera).
I’ve remained with the Raspberry Pi Zero Wireless and I have an RTC Module hooked up, in addition to the camera, and one button. At present, the Pi boots, and automatically runs two scripts.
The first, record.py, grabs the date and time, starts the camera, and starts recording, updating the annotated text on the screen. It then outputs a new file named after the current year, month, day, hour, minute and second (YYMMDDHHMMSS) every pre-determined number of seconds (roughly). You will be able to view this source code on GitHub as soon as I get round to uploading it. It also annotates the current date and time, and the current camera_mode.
The second, start.py, simply waits for the button press. At present it only detects an on push, nothing fancy like a multiple second hold. It then gracefully pkills the Python Process that is controlling the camera and after a few seconds delay, initiates a shut down of the Pi.
As its a bit unwieldily at present, I’ve stuck and blu-tacked it to a cheap dash camera I bought from eBay or AliExpress at some point or another.
The camera works when testing in my house. I’ve still to take it a road test and make sure it works. I have a second, cheap Dash Cam that was another eBay or AliExpress special that does what it needs to do, but the quality is pretty poor. I plan on keeping both cameras connected and comparing the output. If I cant at least match the quality of a sub £20 Dash Cam then there’s no real point in continuing this one.
My Plan is as follows
Test the camera, make sure it works in the car
Test multiple camera modes with the First Edition Raspberry Pi Camera
Test multiple camera modes with the Second Edition Raspberry Pi Camera
Test multiple camera modes with a cheap FishEye Pi Camera
Add in GPS Logging
Add second button for marking of emergency record
Add in G-Sensor for additional annotation and Emergency Record Function
Create a settings style file where all user-selectable settings are set
Put it all in a nice case
Work out a way to convert the raw h264 files to a usable mp4 format
Build a nice web-based interface with an API so that apps can access the files/settings via Wi-fi
Integrate with the CAN-Bus to take car data for better analysis of driving etc.
After each quality check, if the quality is not something that is useful then it could be a cancellation of the project. I’m trying to provide a more organised, and focused attempt this time and having these Design Goals will ensure that I focus on what’s required without jumping ahead. As always, I’m a great started and terrible finisher, but hopefully that will change!
In addition to the PiDashCam, I’m Aldo going to try my had again at small electronics. I’ve had a plate of 100 of these WS8211B RGB LED’s, and due to the way I stored them, they managed to snap. Playing about with the layout meant I could resonable build a Binary Clock, which I’ve wanted to do for quite a while. Given how many I had though, I figured I could extend this out and make it alternate between a Binary and Regular clock, and seeing as I have an ESP8266 spare, this could all be controlled wirelessly, with the time updated from an NTP server. But, there will be a separate blog post about that!
Updated 20/02/2019 with correct links to Alex Eames blog and minor technical details.