Skip to content

Instantly share code, notes, and snippets.

View askedrelic's full-sized avatar

Matt Behrens askedrelic

View GitHub Profile
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'
#!/usr/bin/env python
# Automated rollout script for Amazon EC2 + MM
# 2010/05/20 15:20:35
# Matt Behrens <askedrelic@gmail.com>
from boto.ec2.connection import EC2Connection
import paramiko
import time
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
"""
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 <askedrelic@gmail.com>
Assuming date data in some format like this:
2003-04
2003-08
@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 <tjfontaine@gmail.com>
Copyright (c) 2010 Josh Wright <jshwright@gmail.com>
Copyright (c) 2010 Ryan Tucker <rtucker@gmail.com>
Copyright (c) 2008 James C Sinclair <james@irgeek.com>
if (!-e $request_filename) {
rewrite ^(.*)$ /index.php?q=$1 last;
break;
}
server {
listen 80;
server_name www.thebehrensventure.com;
rewrite ^/(.*) http://thebehrensventure.com/$1 permanent;
}
server {
listen 80;
server_name thebehrensventure.com;
@askedrelic
askedrelic / gist:897652
Created April 1, 2011 02:50
toggle audio source on OSX
set the currentSource to (do shell script "/Users/askedrelic/bin/SwitchAudioSource -c")
if currentSource is equal to "Built-in Output" then
do shell script "/Users/askedrelic/bin/SwitchAudioSource -s \"Built-in Line Output\""
else
do shell script "/Users/askedrelic/bin/SwitchAudioSource -s \"Built-in Output\""
end if
/bin/p4merge
#!/bin/bash
for arg; do [[ $arg = /* ]] || arg=$PWD/$arg; absargs+=("$arg"); done;
/Applications/p4merge.app/Contents/Resources/launchp4merge "${absargs[@]}"
.gitconfig
[merge]
tool = p4merge
from libgreader import GoogleReader, ClientAuthMethod
username = ''
password = ''
ca = ClientAuthMethod(username,password)
reader = GoogleReader(ca)
info = reader.getUserInfo()
reader.subscribe('feed/http://blog.aboutecho.com/feed/')
reader.buildSubscriptionList()