Skip to content

Instantly share code, notes, and snippets.

Avatar

Christopher Peplin peplin

View GitHub Profile
@peplin
peplin / config.json
Created Jun 4, 2014
OpenXC custom command to send CAN message
View config.json
{ "buses": {
"hs": {
"controller": 1,
"speed": 500000,
"raw_writable": true
}
},
"commands": [
{"name": "my_custom_command",
"handler": "sendMyCanMessage"
@peplin
peplin / gist:88ef5f26c4cc53160448
Created Mar 19, 2015
Patch conflicting, old version of `six`
View gist:88ef5f26c4cc53160448
import pyxb
# pyxb bundles an old version of the 'six' package (1.5.1) that is not compatible with
# werkzeug 0.10's auto-reloader. It was fixed in six 1.5.2, and the latest
# release is 1.9.0! We work around it by deleting the one problematic module
# that is added (winreg is only available on Windows, Tk on Linux).
import sys
import copy
del sys.modules['pyxb.utils.six.moves.winreg']
for module in copy.copy(sys.modules):
@peplin
peplin / nose2_addressable_test_name.py
Created May 13, 2015
A nose2 plugin to render the name of tests as something you can copy and paste and provide to nose at the command line to run an individual test
View nose2_addressable_test_name.py
from nose2.events import Plugin
class AddressableTestNameOutcome(Plugin):
"""Render name of each test in results as as something you can copy and
paste and provide directly to nose2 at the command line to run a single
test.
"""
configSection = 'addressable_test_name'
@peplin
peplin / klok-to-timetrap.sh
Created Apr 23, 2010
Migrate from Klok to Timetrap
View klok-to-timetrap.sh
#!/bin/bash
#
# Christopher Peplin
# chris.peplin@rhubarbtech.com
#
# A litte script to migrate from Klok to Timetrap.
# Use the "download all time entry data" option in Klok for each project you wish to convert
# to a timesheet in Timestop. The copy and paste (or by some other method)
# convert their HTML table to plain text, with the fields separated by tabs.
#
@peplin
peplin / conkec2.py
Created May 20, 2010
Python script to output current EC2 instance info to a text file for Conky
View conkec2.py
"""
conkec2
Christopher Peplin, chris.peplin@rhubarbtech.com
Python script to output current EC2 instance information to a text file, ideally
for Conky to display on your desktop.
Expects the standard AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY environment
variables to be defined.
@peplin
peplin / install_rubygems.sh
Created May 21, 2010
Install rubygems from source
View install_rubygems.sh
#!/bin/sh
cd /tmp
wget http://rubyforge.org/frs/download.php/69365/rubygems-1.3.6.tgz
tar zxf rubygems-1.3.6.tgz
cd rubygems-1.3.6
sudo ruby setup.rb
sudo ln -sfv /usr/bin/gem1.8 /usr/bin/gem
@peplin
peplin / default_root_object.py
Created Sep 15, 2010
Set the default root object on a CloudFront distribution.
View default_root_object.py
""" Need to serve some static HTML files, but can't use S3 because it won't
resolve index.html for you? Grab a CloudFront distribution from Amazon, point it
to your bucket, and set your index.html as the "default root object".
This code snippet uses the boto (http://code.google.com/p/boto/) Python package
to set the default root object on your distribution.
Christopher Peplin, chris.peplin@rhubarbtech.com
"""
from boto.cloudfront import CloudFrontConnection
@peplin
peplin / install_jcc.sh
Created Dec 5, 2010
Installation script for jcc with shared mode
View install_jcc.sh
#!/bin/bash
source $VIRTUAL_ENV/bin/activate
mkdir -p tmp-jcc
pushd tmp-jcc
ROOT=../$(dirname $0)
unzip -q $VIRTUAL_ENV/lib/python2.6/site-packages/setuptools-0.6c11-py2.6.egg
@peplin
peplin / bulk_tickets.rb
Created Dec 9, 2010
Bulk Lighthouse ticket import from a text file
View bulk_tickets.rb
#!/usr/bin/env ruby
# Bulk Lighthouse ticket import from a text file
# Christopher Peplin, peplin@bueda.com
#
# Used this for taking a big Markdown file of tickets we discussed during a
# meeting and importing them all into Lighthouse. No attempt to be flexible,
# just useful in this one case. One ticket title per line, where headers and
# subheaders are used as tags.
#
# Expects the following pseudo-Markdown text file format:
We couldn’t find that file to show.