Tools and Processes

bash tricks accumulated over the last several weeks: Argument expansion Need to move or copy a file under a long directory tree? cp /this/is/a/really/long/path/to/{file-01,file-02}.txt Git filter-branch Need to get rid of large media files in your Git repo throughout the entire history of the project? git filter-branch --index-filter \ 'git rm --cached --ignore-unmatch ./path/to/file/*.ext' \ --tag-name-filter cat -- --all Supports wildcard matching! History Expansion There are several techniques here, but my current favorites are sudo !...

2013-11-06 · 2 min · 244 words · Nathaniel Hoag

A Simple Docker-hosted Hubot

I’ve been playing with Hubot a bit lately, and decided to up the ante on the endeavor by creating a Hubot Docker container. There were a couple of misadventures before landing on a stable source container from which it will now be crazy easy to extend and deploy. I set up Docker using the instructions here. You may notice from reviewing the Dockerfile that line 6 imports a ‘Universe’ apt source....

2013-09-30 · 1 min · 211 words · Nathaniel Hoag

Let's Skip Preview and Just Use ImageMagick

Same problem, one tool… (this would be a great time to set up an S3 media bucket to show results). In addition to ImageMagick, I installed ghostscript with brew install ghostscript to enable working with eps vector images. Starting with a square profile photo: identify nhoag-bw-sq.jpg /path/to/nhoag-bw-sq.jpg JPEG 480x480 480x480+0+0 8-bit sRGB 65.5KB 0.000u 0:00.000 Generate a black rectangle to match the width of the profile photo: convert -size 480x100 xc:black black....

2013-09-18 · 2 min · 282 words · Nathaniel Hoag

Image Manipulation on OSX with Preview and ImageMagick

I recently modified the Google profile image on my work Google+ account to make it more clear that it’s a work profile rather than a personal profile. I added a few layers to my existing profile image including a work logo and a couple of simple transparencies. In the past I would have relied on Photoshop, GIMP, or another heavy image manipulation GUI software to accomplish this task. This time around, I decided to make use of the OSX Preview program in conjunction with the command line tool, ImageMagick....

2013-09-16 · 2 min · 265 words · Nathaniel Hoag

A Few Quick Updates

ncdu for the Win While reading through some internal tool enhancement tickets at work the other day, I happened accross a quick mention of a command line tool that I’d not yet seen, but which proved to have immediate value. The tool is ncdu, ‘NCurses Disk Usage’, which as the man page states, “…provides a fast way to see what directories are using your disk space.” In the process of onboarding new sites to Acquia Cloud, it’s not always clear where the lines have been drawn with regard to separating out code and media assets for a site....

2013-09-11 · 2 min · 361 words · Nathaniel Hoag