Installing PHP5.6 on Ubuntu 14.04LTS

I recently had to setup PHP 5.6 explicitly for testing and verifying work on a client website. Given Ubuntu 14.04LTS natively supports PHP 5.5.9, and the defacto standard ondrej/ppa is now installing PHP7 it took me a bit to understand exactly how to get 5.6 so we could verify tests and all that goodness. In retrospect, it’s obvious, but this may hopefully save someone out there the hour of raised eyebrows.

Via Ansible:

 

Wildcard subdomain Apache + Vagrant

Ever needed to setup a local SaaS app development server? Is your /etc/hosts file a mess? Me too!

Landrush to the rescue! Previously you’d setup dnsmasq locally to handle this on your physical machine, but if you’re in Vagrant you need to point to the IP of the virtual machine via Vagrant so it gets messy. Landrush is a magical piece of software that handles setting up a daemon in your Vagrant machine that solves this across the board.

Simply install the vagrant plugin locally:

Next, setup your Vagrantfile to properly set the hostname and the daemon to list on *.{hostname}

Write failed, broken pipe!

My team and I regularly deal with remote SSH connections to AWS and other third party services, and part of that requires several concurrent terminal sessions running scripts, processes, etc.

Frequently, we encounter the dreaded:

There are a couple ways to mitigate this:

SSH Configuration

Add the following:

Screen

Screen is a full-screen window manager that multiplexes a physical terminal between several processes, typically interactive shells. Each virtual terminal provides the functions of the DEC VT100 terminal and, in addition, several control functions from the ISO 6429 (ECMA 48, ANSI X3.64) and ISO 2022 standards (e.g. insert/delete line and support for multiple character sets). There is a scrollback history buffer for each virtual terminal and a copy-and-paste mechanism that allows the user to move text regions between windows. When screen is called, it creates a single window with a shell in it (or the specified command) and then gets out of your way so that you can use the program as you normally would. Then, at any time, you can create new (full-screen) windows with other programs in them (including more shells), kill the current window, view a list of the active windows, turn output logging on and off, copy text between windows, view the scrollback history, switch between windows, etc. All windows run their programs completely independent of each other. Programs continue to run when their window is currently not visible and even when the whole screen session is detached from the user’s terminal.

If your session terminates or fails for some reason, using Screen you can quickly continue back where you left off with the previous session: