Skip to content

Instantly share code, notes, and snippets.

clay richardson clayrichardson

Block or report user

Report or block clayrichardson

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile

Keybase proof

I hereby claim:

  • I am clayrichardson on github.
  • I am clayrichardson ( on keybase.
  • I have a public key ASBBbyOvYCDaAJyiGKcarUpGtGoz-Gngf51so0ln43ne2go

To claim this, I am signing this object:

View RocketDataLogger.ino
#include <SD.h>
#include <Wire.h>
#include <Adafruit_Sensor.h>
#include <Adafruit_LSM303_U.h>
#include <Adafruit_BMP085_U.h>
#include <Adafruit_L3GD20_U.h>
#include <Adafruit_10DOF.h>
/* Assign a unique ID to the sensors */

Backup MySQL to Amazon S3

This is a simple way to backup your MySQL tables to Amazon S3 for a nightly backup - this is all to be done on your server :-)

Sister Document - Restore MySQL from Amazon S3 - read that next

1 - Install s3cmd

this is for Centos 5.6, see for other systems like ubuntu etc

set -ex
# Swap file commands from:
# Create swapfile
echo "Creating swap file..."
dd if=/dev/zero of=/swapfile bs=1024 count=4096k
clayrichardson / change_phabricator_prefix.rb
Created Feb 1, 2014
Script to migrate phabricator database prefixes
View change_phabricator_prefix.rb
require 'ostruct'
require 'optparse'
require 'awesome_print'
$stdout.sync = true
options = {} do |opts|
opts.banner = "Usage: change_phabricator_prefix.rb [options]"
""" base58 encoding / decoding functions """
import unittest
alphabet = '123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ'
base_count = len(alphabet)
def encode(num):
""" Returns num in a base58-encoded string """
encode = ''
from django.db import models
class Manufacturer(models.Model):
uuid = models.CharField(max_length = 100)
name = models.CharField(max_length = 100)
class Car(models.Model):
uuid = models.CharField(max_length = 100)
manufacturer = models.ForeignKey(Manufacturer)
clayrichardson /
Last active Oct 11, 2015
Create jpegs with random content using multiple processes
import sys
import os
import time
import uuid
import random
import signal
import multiprocessing
import numpy
from optparse import OptionParser
clayrichardson /
Created Aug 15, 2012
Python Multiprocessing Queues and Pipes
import sys
import time
import random
import signal
import multiprocessing
processes = []
def launch_process(number, kill_queue, child_connection):
clayrichardson /
Created Apr 3, 2012
Grab some random wallpapers from the toplist on
import re
import time
import pprint
import urllib2
import urllib
from BeautifulSoup import BeautifulSoup as soup
from random import choice
def append_links(thumb_div):
You can’t perform that action at this time.