Pragmatism in the real world

Autocomplete Phing targets on the command line

Shortly after writing my last post, it crossed my mind that it would be nice if I could autocomplete the targets in my Phing build file on the command line. In order to do this, I read Buddy Lindsey's Quick and Dirty Write Your Own Bash Autocomplete and made it do what I needed! Start by creating a new bash completion file in the bash_completion.d directory. This file needs executable permission. This directory can usually… continue reading.

A few Phing tips

Following on from my last post, here's a few other Phing things that I've found helps me. Hiding targets from Phing -l I have a number of dependent targets in my build.xml that I don't want listed when I run phing -l. The easiest way to do this is to add the hidden="true" property to the targets I want to hide: <?xml version="1.0"?> <project name="buildfile" default="foo"> <target name="foo" depends="bar,baz" /> <target name="bar" hidden="true"> <!– tasks… continue reading.

Using Phing to SSH into a Vagrant box

Now that I've started using migrations, I've discovered a minor irritant. I run this project on a Vagrant VM and have discovered that I keep forgetting to ssh into the vagrant box before running the migrations script. The obvious solution is to automate this and I decided to use Phing to do so. Firstly, I needed to install the PHP ssh2 extension: $ brew install libssh2 $ sudo pecl install pecl.php.net/ssh2-beta I'm on OS X,… continue reading.

My "new" blogging habit

I've just come across Andy Baio's Middling post and this bit really resonated with me: Twitter and Waxy Links cannibalized all the smaller posts, and as my reach grew, I started reserving blogging for more "serious" stuff — mostly longer-form research and investigative writing. From around September 2013, I found that I was in this situation. I was only posting here once or twice a month, mainly as I felt that I should only blog… continue reading.

Registering Doctrine Type Mappings for standalone migrations

Shortly after starting to use Doctrine Migrations as a standalone tool in my project, I came across this error message: Unknown database type bit requested, Doctrine\DBAL\Platforms\MySqlPlatform may not support it. This means that I have a column in my database of type bit which is used for booleans in SQL Server, but confuses the MySQL platform as it's not a default mapping. To support this, you need to modify the database connection's Platform object to… continue reading.

Routing specific traffic to the VPN on OS X

I have a client that requires me to use a VPN when connecting to their servers. I use OS X's built in L2TP VPN to connect, but don't want all my traffic going that way. To do this, I unchecked the Advanced VPN setting "Send all traffic over VPN connection" in the Network preferences and then created the file /etc/ppp/ip-up like this: sudo touch /etc/ppp/ip-up sudo chmod 755 /etc/ppp/ip-up The file itself is a bash… continue reading.

Using Doctrine Migrations as a standalone tool

My current project has reached the point where a good migrations system is required. As I'm targeting two different database engines (MySQL and MS SQL Server) and we're already using DBAL, it made sense to use Migrations from the Doctrine project. To do this, I updated my composer.json with the following require statements: "doctrine/migrations": "1.0.*@dev", "symfony/console": "~2.5" in order to install Migrations and also Symfony console component so that I can run it from the… continue reading.

Two incidents

An online friend of mine once said this about a sexism incident at a conference: "If I had been there, ZERO chance I would've sat idly by and let someone treat you like that" I like to believe that I have the same policy: If I am there when some casual sexism occurs, I will call it out. It turns out that this is untrue. One I have witnessed a number of incidents of sexism… continue reading.

Why I care about codes of conduct

tl;dr I want every conference to enthusiastically champion their code of conduct in order to publicly reassure attendees (women in particular) that any issues will be dealt with. I want all of us to actually notice jokes and conduct that make conferences uncomfortable for women and call out or report issues if we see them. I'm still learning how to do this, but the rest of this post goes into detail on why I think… continue reading.

Provisioning with Ansible within the Vagrant guest

I've been setting up a Vagrant VM for use with some client projects and picked Ansible to do this. Firstly, I played with the Ansible provisioner, but found it a little slow and then I realised that Ansible doesn't run on Windows. Rather than migrate what I'd done to Puppet, Evan recommended that I look into running Ansible on the guest instead and provided some hints. This turned out to be quite easy. These are… continue reading.