Skip to content

Instantly share code, notes, and snippets.

rduplain / supervisord_minimal.conf
Created Sep 2, 2010
Configuration examples for supervisord, a process control system for projects.
View supervisord_minimal.conf
rduplain /
Created Oct 5, 2010
SysV init script for fancontrol to keep deskside servers quiet (USE WITH CAUTION).
#! /bin/sh
# Save as /etc/init.d/fancontrol
# update-rc.d fancontrol defaults 90 10
# Based on /etc/init.d/skeleton
# Tested on a Supermicro 1U box running Ubuntu 10.04 x86_64.
# Provides: fancontrol
# Required-Start:
# Required-Stop:
rduplain /
Created Oct 5, 2010
Instructions and configuration to get started with gitolite git hosting.

Git Hosting

  • provides great public repository hosting.
  • vanilla git over ssh works for simple project structures.
  • gitosis works well where you'd like to use ssh pubkeys without shell access.
  • gitolite works well where you'd like gitosis to have finer access control.

How I setup our gitolite server

rduplain / mirror-github
Created Feb 1, 2011
Mirror a GitHub project to a local filesystem.
View mirror-github
# usage: mirror-github <account_name> <project_name>
git clone --mirror${1}/${2}.git
rduplain / README.rst
Created Feb 13, 2011
Demonstrate use of fixture with Flask-SQLAlchemy and Flask-Testing.
View README.rst

Demonstrate use of fixture with Flask-SQLAlchemy and Flask-Testing. February 13, 2011 Ron DuPlain <>

Post any feedback to:

Get this gist:

git clone git:// Flask-SQLAlchemy-Fixture
cd Flask-SQLAlchemy-Fixture
rduplain /
Created Feb 17, 2011
Sample prototyping schema for use with vanilla Apache Solr 1.4.1 download.

Sample prototyping schema for use with vanilla Apache Solr 1.4.1 download.

tar -xvzf ~/download/apache-solr-1.4.1.tgz
cd apache-solr-1.4.1/example/
vi solr/conf/schema.xml # edit into something like the schema here
java -jar start.jar # look for errors, otherwise have fun!

Start prototyping! To clean out the data index and start over, interrupt the Jetty server (Control-C) and:

rduplain / dropbox.conf
Created Apr 21, 2011
Dropbox Upstart
View dropbox.conf
description "Sync Dropbox web-based file share on local system."
author "Ron DuPlain <>"
start on (net-device-up
and local-filesystems
and runlevel [2345])
stop on runlevel [!2345]
env LANG=en_US.UTF-8
rduplain / directories.bash
Created Aug 26, 2011
Answering: how can I reference the scripts directory and the working directory in GNU bash?
View directories.bash
# `dirname` is part of GNU coreutils, but is okay to use since it's in the Unix standard.
DIRNAME=`dirname $0`
echo script is at $DIRNAME
# Alternative, use pure bash substitution.
echo script is at $DIRNAME
rduplain / gist:1249199
Created Sep 28, 2011
Get a module's docstring in Python without executing it.
View gist:1249199
import code
def get_module_docstring(filepath):
"Get module-level docstring of Python module at filepath, e.g. 'path/to/'."
co = compile(open(filepath).read(), filepath, 'exec')
if co.co_consts and isinstance(co.co_consts[0], basestring):
docstring = co.co_consts[0]
docstring = None
return docstring
rduplain /
Created Oct 5, 2011
Simple Python HTTP client for tests, maintains cookies.
import cookielib
import urllib
import urllib2
class Client(object):
def __init__(self):
self.cookie_jar = cookielib.CookieJar()
self.opener = urllib2.build_opener(