Populating a NetworkX graph with a scanner

I had a graph living outside Pythonland (a commit tree with dependencies) and wanted to do graphy things to it. To do that, I first had to put the data into a NetworkX graph. I wrote this code bit to discover a graph-like structure and put into a NetworkX (or ...

more ...

Getting Magent Links from Deluge

My latest weekend-hack is a plugin that shows the magnet link for a torrent entry

Why

I had something torrented a long time ago, and a friend asked me for the torrent.
However, I haven't kept the original .torrent file, she was tech-oriented enough so I can give her ...

more ...

Prettify HTML pages with BeautifulSoup

The story

Today I wrote some HTML page by hand (my new homepage).
I then used this script to make the HTML code nicer:

The script

This requires the BeautifulSoup module for python

#!/usr/bin/env python

import sys
from bs4 import BeautifulSoup

def bs_file(filename):
    with open(filename, 'r ...
more ...

Dry Run for Python Pip

As I wrote some time ago, I started my own python cookbook for Chef because I didn't like the direction the "default" one was going.
I recently added a new feature that I wanted to talk about. I called it smart_install in the cookbook, but it's actually a ...

more ...


Parsing AWS billing

The Story

I never understood the AWS billing very well and happily left it to my CTO.
A couple of days ago, however, my CTO secretly told me he's mainly interested in learning 2 things from those bills:

  1. How much are we paying for every component of the application ...
more ...

Open-Gridview - the FOSS Out-Gridview

The Story

I've been a Microsoft SysAdmin for a long time before switching for Linux. During which, I scripted a lot in PowerShell.
PowerShell has several "output" functions like Out-File (which passes the input to a file), Out-Null etc.
One of these functions was Out-Gridview which tabularizes its input ...

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 ...

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 ...

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 ...

more ...