This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
set nonumber | |
syntax on | |
filetype plugin indent on | |
augroup myfiletypes | |
autocmd! | |
autocmd BufNewFile,BufRead *.jinja set filetype=jinja | |
autocmd BufNewFile,BufRead *.sql set filetype=psql | |
autocmd BufNewFile,BufRead *.migration set filetype=psql | |
autocmd BufNewFile,BufRead *.vcl set filetype=vcl |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### Keybase proof | |
I hereby claim: | |
* I am russss on github. | |
* I am russss (https://keybase.io/russss) on keybase. | |
* I have a public key whose fingerprint is BE75 264B 665E D97E A5DB EFD5 F52F C56D D906 FEB1 | |
To claim this, I am signing this object: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
define command { | |
command_name notify-host-by-irccat | |
command_line /usr/local/share/nagios-plugins/icinga-irccat.py $HOSTNAME$ $HOSTSTATE$ | /bin/nc -q0 irccat-host 12345 | |
} | |
define command { | |
command_name notify-service-by-irccat | |
command_line /usr/local/share/nagios-plugins/icinga-irccat.py -s "$SERVICEDESC$" -o "$SERVICEOUTPUT$" $HOSTNAME$ $SERVICESTATE$ | /bin/nc -q0 irccat-host 12345 | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#0 0x00014883 in Resolver::dispatch (this=0xa06950, rq=@0xb0080424, local_only=false) at /Users/russ/playdar/playdar-daemon/src/resolvers/resolver.cpp:75 | |
#1 0x0008a98b in playdar_request_handler::handle_rest_api (this=0xb0184ee4, qs=@0xb00806b4, req=@0x100b628, rep=@0x100b650) at /Users/russ/playdar/playdar-daemon/src/playdar/playdar_request_handler.cpp:173 | |
#2 0x00091937 in playdar_request_handler::handle_request (this=0xb0184ee4, req=@0x100b628, rep=@0x100b650) at /Users/russ/playdar/playdar-daemon/src/playdar/playdar_request_handler.cpp:78 | |
#3 0x00186b16 in moost::http::connection<playdar_request_handler>::handle_read (this=0x1009600, e=@0xa06950, bytes_transferred=477) at request_handler_base.hpp:27 | |
#4 0x00160006 in boost::asio::asio_handler_invoke<boost::asio::detail::binder2<boost::_bi::bind_t<void, boost::_mfi::mf2<void, moost::http::connection<playdar_request_handler>, boost::system::error_code const&, unsigned long>, boost::_bi::list3<boost::_bi::value<boost::shared_ptr<moost::http::connection |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# usage: python mirrordir.py ./directory myuser@host:/path | |
import sys, pyinotify, subprocess | |
class Handler(pyinotify.ProcessEvent): | |
def process_IN_CLOSE_WRITE(self, event): | |
subprocess.call(("scp", event.pathname, sys.argv[2])) | |
if __name__ == '__main__': | |
wm = pyinotify.WatchManager() | |
notifier = pyinotify.Notifier(wm, default_proc_fun=Handler()) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
require 'fileutils' | |
CA_DIR = '/path/to/ca/keys/' | |
HOST = '1.2.3.4' | |
if not ARGV[0]: | |
raise "Provide a certificate name as an argument" | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
""" Git post-receive hook to publish commit data to an AMQP topic. | |
apt-get install python-git python-amqplib | |
or: | |
easy_install amqplib gitpython | |
""" | |
import os, sys, json | |
from datetime import datetime | |
from git import * |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# https://gist.github.com/gists/1186406 | |
import httplib2, json, re, sys | |
from optparse import OptionParser | |
parser = OptionParser() | |
parser.add_option("-w", "--warning", dest="warning", type="int", | |
default="50", help="warning threshold") | |
parser.add_option("-c", "--critical", dest="critical", type="int", | |
default="100", help="critical threshold") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Listen to a CurrentCost monitor on the serial port and forward data to Graphite | |
import serial | |
import socket | |
import time | |
from lxml import etree | |
ser = serial.Serial('/dev/ttyUSB0', 57600) | |
def send_metric(value): | |
sock = socket.socket() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/ruby | |
# Download NASA MODIS imagery and use it as a desktop background. | |
# You'll need ImageMagick installed for this to work. | |
require 'date' | |
require 'net/http' | |
# Screen width/height | |
X = 2580 | |
Y = 1024 |
OlderNewer