Skip to content

Instantly share code, notes, and snippets.

Avatar

Jeff Lindsay progrium

View GitHub Profile
@progrium
progrium / xmpp-growl.tac
Created Jun 21, 2009
Simple XMPP to Growl bridge
View xmpp-growl.tac
from twisted.words.protocols.jabber import client, jid
from twisted.words.xish import domish, xmlstream
from twisted.application import internet, service
# Python bindings for Growl come with the SDK:
# http://growl.info/downloads_developers.php
from Growl import GrowlNotifier, Image
JID = 'test@example.com'
PASSWORD = 'secret'
@progrium
progrium / domdori-redirect.py
Created Sep 16, 2009
Simple domain forwarder
View domdori-redirect.py
#!/usr/bin/env python
import sys
from twisted.internet import reactor
from twisted.web.server import Site, NOT_DONE_YET
from twisted.web.resource import Resource
from twisted.python import log
from twisted.names import client
from optparse import OptionParser
class RedirectResource(Resource):
View gist:212586
from twisted.python import log
from twisted.internet import reactor, protocol
from twisted.protocols.basic import LineReceiver
import sys
import simplejson
GAME_PORT = 3333
class GameProtocol(LineReceiver):
delimiter = "\n"
View gist:247064
require 'rubygems'
require 'sinatra'
get('/memory') { `ps u 30323`.split("\n").last.split(' ')[3] }
get('/cpu') { `uptime`.split(' ')[-3].gsub(',','') }
View launch.py
#!/usr/bin/env python
from subprocess import call
import sys, os, time
# TODO: ssh connect, find key
# TODO: options
# TODO: specify and set user data (hostname, ip, mounts)
CMD_PREFIX = 'euca'
CMD_SILENT = False
View webstreamr.tac
from twisted.application import internet, service
from twisted.web import server
from twisted.internet.defer import DeferredQueue
from twisted.web.resource import Resource
from twisted.internet import protocol
import simplejson
PORT = 80
listeners = {}
View engine.py
#!/usr/bin/python
from __future__ import with_statement
import base64
import PyV8
import time
from twisted.application import service, internet
from twisted.web import server, resource, client
class EvalResource(resource.Resource):
View v8ssjsconsole.py
#!/usr/bin/python
from __future__ import with_statement
import base64
import PyV8
import time
from twisted.application import service, internet
from twisted.web import server, resource, client
from urllib import unquote
import simplejson
View gist:251329
# WARNING: Beware of magic beyond just variable replacement.
# See Rakefile task that uses this file for details.
# Macros
Include <root>/config/macros.conf
# SVN
Include <root>/projects/svn.conf
# Site
View ShortNet Session 1
SERVICE MODULES and default/suggested mount point: (mount points are like ports)
- wiki #
- task queue *
- command line !
- twitter gateway @
- auction $
- voting % (its a scale? wow)
- review &
Command metasyntax: