Skip to content

Instantly share code, notes, and snippets.

@parente
parente / runinenv.sh
Created February 15, 2011 01:54
run a command in virtualenv, useful for supervisord
#!/bin/bash
VENV=$1
if [ -z $VENV ]; then
echo "usage: runinenv [virtualenv_path] CMDS"
exit 1
fi
. ${VENV}/bin/activate
shift 1
echo "Executing $@ in ${VENV}"
exec "$@"
@parente
parente / public-todo.py
Created March 14, 2011 01:19
Public todo list from a folder in OmniFocus
#!/usr/bin/python
import subprocess
from BeautifulSoup import *
fn = '/Users/parente/todo.html'
title = "Pete's Public Todo List"
subprocess.call(['osascript','todo.scpt'])
f = file(fn)
b = BeautifulSoup(f.read())
f.close()
'''
Copyright (c) Peter Parente 2011. All Rights Reserved.
Licensed under the WTFPL. http://sam.zoy.org/wtfpl/
'''
class Clock:
def __init__(self, seconds=600):
self.meetingTime = seconds
self.meetingTimeTaken = 0
self.userCount = 0
self.users = {}
# generic Python imports
import datetime
import os
import sched
import sys
import tempfile
import threading
import time
# need PyObjC on sys.path...:
@parente
parente / post-merge
Created November 11, 2011 19:35
cowebx post-merge
#!/bin/bash
# activate the virtualenv
. ~/envs/coweb_demo_latest/bin/activate
# reinstall coweb to the env
cd ~/src/coweb
git pull origin master
cd servers/python
pip install .
# deploy the cowebx demos to the env
@parente
parente / custom.css
Created March 19, 2013 17:53
IPython custom.js / custom.css for building a basic outline of header cells in the View menu.
.ui-menu {
width: 300px !important;
}
@parente
parente / md.css
Created June 27, 2013 02:29
Default stylesheet I use for rendering markdown into html based on my lsr.css for restructuredText.
body {
font-family: 'Helvetica Neue', sans;
background: #ffffff;
color: #222;
margin: 2em auto;
padding: 0 2em;
width: 48em;
line-height: 1.5em;
font-size: 16px;
font-weight: 300;
@parente
parente / provision.sh
Last active December 20, 2015 01:29
TotT provisioner script for tottbox_2013_12_31. (With fix for issue #8.)
#!/bin/sh
# stash in a new loc
mv /vagrant/.ssh /vagrant/.keys > /dev/null 2>&1
# copy keys into the VM
cp /vagrant/.keys/github ~vagrant/.ssh/ > /dev/null 2>&1
chown vagrant:vagrant ~vagrant/.ssh/github
chmod 600 ~vagrant/.ssh/github
cp /vagrant/.keys/bitbucket ~vagrant/.ssh/ > /dev/null 2>&1
chown vagrant:vagrant ~vagrant/.ssh/bitbucket
@parente
parente / sally.txt
Created August 7, 2013 03:52
TotT week1-session1
Sally sells seashells by the seashore.
The shells Sally sells are surely from the sea.
Sally sells seashells by the seashore.
The shells Sally sells are surely from the sea.
Sally sells seashells by the seashore.
The shells Sally sells are surely from the sea.
Sally sells seashells by the seashore.
The shells Sally sells are surely from the sea.
Sally sells seashells by the seashore.
The shells Sally sells are surely from the sea.
@parente
parente / panic.log
Created August 16, 2013 02:31
packer boot panic
==> virtualbox: Waiting 4s for boot...
==> virtualbox: Typing the boot command...
panic: EOF
goroutine 50 [running]:
log.Panic(0x7f296424bfa0, 0x1, 0x1)
/Users/mitchellh/go/src/pkg/log/log.go:307 +0xaa
github.com/mitchellh/packer/packer/rpc.func·001()
/Users/mitchellh/code/go/src/github.com/mitchellh/packer/packer/rpc/builder.go:73 +0x23e
created by github.com/mitchellh/packer/packer/rpc.(*builder).Run