Pragmatism 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: git push origin && git push other-remote However, I recently discovered that I can create a remote that points to more than one repository using these commands: git remote add all git@github.com:akrabat/projectname.git git remote set-url –add all ssh://example.com/path/to/projectname.git I now have a remote called all that… continue reading.

Context specific history at the bash prompt

One change I made recently to my .profile is this: # up & down map to history search once a command has been started. bind '"\e[A":history-search-backward' bind '"\e[B":history-search-forward' 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 ↑… 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: #! /bin/sh… 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: 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.