Forwarding iDrac Remote Console ports over SSH Tunnel (BASH)

iDRACs (and other BMCs) should never be put directly onto the internet. This does mean, though, when trying to access a virtual console you need to go via some sort of a jumpbox. I'm not a fan of inconvenient approaches (like using Teamviewer to connect to a machine on the same network) and would rather, where possible, just set up an SSH tunnel with the appropriate ports forwarded. This command does just that, allowing use of the in browser remote console.

Read more…

Install multiple packages with apt in a single task (Ansible)

When building a system with ansible you'll commonly want to install a variety of packages. Sometimes these will be broken up into individual tasks within various roles, but sometimes you want to install multiple packages as a single task (for example - install useful utilities). This method allows a single task to install multiple packages and their dependancies (the named packages will be installed sequentially) using apt.

Read more…

Get public facing IP of remote machine (Ansible)

On occasion, you might need to identify the IP address of the machine being ansibled. However, there are various scenarios (AWS instances, alicloud instances, NAT etc) where the public facing IP of your machine may not necessarily be bound directly to an interface on the system you're running ansible against.

This simple role places a call out to a Web based endpoint and sets a fact based upon the response so that you can use it later (for example to whitelist it in firewall rules on another machine).

Read more…

Overriding tcUrl and other options with ffplay (BASH)

Various non-standard RTMP applications rely on the the values of attributes that are commonly passed in as part of a PLAY call, such as tcUrl, pageUrl etc. Sometimes this is for authentication (and content protection) purposes, sometimes it's to implement a DNS name based namespace so that different domains can share the same app. With ffmpeg and ffplay it's possible to override tcUrl and other variables with a command line option

Read more…

Removing Firefox Annoyances (Misc)

OK, maybe they only irritate me and most people find them useful, but things keep added into Firefox increasing bloat for no apparent reason. In some cases they also increase the odds of you accidentally leaking information onto the internet

It'll almost certainly grow with time, but this snippet is a bunch of steps to disable some of those annoyances, like "Pocket", "Screenshot" and "Please, please sign into your browser" mode

Read more…

Healing a GlusterFS Split-Brain (Misc)

When GlusterFS nodes get isolated, you can end up with a condition known as split-brain - basically one (or more) nodes is aware of changes that the others are not.

Depending on how bad the split-brain is, and what it effects, it has the ability to completely ruin your day.

One of the first things you want to do, once you become aware of the issues, is (if at all possible) cease all writes to the volume on all nodes - you don't want to dig the hole any deeper than it already is

This documentation shows you how to resolve a simple split-brain, and should hopefully be sufficient most of the time. We'll assume the gluster volume is called "myglustervol", replace this with your actual volume name

Read more…

SAR Cheatsheet (Misc)

sar can be an incredibly helpful utility when examining system performance (especially after the fact), but if not used regularly it's easy to forget which flags to use

This short post details a number of useful arguments to pass

Read more…

Sort list as if it were numbers (Python)

In BASH you might quite often use sort -n to ensure that strings are sorted as if they were numeric (i.e. so 12a,2a,4a is sorted into the order you'd expect based on the integers at the front).

There isn't a direct way to do this to a list in Python, so you need a wrapper to help implement the functionality

Read more…