Dig - DNS Querying

Dig is a DNS lookup utility that can be useful for checking your DNS is answering queries correctly. Install Dig One can install the dig tool with the following command sudo apt-get install dnsutils Query DNS If you want to query your current default DNS for a hostname, then simply…

Read this article

NGINX CLI Cheatsheet

This cheatsheet is just for the commands you can run for Nginx and is nothing to do with the configuration files. Test The Configuration If you make a change to your configuration and want to check that everything is okay before having the changes take effect, then use this command.…

Read this article

GlusterFS - Distributed Volumes With Different Size Bricks

Since the 3.6 release of GlusterFS, it has apparently supported bricks of heterogeneous (different) sizes. I was keen to test this out, because it resolves the biggest reason I had for not using GlusterFS. For this tutorial, I am going to be setting up a GlusterFS cluster on Debian…

Read this article

Debian8 - Install GlusterFS 3.8

If you install GlusterFS from the Debian repositories, then you will get version 3.5.2. The scripts below will install the latest version of GlusterFS 3.8.x so that you can make use of later features like better support for heterogeneous bricks. This tutorial is only for showing…

Read this article

Ubuntu 16.04 - Install Mailtrain

Mailtrain is a "clone" of Mailchimp, but is free and opensource. It also integrates with multiple email sending services, such as Amazon SES and SendGrid. Below is a BASH script you can run to deploy Mailtrain 1.2 to your Ubuntu 16.04 server. Unfortunately it must be run as…

Read this article

Debian 8 - Install GPG Extension for PHP 5.6

Below is a script you can run to install the GPG extension for the PHP 5.6 CLI and Apache on Debian 8. It may work on other distributions and versions of PHP, but I have not tested that. The script assumes you already have Php 5.6 and Apache…

Read this article

Introducing prog-exec

In a bid to try and make the sharing and executing BASH scripts safer whilst maintaining convenience, I am going to be introducing automated hash checks and digital signatures. This checking will be handled by your local computer using the new prog-exec script that you will need to install (instructions…

Read this article

Using cURL with BASH

Piping cURL directly to BASH is very dangerous. If a random stranger sent me a command like below, there is no way in hell that I would run it, and you shouldn't either. curl -s https://my-script/23 | bash That being said, I often do post similar commands on my…

Read this article

Debian 8 - Install PHP 7.1

Using Ondrej Sury The easiest way to install PHP 7.1 is to use prog-exec. prog-exec "23/2" "2649c263665a6224262882b6abb46ad49cc6935654e56a62a1cdfb70c353b02e" Alternatively, you can copy and paste the following script, which is what the previous command downloads and executes. #!/bin/bash sudo apt update sudo apt install apt-transport-https lsb-release ca-certificates -y sudo…

Read this article

Dependency Injection

Anthony Ferrara has a brilliantly simple youtube video explaining dependency injection that I highly recommend. In basic terms, anywhere that you pass an object into another Class's constructor, rather than creating a new instance of that object within the constructor, you are using dependency injection. Dependency injection allows for high…

Read this article