Today I Learned, Web Technologies

Emmet Toolkit

When someone says “Emmet” to you what come to mind? Your answer might depend heavily on your age. I think of this guy… If you are a little younger or have kids you might be picturing this guy… Although both these guys could help you out I’ve recently discovered an even more helpful Emmet. What […]

Today I Learned

awk – Introduction – Part 2

Yesterday I introduced awk and showed how it could be used to parse and edit structured text files. If you read that you will remember we had a text file called programming_languages.txt and it looked like this: We finished by running a single awk command on it to output the 2nd and 4th field of […]

Today I Learned

awk – Introduction – Part 1

I’ve been using Linux for 10 years and I’ve avoided looking at awk. Like most people I tend to reach for the tool that feels most familiar. If I want a quick script for processing a text file I’ll go to Python. Today I decided to bite the bullet and take a look at what […]

Today I Learned

Right sed Fred

Thought I’d do a quick summary of the sed command in Linux as I’ve found myself using it today. There’s a lot to it, so much in fact it’s a whole chapter in the Linux in a Nutshell book I found the other day. Overview sed is a stream editor. Inputs or streams flow into […]

Today I Learned

Python validators module

You know what’s never easy – Regular Expressions! I appreciate how powerful they are and I appreciate all those Stack Overflow answers where people share their magical incantations. I recently needed a regex for validating if some user input was a valid domain. Google showed by lots of answers which were fit for purpose but […]

Today I Learned, Wordpress

WordPress has a CLI

So it turns out WordPress has a CLI! I’m not sure how this had passed me by but I’m really pleased I’ve found it. WordPress installation is famously easy but automation is always a good thing. Installation is really straightforward so I won’t repeat the instructions here. Here are some of the commands which caught […]

Security, Today I Learned

Encrypting Database Backups

Following on from yesterday’s post I thought I’d use my newly acquired knowledge to streamline the encryption of my database backups. In theory I could just create a bash script that: Creates the backup. Encrypts the backup. Deletes the non-encrypted version. This is fine, it works. I have two issues with it: Passing the password […]

Security, Today I Learned

Encrypting Files

Today I was doing some research into the best way to encrypt files. My main use case was to encrypt my database backups prior to uploading them to cloud storage. So my criteria were: Could be run from the command line as most of my servers are Linux. I didn’t want to give the password […]