Skip to content

Instantly share code, notes, and snippets.

@filippog
filippog / freeipmi
Created September 12, 2023 14:22
freeipmi / ipmi-sensors script for node-exporter
#!/usr/bin/awk -f
#
# Converts output of `ipmi-sensors` to prometheus format.
#
# With GNU awk:
# ipmi-sensors | ./freeipmi > freeipmi.prom
#
# With BSD awk:
# ipmi-sensors | awk -f ./freeipmi > freeipmi.prom
#!/bin/sh
#
# This hook does two things:
#
# 1. update the "info" files that allow the list of references to be
# queries over dumb transports such as http
#
# 2. if this repository looks like it is a non-bare repository, and
# the checked-out branch is pushed to, then update the working copy.
# This makes "push" function somewhat similarly to darcs and bzr.
@filippog
filippog / gist:6560379
Last active December 23, 2015 01:29
Android twitter client selection
TweetDeck on mobile has been killed by Twitter, not pleasant but fair enough
since somehow they have to make money.
I defaulted to the official android twitter client but that didn't work very
well (forgetting for a second that there are ads in the timeline). No inline
pictures and no "unread scrollbar" to know where you are in your timeline.
I asked the intartubes via
https://twitter.com/fgiunchedi/status/370094095571890176 what clients are out
there and many people came back with helpful suggestions! Thanks!
@filippog
filippog / nofork
Created July 24, 2013 16:36
# minimal wrapper to execute a command every given seconds (by default 60) # useful to implement very basic rate-limiting when executing commands
#!/bin/bash
# minimal wrapper to execute a command every given seconds (by default 60)
# useful to implement very basic rate-limiting when executing commands
set -u
set -e
WAIT=${WAIT:-60}
STATEDIR=${STATEDIR:-/tmp/nofork}
@filippog
filippog / autossh_wrapper.sh
Created January 3, 2012 09:01
automatic port detection for autossh
#!/bin/sh
# little wrapper to choose a random port for autossh
# falling back to $fallback_port
set -u
autossh_bin=${AUTOSSH_BIN:-/usr/local/bin/autossh.real}
fallback_port=${AUTOSSH_FALLBACK_PORT:-21021}
# XXX what if these are not available?