View powermate-to-midi.c
/* | |
* Create an ALSA midi output which changes pitch according to the position | |
* of a Griffin Powermate. | |
* | |
* Copyright 2007 - Aaron Brady <bradya@gmail.com> | |
*/ | |
#include <stdio.h> | |
#include <unistd.h> | |
#include <fcntl.h> |
View check_horsebolted
#!/usr/bin/python | |
from glob import glob | |
import re, sys | |
okay_re = [re.compile(x) for x in [ r'proftpd', r'apache2', r'upload.py', r'getty', r'munin-node', r'inetd', r'init', r'check_horsebolted', r'upstart.udev', r'portmap', r'irqbalance', r'puppet', r'nrpe', r'udevd', r'sshd', r'atd', r'mdadm', r'rsync', r'fail2ban', r'exim4', r'rsyslogd', r'cron', r'ntpd', r'mcollective', r'mysqld', r'bash', r'sleep', r'sync.php', r'queue.php', r'CRON', ]] | |
res = ([z for z in [open(x,'r').read() for x in glob('/proc/*/cmdline')] if not [y for y in okay_re if y.search(z)] and z]) | |
print res |
View mc-find-hosts.py
#!/usr/bin/python | |
import sys | |
import syck as yaml | |
import time | |
from hashlib import sha1 | |
from M2Crypto.RSA import load_pub_key, load_key | |
from stompy.simple import Client | |
# Change these. | |
PREFIX = 'mcollective' |
View icinga.h
#define HOST_SCHEDULED_DOWNTIME 1 | |
#define HOST_NO_SCHEDULED_DOWNTIME 2 | |
#define HOST_STATE_ACKNOWLEDGED 4 | |
#define HOST_STATE_UNACKNOWLEDGED 8 | |
#define HOST_CHECKS_DISABLED 16 | |
#define HOST_CHECKS_ENABLED 32 | |
#define HOST_EVENT_HANDLER_DISABLED 64 | |
#define HOST_EVENT_HANDLER_ENABLED 128 | |
#define HOST_FLAP_DETECTION_DISABLED 256 | |
#define HOST_FLAP_DETECTION_ENABLED 512 |
View pwapp2.py
#!/usr/bin/python | |
import hashlib | |
import sys | |
def main(key, username, hostname): | |
m = hashlib.md5('%s%s%s' % (key, username, hostname)) | |
h = m.hexdigest() | |
f8 = h[:8] | |
print f8 |
View cyclestatus.py
#!/usr/bin/python | |
# For best results: pip install appscript | |
__author__ = "Aaron Brady <bradya@gmail.com>" | |
__copyright__ = "Copyright 2011, Aaron Brady, Interactive Web Solutions Ltd." | |
__license__ = "MIT" | |
from appscript import app | |
from time import sleep | |
from sys import stdin, argv | |
ic = app("iChat") | |
lines = stdin.readlines() |
View volume.py
#!/usr/bin/python | |
import re | |
import os | |
import time | |
import mpdclient | |
SERVER = '192.168.1.7' | |
re_ = re.compile(r'''CALL: [^ ]+ State=. Cut=. Music=... Aend="([^"]+)" [^ ]+ Bend="([^"]+)" (.*) CalledNum=([^ ]+) [^ ]+ CallingNum= ?([^ ]+)''') |
View daz.sh
# Color codes | |
RED='\[\033[01;31m\]' | |
GREEN='\[\033[01;32m\]' | |
YELLOW='\[\033[01;33m\]' | |
BLUE='\[\033[01;34m\]' | |
PURPLE='\[\033[01;35m\]' | |
CYAN='\[\033[01;36m\]' | |
WHITE='\[\033[01;37m\]' | |
NIL='\[\033[00m\]' |
View attended-pyconuk.py
#!/usr/bin/python | |
import fluidinfo, sys | |
u, p = sys.argv[1:] | |
f = fluidinfo.login(u, p) | |
fluidinfo.call('POST', '/tags/' + u, dict(name='attended', | |
description='Things that I have been to', indexed=False)) | |
fluidinfo.call('PUT', '/about/pyconuk 2011/' + u + '/attended', '2011-09-24') | |
print fluidinfo.call('GET', '/about/pyconuk 2011') | |
# might print something like - ({'status': '200', 'content-length': '116', | |
# 'content-location': 'https://fluiddb.fluidinfo.com/about/pyconuk%202011', |
View cctable.py
#!/usr/bin/python | |
import os | |
import serial | |
import re | |
s = serial.Serial('/dev/ttyUSB0', 57600) | |
FILENAME = '/tmp/cctable' | |
TMPNAME = FILENAME + '.new' | |
while True: | |
data = s.readline().strip() | |
rx = re.compile(r'<tmpr>([0-9\.]+)</tmpr>.*<watts>([0-9]+)</watts>') |
OlderNewer