Skip to content

Instantly share code, notes, and snippets.

View gregorynicholas's full-sized avatar
💀
alter.

gregory nicholas gregorynicholas

💀
alter.
View GitHub Profile
@samuel
samuel / supervisor-errmail.py
Created December 17, 2010 02:50
Supervisor event listener that emails on a proces writing to stderr
#!/usr/bin/env python
import os
import smtplib
import sys
import time
from optparse import OptionParser
from supervisor import childutils
@skorokithakis
skorokithakis / zipimport.py
Created January 9, 2011 18:46
Import zips and eggs for AppEngine.
import sys, os
package_dir = "packages"
sys.path.insert(0, package_dir)
for filename in os.listdir(package_dir):
if filename.endswith((".zip", ".egg")):
sys.path.insert(0, "%s/%s" % (package_dir, filename))
@hramos
hramos / manifest.plist
Created January 11, 2011 14:29
Sample manifest file for Over The Air iOS deployment
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>items</key>
<array>
<dict>
<key>assets</key>
<array>
<dict>
@mdornseif
mdornseif / Makefile
Created January 12, 2011 23:25
tag deploys for appengine
deploy: dependencies check
# index must be clean (no modified files)
git diff-index --quiet --cached HEAD
# no uncomitted changes
git diff-files --quiet
# create a branch for the current version
git branch -f deploy_`grep -E '^version: ' app.yaml | cut -d ' ' -f 2`
# push current code to that branch
git push -f . deploy_`grep -E '^version: ' app.yaml | cut -d ' ' -f 2`
@didip
didip / supervisord-example.conf
Created January 30, 2011 05:10
Example configuration file for supervisord.conf
[unix_http_server]
file=/tmp/supervisor.sock ; path to your socket file
[supervisord]
logfile=/var/log/supervisord/supervisord.log ; supervisord log file
logfile_maxbytes=50MB ; maximum size of logfile before rotation
logfile_backups=10 ; number of backed up logfiles
loglevel=error ; info, debug, warn, trace
pidfile=/var/run/supervisord.pid ; pidfile location
nodaemon=false ; run supervisord as a daemon
kern.ostype = Darwin
kern.osrelease = 10.6.0
kern.osrevision = 199506
kern.version = Darwin Kernel Version 10.6.0: Wed Nov 10 18:13:17 PST 2010; root:xnu-1504.9.26~3/RELEASE_I386
kern.maxvnodes = 132096
kern.maxproc = 532
kern.maxfiles = 12288
kern.argmax = 262144
kern.securelevel = 0
kern.hostname = taquito.local
(function() {
var events = ["load", "error"];
events.forEach(function(type) {
document.addEventListener(type, function(e) {
console.log('[Event] ' + type, e.target);
}, true);
});
})();
@dpwiz
dpwiz / buildenv.sh
Created February 28, 2011 19:02
Prepare to deploy stuff
mkdir -p reports
REPO="http://127.0.0.1:8888"
echo Checking for local repo at ${REPO}
curl -f --head ${REPO} > /dev/null 2>&1 || REPO='http://pypi.python.org/simple'
echo "... will use ${REPO}"
echo 'Creating "venv" environment...'
virtualenv --distribute --no-site-packages venv
@samuel
samuel / logstats.py
Created March 8, 2011 18:51
Log file tailer to send events to statsd
#!/usr/bin/env python
from __future__ import with_statement
import random
import re
import select
import socket
import time
from optparse import OptionParser
@darktable
darktable / app.yaml
Created March 16, 2011 19:10
GAE: App.yaml designed for serving a static site on Google App Engine (Python). Copy your static html and files into a folder called "static" next to app.yaml. Contains a bunch of mimetype declarations from html5boilerplate's .htaccess. May not be neces
application: you-app-name-here
version: 1
runtime: python
api_version: 1
default_expiration: "30d"
handlers:
- url: /(.*\.(appcache|manifest))
mime_type: text/cache-manifest