LXD Container backup to FTP server script

As mentioned in my previous post, I would post code for a script which will backup an LXD container as a snapshot, then transfer to an FTP server. The script to do this is below, it has been tested on Ubuntu 16.04 LTS. Ensure you have these packages installed: netcat exim4 lftp curl Save this […]

Read More

Creating an LXD container on Ubuntu 16.04

I have started getting-to-grips with LXD on Ubuntu – It’s pretty great! LXD makes it possible to separate your applications into containers, and the containers run close to bare metal. I’m running LXD on my webserver (the one hosting what you’re viewing this website on), with four containers: HAProxy: Used for sending port 80 and […]

Read More

Quick and easy FTP server install on a Raspberry Pi

For this setup, i’m using Ubuntu 16.04 running on a Raspberry Pi 3. The instructions should work correctly in Debian and Raspbian too – in fact, you will probably have luck using these instructions on any Linux operating system, Raspberry Pi or not. Note: FTP is not a secure protocol, I would recommend using SFTP […]

Read More

VestaCP API firewall suspend and unsuspend bash script

VestaCP offers an API which allows the firewall rules to be changed, but I could only find examples which use PHP and cURL and I required a script which would work as a Bash script. I’ve created a script below which you’re free to use. Ensure your host URL, admin username and password are correct […]

Read More

Steps to safely remove Linux kernels (Ubuntu)

Note: Please understand, these instructions can make your system non-bootable. If you’re unsure, do not continue. If you’re trying to update the kernel and low/empty disk space errors are shown, it’s probably because the /boot/ directory is full. Use this command to see the available space of /boot/: sudo df -h Now check the kernel […]

Read More

Test your system for Spectre and Meltdown vulnerabilities

Following the outbreak of three processor vulnerabilities, known as Spectre and Meltdown; I have already patched my systems and whilst doing so, came across this useful script written by Speed47. This script checks your system for the three vulnerabilities. I found it useful to check my systems were secure after applying kernel updates. To run […]

Read More

PHP: Finding a multi-dimensional array key’s associated value

I thought I would share this simple PHP function to hopefully help anyone needing a quick solution. Imagine, you have a multi-dimensional array such as this: <?php //Example array $array = array( ‘test’ => array( ‘name’ => ‘John Doe’, ’email’ => ‘john@example.com’ ) ); ?> And you need to extract a specific bit of data, […]

Read More

Version 2.0.0: Backup MySQL (Bash script)

This is similar post to be read together with this. And a follow-up update to ‘Backup SQL files to FTP server‘ script. Version 2.0.0, now adds additional features and bug fixes: Now searches to ensure the required packages are installed. Uses ‘lftp‘ to upload files via FTP. Lftp allows multi-level directories to be created on […]

Read More

Version 2.0.0: Backup server files as tar.gz (Bash script)

This is a follow-up post with an update to the ‘Backup Files as Tar.GZ‘ script. Version 2.0.0, now adds additional features and bug fixes: Now searches to ensure the required packages are installed. Uses ‘lftp‘ to upload files via FTP. Lftp allows multi-level directories to be created on the server. Renamed configuration variables to make […]

Read More