This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /bin/bash | |
# readonlyroot.sh -- Setup dirs on the tmpfs to keep the root partition read-only | |
# See-Also: http://roland.entierement.nu/pages/debian-on-soekris-howto.html | |
# Available-At: https://gist.github.com/1216392 | |
# | |
# Place this file in /etc/init.d and run: | |
# sudo update-rc.d readonlyroot.sh start 04 S | |
# | |
# To maintain persistent data, place a file at /etc/cron.d/readonlyroot as: | |
# 0 * * * * root /etc/init.d/readonlyroot.sh save >/dev/null |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* emacs settings: -*- c-basic-offset: 8 tab-width: 8 -*- | |
* | |
* pgrep/pkill -- utilities to filter the process table | |
* | |
* Copyright 2000 Kjetil Torgrim Homme <kjetilho@ifi.uio.no> | |
* | |
* May be distributed under the conditions of the | |
* GNU General Public License; a copy is in COPYING | |
* | |
* Changes by Albert Cahalan, 2002,2006. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import argparse | |
import ConfigParser | |
class FakeSecHead(object): | |
def __init__(self, fp): | |
self.fp = fp | |
self.name = fp.name | |
self.sechead = '[DEFAULT]\n' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# http://pastebin.com/prQgYHzQ | |
import os | |
from deform.interfaces import FileUploadTempStore | |
from datetime import datetime, timedelta | |
import pickle | |
from cStringIO import StringIO | |
class BeakerTempStore(FileUploadTempStore): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# http://tanner-tech.googlecode.com/svn-history/r197/trunk/NewWorldMap/cardgen/eniCards.py | |
import Image, ImageDraw, ImageFont | |
# load an existing image | |
photo = Image.open("lyn.jpg") | |
photoSize = photo.size | |
# create a new, empty image | |
card = Image.new('RGB', (600, 600), color=(255,255,255)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// From zarvox.org/shortlog/static/recorder.py | |
def choose_camera_device(): | |
"""Lets the user pick an external video device to use from /dev/video*""" | |
videodevs = ["/dev/" + x for x in os.listdir("/dev/") if x.startswith("video") ] | |
#print videodevs | |
if len(videodevs) == 1: | |
print "Found exactly one video device; using", videodevs[0] | |
return videodevs[0] | |
if len(videodevs) == 0: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
#inspired by http://art.ubuntuforums.org/showpost.php?p=9744970&postcount=19 | |
#...and http://thecodecentral.com/2011/01/18/fix-ubuntu-10-10-suspendhibernate-not-working-bug | |
# tidied by tqzzaa :) | |
VERSION=1.1 | |
DEV_LIST=/tmp/usb-dev-list | |
DRIVERS_DIR=/sys/bus/pci/drivers | |
DRIVERS="ehci xhci" # ehci_hcd, xhci_hcd | |
HEX="[[:xdigit:]]" |