Skip to content

Instantly share code, notes, and snippets.

from metar.Datatypes import direction
import alphasign
import socket
import threading
import time
import collections
_PR = collections.namedtuple('_PR',
['mt', 'tn', 'a', 'b', 'icao', 'c', 'd', 'e', 'f',
@compbrain
compbrain / onkyo_power.py
Created March 7, 2012 18:41
power control utility for onkyo eiscp receivers
#!/usr/bin/python
"""Simple power on/off control for Onkyo receivers.
Derived from https://github.com/compbrain/Onkyo-TX-NR708-Control
"""
__author__ = 'Will Nowak <wan@ccs.neu.edu>'
import socket
import sys
@compbrain
compbrain / minecraft_status_demo.py
Created December 8, 2011 06:23
minecraft_status example
import minecraft_status
status = minecraft_status.GetMCStatus('my_server_hostname')
if status[0]:
print 'Server is online'
print 'MOTD is: %s' % status[1]
print 'Currently %s/%s players online' % (status[2], status[3])
else:
print 'Server is offline'
@compbrain
compbrain / watch_teeworlds.py
Created July 29, 2011 02:17
Python Teeworlds Watcher
#!/usr/bin/python
__author__ = 'Will Nowak <wan@ccs.neu.edu>'
import socket
def GetUdpSocket():
return socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
@compbrain
compbrain / simpledesktops_download.py
Created December 13, 2010 11:33
Download simpledesktops wallpapers
#!/usr/bin/python
"""Download a whole page of wallpapers from simpledesktops.com.
Requires:
- BeautifulSoup: http://www.crummy.com/software/BeautifulSoup/#Download
Usage:
$ ./simpledesktops_download.py "http://simpledesktops.com/browse/6/"
Downloading http://parsed.url.com/directory/subdir/wallpaper.png to wallpaper.png