Managing EC2 reservations with Scripts

The Story

Since we tend to hold our AWS EC2 VMs for a long time, we usually reserve them.
Reservations are like pre-buying instances - you pay AWS ahead of time for (let's say) a year, and get a discounted price.
The insterestng thing about EC2 reservations is that they aren't …

more ...

Appending Newline to File Ends with Ruby

I recently took over managing some config files from my dev colleagues. I was extremely annoyed to be reminded that Notepad (Windows' text editor) does 2 major Unix-incompatible things:

  1. CRLF line ending (\r\n and not \n)
  2. No newline at the end of file, which is something of a nicety …
more ...


Scripting YUM provides search using Python

Update 24-06-15

Thanks to this page, I fixed my script. It no longer requires root privillages. I also muted informational messages because they were not very informational.

The Story

Today I had a list of files (nagios check scripts), and I wanted to check for every file if there's a …

more ...

Batch fitting pictures in ImageMagick

I recently bought a digital frame for some of my more elderly relatives.
The frame's firmware was quite retarded, and I had 2 issues with it:

1. Pictures were always displayed in order

This might be a "not a bug but a feature" type of situation, but still.
I solved …

more ...

Managing chef users with Chef

I needed to create seperate Chef accounts for some utility program running in my Chef server.
I was finally able to deprecate it today, but I saved those snippets because they're neat. These snippets use chef-server-ctl, which is a utility software included in Chef server's installation

The bits

Interesting points …

more ...

Locking Down Jenkins' Authentication

Update 19.02.15

After posting my script in the Jenkins mailing list, I was told about a simpler way for implmenting my authorization strategy. I'm leaving this post because the things I learnt from developing the plugin are still valuable and may help someone someday.

The REAL solution

We'll …

more ...

Resizing AWS root EBS in CentOS HVM

Update 04.07.15

This method doesn't work anymore because of some weird AWS restriction, which says you can't connect the root device of a marketplace AMI (like the CentOS one) to another VM, lest you discover its secrets.
I developed a better method which involves either rebooting or creating …

more ...

Booting with UUID without initramfs

The Story

I recently wiped my CubieTruck (a single board computer, like RaspberryPi), and tried installing the root filesystem on a hard drive instead of the built-in NAND, due to the NAND's tendency to get corrupted.
I used Igor Pečovnik's Image, which is really convenient, as I like it better …

more ...

Getting Git Submodule Detailed Status

The Story

I manage every one of my Chef cookbooks as a single git repository, complying with the BerkShelf paradigm. I keep them all as submodules in a "supermodule", to allow my teammates to easily clone them all. I can use git status from the supermodule to get submodule information …

more ...