Danny Fowler

infosec turned sysadmin turned devops

Read this first

Fix for `open` command in tmux on OS X

This was a deceptively difficult problem to solve that I just encountered, so I thought I would document the fix for the likely droves of others out there who might experience similar issues.

In OS X, a terminal can typically invoke the default program for a given filetype by simply running open file.jpg. This works quite well without additional configuration for most common file extensions. Examples include:

  • open file.html will spawn your default browser with file.html
  • open . spawns a new Finder window at the current working directory
  • open file.jpg launches Preview displaying your photo

However, this all breaks down when you’re running your terminal session within tmux. You’ll likely be granted with the following error:

The window server could not be contacted. open must be run with a user logged in at the console, either as that user or as root.

Yuck.

Here’s the fix…

I...

Continue reading →


A faster horse…

The Internet has a way of freezing in time some of the moments we would least like to remember about ourselves. But sometimes the upswing is learning from the folly of others.

Ford said it best with his comment about consumers wanting a faster horse rather than knowing they’d benefit from the automobile.

Keep in mind certain innovation you may be laughing at now will seem obvious ten years down the road.

View →


Brain Dump: Automated Parameter Lookups in Hiera aren’t hard…

But I certainly made them that way.

To cut to the chase, I’m using a nodeless site manifest that looks kind of like this:

 /etc/puppet/site.pp

hostname informs role
case $::hostname {
    /app/: { $role = 'app' }
    /db/: { $role = 'db' }
    /worker/: { $role = 'worker' }
    default: { $role = 'default' }
}

hostname informs env
case $::hostname {
    /^test/: { $env = 'test' }
    /^stage/: { $env = 'stage' }
    /^prod/: { $env = 'prod' }
}

include all classes
hiera_include('classes')

This works quite well and lets me use Hiera as a pseudo-ENC. My hiera.yaml is straightforward, as are my hierarchies. The issue I was having came from a misunderstanding of Automated Parameter Lookups in Puppet 3.x (3.6, if you want to be specific). Essentially, I was trying to convert code similar to this in my old site.pp:

class { 'postgresql::server':
    enable => true,
...

Continue reading →