Skip to content

Instantly share code, notes, and snippets.

View coordt's full-sized avatar

Corey Oordt coordt

View GitHub Profile
@coordt
coordt / package_versions.py
Created April 29, 2011 18:48
A fabric fabfile that checks versions across multiple servers and indexes
from __future__ import with_statement
from fabric.api import env, run, settings, hide
from fabric.decorators import hosts, runs_once
env.venv_path = "/home/webdev/.virtualenvs/twtv3/"
env.user = 'webdev'
env.hosts = [
'172.16.12.27',
# '172.16.12.33',
'172.16.12.48',
@coordt
coordt / check_for_updates.py
Created April 8, 2011 18:39
Check locally installed packages against one or more package indexes for updates and list them.
#!/usr/bin/env python
"""
Use pip to get a list of local packages to check against one or more package
indexes for updated versions.
"""
import pip
import sys, xmlrpclib
from cStringIO import StringIO
from distutils.version import StrictVersion, LooseVersion
@coordt
coordt / fabfile.py
Created December 1, 2010 12:51
A Fabric fabfile that allows you to check which packages are not like the others on a set of servers.
from __future__ import with_statement
from fabric.api import env, run, settings, hide
from fabric.decorators import hosts, runs_once
venv = "/home/websites/.virtualenvs/twtv3/"
env.user = 'webdev'
env.hosts = [
'192.168.1.10',
'192.168.1.11',
@coordt
coordt / gist:177202
Created August 28, 2009 20:19
Create an iPhone-like button using python and cairo
#!/usr/bin/env python
"""
Create a button
"""
import sys, cairo, cairo_helpers
def roundedrec(context,x,y,w,h,r = 10):
"Draw a rounded rectangle"