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
/* | |
* Create an ALSA midi output which changes pitch according to the position | |
* of a Griffin Powermate. | |
* | |
* Copyright 2007 - Aaron Brady <[email protected]> | |
*/ | |
#include <stdio.h> | |
#include <unistd.h> | |
#include <fcntl.h> |
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/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 |
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/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' |
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 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 |
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/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 |
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/python | |
# For best results: pip install appscript | |
__author__ = "Aaron Brady <[email protected]>" | |
__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() |
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/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= ?([^ ]+)''') |
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
# 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\]' |
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/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', |
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/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