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 a standard …

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.com:123'
creds …
more ...

Sending mail on coredumps

The Story

I recently found out that some of our backend code suffers from memory-related ceashes, namely SIGSEGV (a program tries to access memory it doesn't own). My initial response was to install and enable Abrt, which is a collection of utilities used in RHEL. Ubuntu has a similar tool …

more ...

Using RPMBuild - My Shortlist

The Story

I was trying to tinker with Abrt, a daemon in charge of collecting and diagnosing various crashes in RHEL (more on that in a different post).
Because the crash hook is written in C (it was designed to be really quick), I couldn't use my usual method of …

more ...

Sending HBase metrics to Graphite using Python

The story

Although HBase is a crucial component in our current stack, the monitoring for it was quite incomplete. We only had general "is it running?" monitoring, with some very application-specific tests ("make sure scanning this table doesn't take too long").
By sending detailed metrics on our HBase tables/regions …

more ...

Preparing Certificate files for Nginx

The Story

When installing SSL certificates for nginx, assuming you're using certificate hierarchy (and not a self-signed ceritificate), you're required to concatenate all of the certificate files (*.crt) to a single file, starting from your site's certificate up to the root certificate.
Today I got this bundle to prepare, courtesy …

more ...

Installing Growroot on CentOS

The story

I currently work with CentOS on Amazon EC2. As I previously written, The HVM version of the AMI is created with a partitioned disk, instead of having the filesystem written directly on the block device.
Problem is, when creating a root device bigger than the default (8G), you …

more ...

Chroot Snippet

The Story

Some time ago, my PC wouldn't boot.
This was my fault, as I needed to resize some partition, and resizing in Linux really means deleting the partition and creating a new one in the same place. I forgot to assign the partition the same UUID, which caused Ubuntu …

more ...