Posts

  • CSP: Can See Purpose

    What is a Content Security Policy? What problems does it solve? How can I use it to make my site more secure? How do I implement it without breaking my site? These are the questions I’m aiming to answer by sharing my experience of implementing a strict Content Security Policy while not breaking anything.

  • BrisPHP News - Q3 2018

    I co-organise the BrisPHP Meetup and at the start of every meetup I give a quick talk on recent news and other interesting things that have been happening in the PHP world. This quater the biggest things have been PHP 7.3 and MySQL 8.0.

  • My Journey with Terraform - Part 3 - Infrastructure as code

    Over time I’ve learnt a lot about Terraform and using it to manage infrastructure. Most of the knowledge I have today has come through trial and error, and a constant desire to always do everything a little bit better than last time. Understanding the value in Terraform can be a long journey, one that a lot of people just don’t take. Especially when you can easily click around the AWS Console and have what you need in half an hour or so, when it would take you days or weeks to gain enough understanding in Terraform to accomplish the same thing.

  • My Journey with Terraform - Part 2 - Script the hard parts

    This is part 2 in my series about how I learned Terraform. In each part I’ll go over new things I learned and how Terraform convinced me to never create infrastructure by hand again. You can read part 1 here.

  • My Journey with Terraform - Part 1 - Dipping my toes in

    A couple of years ago, I heard about a tool called Terraform. Our devops guy from work had just started using it and said it was pretty great. For me, that triggered a long and steady process where I started to use Terraform more and more until now I couldn’t even imagine myself doing devops without it. Recently, I’ve been telling people how great Terraform is and how much they should use. I’m generally met with skepticism, they’ve heard how powerful Terraform is, and that makes them wary. Everyone who’s ever managed any IT infrastructure knows how fragile and finicky can be, which makes them understandably cautious about automating the lot of it into a single bash command that has the power to bring your entire business to a halt if someone accidentally runs terraform destroy.

  • How to easily contribute to your composer dependencies

    Sometimes you find an issue with one of your composer dependencies. You’d like ot fix it, but it can be difficult to test the changes within the context of your application because you have to constantly push to your fork and run another composer update.

  • BrisPHP News - Q2 2018

    I co-organise the BrisPHP Meetup and at the start of every meetup I give a quick talk on recent news and other interesting things that have been happening in the PHP world. Here are the things I found intersting in the second quater of 2018.

  • Make PhpStom automatically reload files from disk

    I often have an issue with PhpStorm where I switch to a terminal and run some commands which change files (ie. php-cs-fixer, git pull, etc), then when I go back into PhpStorm and continue editing I’m presented with this “Changes have been made in memory and on disk” dialog:

  • Parsing flags in bash scripts

    I’m very lazy. I don’t like to do things more than once. So, when I have to run a command a lot when developing (for example, to clear the cache, update the database or install dependencies), I will often write a bash alias for it so that I have less keys to press. However, sometimes these shortcuts I have are useful to the rest of my team, in which case I’ll put them in a Makefile, so that everyone can benefit and also update them. However, sometimes you need parameters being passed into the command which gets difficult with a Makefile, so I move onto a bash script.

  • Setting up HTTPS redirects behind an AWS load balancer

    The easiest way I’ve found to set up https is by creating a free https certificate with AWS Certificate Manager and adding it a load balancer. You then put a webserver behind the load balancer listening on http port 80 (because the load balancer terminates the https connection).

  • How to reuse packer builders

    When I’m setting up a new web app, I like to use packer to bake an AMI with everything required to run the app. Then I use some other tool to deploy the latest code changes to each instance.

  • BrisPHP News - 1 March 2018

    I co-organise the BrisPHP Meetup and at the start of every meetup I give a quick talk on recent news and other interesting things that have been happening in the PHP world. Here are the things I found intersting in the first quater of 2018.

  • Terraform refuses to destroy RDS instance without a snapshot

    Recently I created an RDS instance for testing using Terraform. Since it’s just for testing, I didn’t want to store a final snapshot when I destroyed the instance. However, when I ran terraform destroy I presented with an error:

  • How to fully support MySQL UTF-8 with RDS and Doctrine

    If you’re reading this it’s probably because you’ve realised that MySQL’s utf8 encoding isn’t really UTF-8, despite what it says on the packet. The reason behind is because UTF-8 stores characters with anywhere between 1 and 4 bytes, depending on the character. MySQL’s bodged up form of UTF-8 can only use 1 to 3 characters. There’s a bunch more detail about this which you can read about in the links posted at the end.

  • How to setup a Jekyll powered GitHub Pages blog

    I finally got around to creating a Jekyll powered blog running on GitHub pages, and it was much easier than I thought. There are only a few steps involved:

subscribe via RSS