Setting Up MySQL Replication as a back-up solution

Introduction MySQL servers can be a single point of failure if you have not set up a good back-up infrastructure. It is difficult to get a good back-up infrastructure in place, without some time spent out of service. However, a MySQL replication server avoids this downtime. One server will act as the master, and the other will act as slave. The slave will be paused and then backed up.
Read more...

Configure Autofs on Arch Linux

What is Autofs? It mounts a filesystem that is not always connected (e.g. network or device). Once a connection is made to that device, then autofs will handle the mounting of that device. It can also handle unmounting of a device, if it becomes unavailable. /etc/fstab automatically tries to mount during boot - however, it won’t try to mount once a device is connected after boot. You may boot whilst you have no network access - this means that you won’t be able to mount that device.
Read more...

Sync Google Calendar With Org Agenda

I use org-mode an awful lot - it helps me manage my tasks and code all in one place. However, the organisation that I work for have just migrated over to Google Suite and manage meetings extensively using Google Calendar. I really wanted my Google Calendar to sync with my org-agenda. Org-agenda is a tool that pulls in any scheduled activities from all your files in to one dynamic view.
Read more...

How to create an instance that pulls your website content automatically

Amazon Web Services allows you to spin up instances very quickly. This how to will show you how to upload your content to a S3 bucket and then launch an instance that pulls that content in and starts Apache to serve that content. Initially, you will need to create a role under IAM. This will have to be able to access S3, so create the role, choose which service you would like to associate it with.
Read more...

AWS - How to Create A VPC

AWS allows you to create your own virtual private cloud (or VPC). This is a network within which your machines will communicate. You can control the level of access across your VPC through subnets, Network Access Control Lists and Security Groups. Network Access Control lists allow particular traffic in and outbound, but are stateless; that is, if you allow traffic in, it doesn’t necessarily mean that traffic will leave the network.
Read more...

AWS - How to Serve Traffic from a Load Balancer

Amazon Web Services (AWS) allows you to serve private network traffic from behind a public load balancer. This offers extra security benefits as it detects DDOS traffic and other exploits and offers a layer of protection. There are some things you should know before you start this tutorial. You should know: How to create a VPC How to configure subnets How to create an EC2 instance How to ensure an EC2 instance is within an particular subnet How to ssh to an EC2 instance You will create a new VPC.
Read more...

Finding large files in a directory

I have directories that agedu shows as having large files. However, agedu doesn’t tell me what the names of the files are. A quick find will sort that find . -maxdepth 1 -type f -exec \/usr\/bin\/ls -al {} \; | awk '{print $5,$9}' | sort -nr > bigfiles.txt Run this, and you will have a file called bigfiles.txt that has the size in bytes and the filename. This does not work recursively, with the flag -maxdepth 1 preventing that.
Read more...

Using sed

sed is a quick command line utility to change text within a file, or input stream. Typically, it is used within a pipe situation (i.e. using the character | on the command line). If you are not familiar with that command, you will need to research that before continuing. A simple use of sed is to replace characters in a stream or file. This is done using regular expressions. This will help you search for a set of characters and then replace them with the alternative.
Read more...

Bash find command

Find command I’ve been using the find command simply since I can remember, but I’ve never really got to see the true power of this command. Combined with the -exec flag this command can throw up a lot of different uses. -exec allows you to work with other bash commands and operate on them. A basic use would look like this: $ find . -name "*" -type f -size +10M -exec rm {} \; Let’s break this down.
Read more...