Skip to content

Instantly share code, notes, and snippets.

@rajbot
rajbot / get_lat_long_yql.py
Created February 14, 2011 22:14
Get Lat/Long coords from street addresses using Yahoo Query Language
#!/usr/bin/python
import urllib
import json
import time
address_file = "libraries.txt"
f = open(address_file)
for line in f:
@rajbot
rajbot / update_wordpress_plugins_themes.py
Created August 17, 2011 00:24
Updates wordpress plugins and themes to their latest svn tag. Plugins and themes must be initially installed using svn for this to work.
#!/usr/bin/env python
'''
This script helps automatically keep your wordpress themes and
plugins up-to-date. It requires that you install themes and plugins
using subversion from the approriate wordpress.org repo. When run,
this script checks the upstream repo for the latest svn tag, and
switches your checked out repo to the latest tag.
Set your wordpress install dir path and wordpress user at the top
@rajbot
rajbot / liveweb.py
Created March 21, 2012 03:02
wayback-python prototyping
"""Prototype of liveweb proxy.
"""
def get_recent_crawl_location(url):
"""Looks at redis to find the location of the recent crawl of the given URL.
"""
return redis.get(md5sum(url))
def fetch(url):
"""Fetches a url from liveweb.
@rajbot
rajbot / curiosity_pixel_logo.py
Created August 8, 2012 19:36
Curiosity Rover Pixel Logo
#!/usr/bin/env python
from PIL import Image, ImageDraw
k_pixel_size = 50
size = (10 * k_pixel_size, 10 * k_pixel_size)
curiosity_pels = [(2,2), (3,2), (4,2), (5,2), (6,2), (7,2),
(2,3), (3,3), (7,3),
@rajbot
rajbot / gis2png.ipynb.json
Last active August 29, 2015 13:56
Converting GIS floating point data to PNG
{
"metadata": {
"name": "Untitled0"
},
"nbformat": 3,
"nbformat_minor": 0,
"worksheets": [
{
"cells": [
{
@rajbot
rajbot / query_dns.py
Created December 31, 2014 23:30
Query DNS servers to see which ones are blocking archive.org
import dns.resolver
from dns.exception import Timeout
import json
import time
f = open('in.json')
ips = json.load(f)
good = set()
bad = set()