macOS: Simple PHP Switcher

Recently I’ve been working with PHP applications in varying states of modernity/antiquity, and very regularly have to switch the current PHP version to accomodate the PHP flavors of the day. Homebrew un/link commands are super simple and at this point all I want is to be able to switch the PHP version with a single command. With a little bit of searching, I found a script that comes pretty close to what I need:...

2017-12-11 · 1 min · 109 words · Nathaniel Hoag

Redis Tangent

Since Hubot ships with a Redis Brain by default, I decided to use this as an opportunity to learn some Redis. While reading through Redis documentation, I came across Redis Mass Insertion, which sparked an odd curiosity (twinkle twinkle). The main crux of Redis Mass Insertion is a recommendation to write large data sets to a Redis instance using the Redis protocol with redis-cli --pipe rather than pushing data through a Redis client....

2015-01-03 · 6 min · 1120 words · Nathaniel Hoag

Automating Drupal Module Deployment with Bash

Part of the process of migrating new customers to Acquia Hosting involves adding (or verifying the presence of) three Drupal modules: Acquia Network Connector: get status and recommendations from Acquia Insight Fast 404: reduce the cost of 404s Memcache API and Integration: improve performance by moving cache data into memory Manual?! Awe shucks… Verifying, adding, and committing these modules manually generally takes about five to ten minutes and can be error-prone....

2014-04-26 · 4 min · 697 words · Nathaniel Hoag

GoAccess Shell Plugin Revamped

I made a bunch of big changes to the GoAccess shell plugin including improved argument handling, greater agnosticism, and greater configurability with time filtering. I converted the plugin from sourced script to regular bash script. This meant the script components had to be ordered into a sequential configuration, but this also makes the script more portable and easier to fire up. The script options now support short and long call values, courtesy of Stack Overflow....

2013-09-08 · 2 min · 298 words · Nathaniel Hoag

Fun with access.log

With analyzing data sets and performing repetitive (and tedious) tasks, piping streams in the terminal can save a ridiculous amount of manual labor and time. Following are a few examples that I use in diagnosing and resolving various types of problems with web applications. Assuming log entries in the following format: 1.1.1.1 - - [24/Aug/2013:12:55:30 +0000] "GET / HTTP/1.0" 200 2227 "-" "USER AGENT STRING" vhost=vhost.example.com host=example.com hosting_site=docroot request_time=5640229 Number of Requests $ for i in {0....

2013-08-24 · 2 min · 228 words · Nathaniel Hoag