My Standard Pi Server Setup

I mostly use my Raspberry Pi's as mini servers without a desktop environment, and I almost never hook them up to a display or a keyboard & mouse. So these are the steps I take to flash the SD cards in order to have them already configured to connect via SSH on a known IP address from their very first boot.

Get the image

Raspberry Pi Foundation provide "light" versions of the SD card images without a desktop environment for use in server type scenarios directly on their [raspbian downloads page](https:/...

Disable swap on Raspbian Buster

Most of the articles I found in searching for how to do this instructed running these commands at the solution to disabling swap on Raspbian Buster:-

$ dphys-swapfile swapoff
$ dphys-swapfile uninstall
$ update-rc.d dphys-swapfile remove

However, after a reboot, swap was re-activated.

After a bit more poking around, I got to permanently disable swap with the following:-

``` $ dphys-swapfile swapoff $ dphys-swapfile uninstall $ update-rc.d dphys-swapfile remove $ rm -f /etc/init.d/dphys-swapfile...

Setting up logging & metrics in your app

Before we begin, I want to share my point of view on an area of development related to this post.

Singletons, static references and global variables all share a few things in common - they are misunderstood, miss-used and generally considered evil by most top-rated answers to related questions on stack overflow!

However, almost all of these answers that I have seen incorrectly link them to and assume that they are somehow always allowing modification of global state (which is bad). The main problem wi...

Front-end optimisations

In an earlier post, I looked into replacing the Silex PHP framework I originally used to setup this blog (It was my "go-to" framework of choice at the time). Once again, I have to hold my hands up and admit that I have been guilty of just using my "go-to framework" and building upon it without really evaluating if it was the right time and place to use a framework - this time, on the front end.

My front-end framework of choice is currently [Foundation by Zurb](https://foundation....

Radeon VII and Ubuntu 18.10 / 19.04

I've been very impressed by the performance and stability of my Ryzen 1800X CPU and AMD's overall approach and commitment in supporting OpenSource development with their drivers and other software.

So when they announced the Radeon VII at CES this year with performance figures comparable to my current nvidia 1080Ti's I was keen to get my hands on one.

When they went on sale on February 7th a colleague snatched my hand off to buy my 2 x 1080Ti for a little over £700 and I got my order in for the AMD card...

Removing Silex

I developed this iteration of my blog platform as an exercise in Event Sourcing and CQRS. As such, I did not want to spend too long learning the ins and outs of a new framework, so I fell-back to one of my old favourites to fill the gap of HTTP request routing and configuring controllers - Silex.

However, not long after I deployed the first version, Silex's creators had decided that Symfony had become so modular that in its smallest version it was essentially the same size and as easy to use as Silex - and...

Cross-server lock with MySQL and PHP

This is a quick solution for a problem I've come across a few times recently when it comes to running "single tasks" in High Availability or Scale Out deployment scenarios.

You might already have a HA solution and you need to introduce a cron style task, or you might have an application that already makes use of cron scripts bit it runs on a single server and you want to introduce HA and/or scale out.

The first thought that springs to mind might be to have a concept of a "master" and one or more "slaves"...

Is it time to ditch Frameworks?

In the last two and a half decades that I have been a "web developer", things have come a very long way. Languages like JavaScript and PHP have grown from quick scripting tools into the cornerstone of the software which many enterprises are building their business critical systems with. As these languages have matured so have the ecosystems that surround them.

(I'm just using PHP and JavaScript as examples because those are the ones I have used the most in my years as a developer)

We now have quick & e...

Exploring life beyond PHP

PHP has come a long way - especially in the last few years. It has gained some excellent language features that make it great for both "quick and dirty" projects as well as larger "enterprise" ones - where more time and thought is normally given to testing and deployments.

It's the ecosystems around the latter type of project that I am going to experiment with something a bit different - because once you get past the "just hit save and then refresh" method of development - a lot of the rationale for choo...

Wildcard SSL certs from Let's Encrypt using acme.sh and Route53

Getting started with Let's Encrypt certificates is pretty straight forward with the tools available now, especially if you are just needing a certificate on a single server. Certbot's website has a great guide covering all major web-servers and linux distros which can get you up and running in minutes.

However, things can be a bit trickier when you want to get certificates for use "offline" in systems which are not directly accessible from the publ...

Network Speed Testing

Tools like speedtest.net are great for testing your general internet speed.

However, if you get slower than expected results they are not usually very informative as to where the slow down is. It could be your local network or WiFi, your internet connection or even the server at the destination end could be overloaded. They are also virtually useless for testing other sections of network which will normally run at speeds much greater than your actual broadband connection.

As...

Relaunching Soon

I am working on relaunching this blog soon. Probably for about the 5th time!

Having somehow managed to keep backups of my old blog safe since 2005, I was having a read through the old posts only to find that, to be perfectly honest with myself, 95% of what I was writing about was total rubbish and not worth keeping backups of - never mind restoring into this incarnation of the pheonix!

In order to hopefully motivate myself to keep the blog going properly this time, I am setting myself some ground rules:-...