Notes / examples from Programming Erlang with emphasis on Riak
Page | Code | Method | Source |
---|
# This is an event.d (upstart) script to keep monit running. | |
# To install disable the old way of doing things: | |
# | |
# /etc/init.d/monit stop && update-rc.d -f monit remove | |
# | |
# then put this script here: | |
# | |
# /etc/init/monit.conf | |
# | |
# and reload upstart configuration: |
#!/usr/bin/env bash | |
set -o errexit | |
set -o nounset | |
tmpfile='' | |
function onexit | |
{ | |
if [[ -f $tmpfile ]] |
Hostname "ubuntu-12" | |
FQDNLookup true | |
BaseDir "/var/lib/collectd" | |
PIDFile "/var/run/collectd.pid" | |
PluginDir "/usr/local/lib/collectd" | |
TypesDB "/usr/local/share/collectd/types.db" | |
# LoadPlugin syslog | |
# <Plugin syslog> | |
# LogLevel info |
#!/usr/bin/env bash | |
function xfers_in_progress | |
{ | |
local tmp="$(mktemp)" | |
riak-admin transfers > "$tmp" 2>&1 | |
fgrep -qi 'No transfers active' "$tmp" | |
declare -i rv=$? | |
rm -f "$tmp" | |
if (( rv == 1 )) |
portmaster -dBGm BATCH=1 --no-confirm --delete-packages -a
#!/usr/bin/env perl | |
use strict; | |
use warnings; | |
while (<>) | |
{ | |
# 2014-10-05 14:59:45.023 | |
my @F = split; | |
if (/(\d{4}-\d{1,2}-\d{1,2} \d{1,2}:\d{1,2}:\d{1,2}).*Reading large object/) |
dev*/ |
// ==UserScript== | |
// @author Luke Bakken | |
// @name Hipchat Long Idle | |
// @namespace org.bowbak.luke | |
// @description Makes you stay "Available" in hipchat for 8 hours of inactivity instead of 5 minutes | |
// @match https://*.hipchat.com/chat | |
// @version 1 | |
// @grant none | |
// @run-at document-end | |
// ==/UserScript== |