Writing Complex Scripts in HBase Shell

The Story

HBase installations include a shell for running arbitrary commands.
For instance, if you want to view all of your snapshots, you can do something like:

[me@server ~]$ hbase shell
HBase Shell; enter 'help<RETURN>' for list of supported commands.
Type "exit<RETURN>" to leave the HBase Shell
Version ...
more ...

Running Inline DSL in ChefSpec

The Problem

I have a pet Chef cookbook in charge of managing SELinux policies in Linux machines (Take a look).
Until today I got along fine without testing, because the cookbook barely had any logic to be tested. The only test I had (contributed by someone) just made sure the ...

more ...

Generating known_hosts file using Chef

The Story

This post relates to my previous post. I was trying to create a script to amend my known_hosts file (where SSH keeps fingerprints of all of the servers it connected to in the past, to prevent MitM attacks) with SSH keys collected by Chef. This benefits me in ...

more ...

Merging known_hosts files

The Story

Some time ago, some colleague rebuilt several servers and reused their names (think sql1,sql2 etc).
Obviously the new servers had different SSH server keys than the old ones, so my known_hosts file was out of date.
I considered manually removing the old key fingerprints, but decided that ...

more ...

Managing AWS Security Groups with Piculet

The Problem

One of the first things I noticed when starting to work with AWS is that security groups are very hard to maintain:

  • Name and description are immutable - One can't modify the name/description of a Security Group after it's created
  • Groups contain magical constants - There is ...
more ...


Chef Snippets

I thought I'd upload some interesting Chef-related snippets I accumulated.

Chef Shell

chef-shell is an easy way to gain the context of a Chef client.
I mainly use it to debug recipes by executing little bits of them in the shell.

As client

If you're running it on ...

more ...



Migrating Graphite's Dashboards

I just made a small script to migrate dashboards between two graphite servers.
Couldn't find a similar one anywhere, so I thought I'd upload it.
Note it's using http for its HTTP calls. It looks real nice.

old_server='http://old.server.com:1234'
new_server='http://better.server ...
more ...