Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

To claim this, I am signing this object:

@phone
phone / munin-registration-server
Created May 15, 2015 18:21
munin registration server
#!/bin/bash
netcat -lk 4747 | {
while read addr;
do
echo -e "[$addr]\n address $addr\n" >> /etc/munin/munin.conf;
done
}
@phone
phone / install-munin-node
Last active August 29, 2015 14:21
install munin node
#!/bin/bash
usage() {
cat <<-'END' >&2
usage: install-munin-node.sh HOST
sets FQDN on HOST to that hosts $HOSTNAME,
installs munin-node, sets the configuration to allow
connections from all 4tcp hosts, registers itself
with the master at munin-master
END
int main(int argc, char *argv[]) {
httpd_registry_init();
httpd_register("/", "GET", handle_e404);
httpd_register("/ping", "GET", handle_ping);
httpd_register("/recommend", "GET", handle_recommend);
httpd_err_register(HTTP_BAD_REQUEST, handle_e400);
httpd_err_register(HTTP_NOT_FOUND, handle_e404);
httpd_err_register(HTTP_INTERNAL_SERVER_ERROR, handle_e500);
@phone
phone / wifi.sh
Last active August 29, 2015 14:04
monitor wifi stats on os x
#!/bin/sh
wifistats() {
/System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources/airport -I |\
awk 'BEGIN {top = ""; row = ""} {top = top $1 "\t"; row = row $2 "\t"} END { print top "\n" row}' |\
column -t;
}
case $# in
0)
;;