Developing software in the Real World

Git push to multiple repositories

I have a couple of projects where I need to push to more than one repo all the time. I have been using this command line to do so:

However, I recently discovered that I can create a remote that points to more than one repository using these commands:

I now have a remote called all that will push to both repositories! There's no automatic way to go the other way and fetch… continue reading.

Context specific history at the bash prompt

One change I made recently to my .profile is this:

These two bind command change the way that the up and down arrow keys work once you start typing a command to only search the history for lines that start with what you've typed so far. This means that I type, say, git and then press ↑ & ↓ to go through all the times I've typed a git command without having to go… continue reading.

Setting up mailcatcher as a service in Debian/Ubuntu

I've recently been changing joind.in's Vagrant system to use Debian and one issue I came across was getting Mailcatcher to start on boot and integrate property with the service command. To do this, I created an init script which is based off the skeleton and then stored this in /etc/init.d and then ran update-rc.d mailcatcher defaults to set up the correct links in the various rc.d directories. This is the init script: /etc/init.d/mailcatcher:

As… continue reading.

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:

So, after some Googling, I added this provider configuration setting:

and now my VM is sending data over the VPN. Note that this will not work when using the Vagrant's public_network setting though.

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:

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:

The startinline Pygments option is to allow it to highlight the snippet, even though the opening <?php is missing. If you run rst2html, you get this… 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:

You then need to connect your local repository to the main repository. By convention,… continue reading.