This file contains hidden or 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
Host foo | |
User blah | |
HostName foo.bar.baz | |
Port 42 |
This file contains hidden or 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
import fabric.api | |
from contextlib import contextmanager | |
@contextmanager | |
def shell(new_shell): | |
old_shell, env.shell = env.shell, new_shell | |
yield | |
env.shell = old_shell |
This file contains hidden or 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
good discussion at | |
http://www.last.fm/group/Steampunk/forum/42787/_/376230 | |
some interesting first starts | |
http://sites.google.com/site/chinasteamengine/ | |
http://www.lifesdecay.com/Home/Home.html | |
your life will get very strange for a little while after clicking this link | |
http://www.youtube.com/watch?v=cycXIYdFGsQ |
This file contains hidden or 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 | |
# This hook is run after every virtualenv is activated. | |
script="$VIRTUALENVWRAPPER_HOOK_DIR/postactivate-"$(basename $VIRTUAL_ENV) | |
if [ -r $script ]; then | |
source $script | |
fi |
This file contains hidden or 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
# encoding: utf-8 | |
class DotDict(dict): | |
def __init__(self, *a, **kw): | |
dict.__init__(self, *a, **kw) | |
for key in self: | |
self._validate_key(key) | |
def _validate_key(self, key): |
This file contains hidden or 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
# create a temporary directory | |
mkdir tmp_python; cd tmp_python | |
# symlink "python" to the interpreter you want | |
ln -s `which python2.6` python | |
# have mkvirtualenv use the python symlink | |
PATH="$PWD:$PATH" mkvirtualenv py26party | |
# clean up | |
cd ..; rm -rf tmp_python |
This file contains hidden or 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
import logging | |
from termcolor import colored | |
class ColorLog(object): | |
colormap = dict( | |
debug=dict(color='grey', attrs=['bold']), | |
info=dict(color='white'), | |
warn=dict(color='yellow', attrs=['bold']), |
This file contains hidden or 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
import os | |
import subprocess | |
import shlex | |
def bail_if_another_is_running(): | |
cmd = shlex.split("pgrep -u {} -f {}".format(os.getuid(), __file__)) | |
pids = subprocess.check_output(cmd).strip().split('\n') | |
if len(pids) > 1: | |
pids.remove("{}".format(os.getpid())) |
This file contains hidden or 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
x='http://letsrevolutionizetesting.com/challenge'; while :; do r=`curl -s -H "Accept: application/json" $x`; x=`echo $r | grep -E -o 'http[^"]+'`; if ! echo "$x" | grep -q http; then echo $r; break; fi; echo $x; done |
This file contains hidden or 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
# encoding: utf-8 | |
import sys | |
import monocle | |
monocle.init("twisted") | |
from monocle import _o | |
from monocle.stack import eventloop | |
import txredis.client | |
from twisted.internet import reactor, protocol |
OlderNewer