Pragmatism in the real world

Sharing host VPN with Vagrant

When moving a project into Vagrant, I realised that I needed the vagrant guest to share my OS X's VPN. I'm using a separate IP address within a private network like this: config.vm.network :private_network, ip: "192.168.101.101" So, after some Googling, I added this provider configuration setting: config.vm.provider :virtualbox do |vb| vb.customize ["modifyvm", :id, "–natdnshostresolver1", "on"] end and now my VM is sending data over the VPN. Note that this will not work when using the… continue reading.

Some (disjointed) notes on provisioning Vagrant with Ansible

I've been playing with Vagrant over the last few days, using Ansible to provision it. These are some notes to remind myself for next time and are very disjointed! Configuring Vagrant to provision using Ansible is easy enough: config.vm.provision "ansible" do |ansible| ansible.playbook = "provisioning/playbook.yml" end

Writing to vagrant synced folders

I had a problem writing to the cache directory in my vagrant project due to file permissions. Fortunately Jeremy Kendall has already solved this problem in his Vagrant Synced Folders Permissions article.

Setting up PHP & MySQL on OS X Mavericks

With OS X 10.9 Mavericks, Apple chose to ship PHP 5.4.17. This is how to set it up from a clean install of Mavericks. Note: If you don't want to use the built-in PHP or want to use version 5.5, then these are some alternatives: PHP 5.3/5.4/5.5 for OS X 10.6/10.7/10.8/10.9 as binary package by Liip Zend Server (Free Edition) Homebrew has PHP. Let's go!

Changing the GitHub IRC hooks notification events

As joind.in uses GitHub to host its source code, we use the IRC hook to receive notifications to the IRC channel (#joind.in on freenode) when interesting things happen on the GitHub repositories. We noticed recently that we were being notified about more types of things happening on some repositories compared to others, so I decided to investigate. The code for this is here and a quick perusal of it shows that it will do something… continue reading.

rst2html does not support :startinline:

I'm currently writing some documentation in Restructured Text that I'm targeting at HTML and PDF using rst2html and rst2pdf. For syntax highlighting, both rst2html and rst2pdf use Pygments, however rst2html doesn't support any Pygments options. So a typical PHP snippet in rst targeting rst2pdf, would be written as: .. code-block: php :startinline: true $this = str_replace('foo', 'bar', $that); The startinline Pygments option is to allow it to highlight the snippet, even though the opening <?php… continue reading.

Some notes on git

This set of notes covers the main things that I think you need to know about working with git. It is not comprehensive and mainly serves as a reminder for myself. Remotes In a typical open source workflow using GitHub or BitBucket, you would fork the main repository into your own and then clone that copy to your local computer: git clone git@github.com:akrabat/joind.in.git You then need to connect your local repository to the main repository.… continue reading.

Git export from BitBucket

One of the consequences of moving to git is that I needed to get our deployment scripts working with it. The first requirement was an equivalent to svn export. This is simple enough, but, as usual, I wanted to save myself some effort and created a script that wrapped it up for me. git-export.sh: #!/bin/sh # # USAGE: export.sh REPO_NAME BRANCH_NAME [DIRECTORY_NAME] [BITBUCKET_ACCOUNT_NAME] # # BITBUCKET_ACCOUNT_NAME=akrabat GITROOT=git@bitbucket.org:${BITBUCKET_ACCOUNT_NAME} if [ -z "$1" ]; then echo "Usage… continue reading.

Migrating to BitBucket from Subversion

I've recently started the process of moving all of my Subversion repositories to BitBucket. BitBucket is my preferred git hosting supplier as its pricing structure suits me much better; that is, I have lots of private repositories and GitHub is too expensive for my case! As I needed to migrate over one hundred repositories from Subversion to BitBucket, I automated it via a simple shell script. Rather usefully, BitBucket has an API that let me… continue reading.

Preparing for the ZF2 Tutorial at PHPNW12

If you are coming to the ZF2 tutorial at PHPNW12, then you will get the best out of it if you do a little preparation before you arrive. Laptop You should bring a laptop with the following working on it: A web server (preferably Apache) running PHP 5.3.3 or higher A working MySQL server along with an administration tool such as phpMyAdmin A text editor or IDE that you're comfortable coding with Vhost set up… continue reading.