Electricmonk

Ferry Boender

Programmer, DevOpper, Open Source enthusiast.

Blog

Category: programming

Introducing ansible-cmdb: a host overview generator for ansible-managed hosts

For those of you that are using Ansible to manage hosts, you may have noticed you can use the setup module to gather facts about the hosts in your inventory: $ ansible -m setup –tree out/ all $ ls out centos.dev.local eek.electricmonk.nl zoltar.electricmonk.nl debian.dev.local jib.electricmonk.nl $ head out/debian.dev.local  {     “ansible_facts”: {     […]

I’ve released cfgtrack v1.0: Get notified of changes on your server

I needed a simple way of being notified when configuration files had been changed on some servers. Nothing fancy. No configuration management, no intrusion detection, no centralised versioning control repositories. Just a simple email saying what’s been changed. I couldn’t find a tool that did just that, and didn’t require massive amounts of configuration, so I […]

Chrome’s Console API: Greatest Hits

The Chrome debugger is the best tool for locating problematic code in a JavaScript application, but there are times that diving into your code line-by-line isn’t the fastest or most convenient means to that end. We all know about console.log(), but I thought I’d write about a few of its lesser-known cousins that are more […]

Dependency Injection in web.py

web.py is a lightweight Python web framework that gets out of your way and just let’s you write Python. Here’s a simple program written in web.py: import web class index: def GET(self): return “Hello, World!`” urls = ( ‘/’, ‘index’, ) if __name__ == “__main__”: app = web.application(urls, globals()) app.run() I quickly ran into the […]

Script to start a Chrome browser with an SSH Socks5 proxy

Socks5 proxies are great. They allow you to tunnel all traffic for applications that support Socks proxies through the proxy. One example I frequently use is starting a Chrome window that will do everthing as if it was an a remote machine. This is especially useful to bypass firewalls so you can test websites that […]

Host inventory overview using Ansible’s Facts

UPDATE: I’ve written a fancier version of the above script as a separate project called ansible-cmdb. It uses templates and can generate a feature-laden HTML version and text versions. It also lets you extend the information from your hosts very easily; even adding completely new hosts. Packages are available for Debian, Redhat and other operating systems. Ansible is a […]

Bexec v0.8: Execute a vim buffer and capture output in split window

I released v0.8 of my Bexec vim plugin. The Bexec plugin allows the user to execute the current buffer if it contains a script with a shebang (#!/path/to/interpreter) on the first line or if the default interpreter for the script’s type is known by Bexec. The output of the script will be grabbed and displayed in […]

Pydocmd: Generate Markdown from python source files

I’ve created pydocmd. It generates Python Module / script documentation in the Markdown (md) format. It was written to automatically generate documentation that can be put on Github or Bitbucket. It is as of yet not very complete and is more of a Proof-of-concept than a fully-fledged tool. Markdown is also a very restricted format and […]

Scripting a Cisco switch with Python and Expect

In the spirit of “Automate Everything” I was tasked with scripting some oft needed tasks on Cisco Switches. It’s been a while since I’ve had to do anything even remotely related to switches, so I thought I’d start by googling for some ways to automate tasks on switches. What I found: http://ciobota.web.cern.ch/ciobota/project/sw_script/ https://trigger.readthedocs.org/en/latest/ Both seemed […]

Multi-column data plotting with Gnuplot

In my previous post I showed how to generate good looking charts with Gnuplot. Those were simple bar charts with a single bar. In this post I want to show you how to plot bar charts with multiple bars. Such charts take multiple columns of data and plot them grouped in the chart. We’ll be working with […]

The text of all posts on this blog, unless specificly mentioned otherwise, are licensed under this license.