Slightly Ahead of Behind the Curve

Brain droppings found here.

Run Dependency Services in Docker

My current primary project is a Rails app that depends on PostgreSQL and Redis. I used to run those services directly on my Mac OS development workstation, but didn’t like the untidiness of having services I wasn’t using all the time running all the time. Or that the default install might leave the services listening on all interfaces so that everyone in the coffee shop could poke at my test data. (Nah. I’ve got a firewall and so should you.) I figured, “Hey, I could use Docker to cordon these services off.”

Closer to Environmental Bliss With Direnv

I was a long time user of RVM for installing and switching Rubies. It made my life pretty easy even as I listened to others struggle with it. I was a little uncomfortable putting other things like project-specific environment variables in my .rvmrc files. It seemed dirty, but it worked and I rolled with it for many years.

Eventually, I tried something different. I’d been sold on the idea of using multiple, simpler tools together. Here’s the result.

Reflections on 9-11.

I don’t think I’ve ever written down my experiences on September 11, 2001. Since I broke down in the shower this morning, I think I probably should.

Mind the Gap: Resources

I spoke this week at ChefConf about how we use Chef at my company to produce an installer for our on-premises product. Slides for the talk are up, but not very useful without my rambling that went with them. Instead of making attendees madly write down the resources slide, here are links to the resources and tools I mentioned in the talk.

Yes This Blog Is Stale.

I spoke at ChefConf 2014 this week. A few folks who used their Google Fu on me said, “That’s not your blog, is it? Nothing has been posted in forever!”

I come from a long-ish career in the security and defense industry where we are notorious for not talking about how we do things. It is taking time and effort to break habits of holding all cards close to the chest.

So, yes. This is my blog. Yes, it is stale. I seem to only write when I’ve spoken somewhere—which isn’t that often. I’m working on doing more of both of these things.

README: The Bare Necessities

I gave a lightning talk at Steel City Ruby Conf 2012 today on writing a decent README. Instead of putting the slides up somewhere, I thought I would write up a more detailed post of the talk’s points.

Active Record, PostgreSQL and Sequence Naming

If you use PostgreSQL to back your Active Record models, you should check the current names for your tables and their sequences. Prior to Active Record 3.2.7, renaming a table did not rename the associated sequence for the table’s primary key.

A demonstration may be in order.

RC File for Your Windows Command Prompt

I had trouble today with my Windows %HOME% changing and throwing off Vagrant’s awareness of what boxes are installed. This may be your problem if Vagrant on Windows was working happily for you and then barks about no boxes.

C:\Users\you> vagrant box list
There are no installed boxes! Use `vagrant box add` to add some.

C:\Users\you>dir /b .vagrant.d\boxes

C:\Users\you>echo %HOME%
<somewhere not C:\Users\you>

C:\Users\you>set HOME=%USERPROFILE%

C:\Users\you>vagrant box list

%HOME% was different depending on whether I logged into Windows while on my Active Directory managed network or while I was offline. When on the AD network, %HOME% is set by policy to a mapped drive. When offline, %HOME% is my Windows %USERPROFILE%. I installed Vagrant and some base boxes while off my AD network and everything worked as expected. Base boxes were added to %USERPROFILE%/.vagrant.d/. Back in the office and logged in on the AD network, Vagrant was no longer aware of the base boxes because %HOME% now pointed at my personal mapped drive.

Creating a batch file to set %HOME% to %USERPROFILE% solved the problem.

@echo off


For UNIXy goodness, name it cmdrc.bat, place it in %USERPROFILE% and then add the following to the registry so that this file is run whenever a command prompt opens.

Windows Registry Editor Version 5.00

[HKEY_CURRENT_USER\Software\Microsoft\Command Processor]

One Unity Launcher

T’was decided that the default behavior for Unity’s launcher will be to appear only on the primary monitor in Ubuntu 12.04. For some reason, when I upgraded to 12.04 (beta) today, my setting was for the launcher to appear on ALL desktops. Not a fan of it on all desktops.

For those who want to change this setting, you’ll need to install the Compiz configuration manager.

sudo aptitude install compizconfig-settings-manager

Once installed, run it.

  1. Hover the Dash Home (Ubuntu icon on launcher)
  2. Type in compiz and click on the CompizConfig Settings Manager icon that appears.
  3. Select Desktop on the left.
  4. Click on Ubuntu Unity Plugin on the right.
  5. Select the Experimental tab and scroll all the way down.

The setting for where launchers appear is Launcher Monitors. As of today (2012/04/05), you can select either Primary Desktop or All Desktops.