Pragmatism in the real world

Notes on keyboard only use of macOS

It's been a while since I could use a trackpad without pain and even longer since I could use a mouse or trackball. Currently I use a Wacom tablet as my mouse which works really well as long as I don't use it too much. Fortunately, keyboard usage doesn't seem to be a problem (yet?), so I try to use only the keyboard as much as possible on macOS (née OS X). These are some… continue reading.

Installing 32 bit packages on Ubuntu 14.04

This had me stumped for a bit, so I've written it down. If you have a 64 bit version of Ubuntu and want to install a 32-bit package, you simply add :i386 to the end of the package name like this: $ sudo apt-get install libstdc++6:i386 However, this didn't initially work for me as apt-get couldn't find the package: $ sudo apt-get install libstdc++6:i386 Reading package lists… Done Building dependency tree Reading state information… Done… continue reading.

Git submodules cheat sheet

Note: run these from the top level of your repo. Clone a repo with submodules: $ git clone git@bitbucket.org:akrabat/dotvim.git .vim $ git submodule update –init View status of all submodules: $ git submodule status Update submodules after switching branches: $ git submodule update Add a submodule: $ git submodule add git://github.com/tpope/vim-sensible.git bundle/vim-sensible Update all submodules to latest remote version $ git submodule update –remote –merge $ git commit -m "Update submodules" Update a specific submodule… 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.

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.

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