Skip to content

Instantly share code, notes, and snippets.

View askedrelic's full-sized avatar

Matt Behrens askedrelic

View GitHub Profile
@askedrelic
askedrelic / api.py
Created February 17, 2011 00:04
Dynamic Fabric functions
#!/usr/bin/python
# vim:ts=2:sw=2:expandtab
"""
A Python library to perform low-level Linode API functions.
Copyright (c) 2010 Timothy J Fontaine <[email protected]>
Copyright (c) 2010 Josh Wright <[email protected]>
Copyright (c) 2010 Ryan Tucker <[email protected]>
Copyright (c) 2008 James C Sinclair <[email protected]>
#!/usr/bin/env python
"""
Script to generate a yearly-timeline google Chart API graph,
using pygooglechart for the graph and PIL to join the graphs together.
2010/09/05 22:04:45
Matt Behrens <[email protected]>
Assuming date data in some format like this:
2003-04
2003-08
ruin:~$ jumpstat
1.0: /Users/askedrelic/code/coding_tests
2.0: /
2.0: /Users/askedrelic/private-bin
2.0: /Users/askedrelic/code/coding_tests/disqus
3.0: /Users/askedrelic/code/libgreader
4.0: /Users/askedrelic/code
8.0: /Users/askedrelic/Downloads
17.0: /Users/askedrelic/src/autojump
Total key weight: 39
#!/usr/bin/env python
# Automated rollout script for Amazon EC2 + MM
# 2010/05/20 15:20:35
# Matt Behrens <[email protected]>
from boto.ec2.connection import EC2Connection
import paramiko
import time
import urlparse
import oauth2 as oauth
scope = "http://www.google.com/reader/api"
sub_url = "%s/0/subscription/list" % scope
reading_url = '%s/0/stream/contents/user/-/state/com.google/reading-list' % scope
request_token_url = "https://www.google.com/accounts/OAuthGetRequestToken?scope=%s" % scope
authorize_url = 'https://www.google.com/accounts/OAuthAuthorizeToken'
access_token_url = 'https://www.google.com/accounts/OAuthGetAccessToken'