Skip to content

Instantly share code, notes, and snippets.

@razrichter
razrichter / calibre
Created November 27, 2012 23:12
Calibre Server upstart script
#! /bin/sh
### BEGIN INIT INFO
# Provides: calibre
# Required-Start: network
# Required-Stop:
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Controls the Calibre content server
# Description: Controls the Calibre content web server
#
@razrichter
razrichter / enum.py
Created April 27, 2012 16:10
Simple python enum
# as copied from http://stackoverflow.com/a/1695250
def enum(*sequential, **named):
enums = dict(zip(sequential, range(len(sequential))), **named)
return type('Enum', (), enums)