Skip to content

Instantly share code, notes, and snippets.

brainsik / gist:775788
Created Jan 12, 2011
Wolever, put this in your .ssh/config
View gist:775788
Host foo
User blah
Port 42
brainsik / gist:971526
Created May 13, 2011
sudo -H for Fabric
View gist:971526
import fabric.api
from contextlib import contextmanager
def shell(new_shell):
old_shell, =, new_shell
yield = old_shell
brainsik / gist:976895
Created May 17, 2011 — forked from mwhooker/gist:969121
ambient steampunk
View gist:976895
good discussion at
some interesting first starts
your life will get very strange for a little while after clicking this link
brainsik / postactivate
Created Jun 5, 2011
Keep per virtualenv postactivate scripts in WORKON_HOME
View postactivate
# This hook is run after every virtualenv is activated.
script="$VIRTUALENVWRAPPER_HOOK_DIR/postactivate-"$(basename $VIRTUAL_ENV)
if [ -r $script ]; then
source $script
brainsik /
Created Jul 31, 2011
hack so mkvirtualenv uses a different interpreter
# 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
brainsik /
Created Oct 31, 2013
Solves the "coding" challenge at
x=''; 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
brainsik /
Created Nov 14, 2013
Monocle Twisted Redis subscriber
# encoding: utf-8
import sys
import monocle
from monocle import _o
from monocle.stack import eventloop
import txredis.client
from twisted.internet import reactor, protocol
View Python.sublime-settings
"color_scheme": "Packages/User/Text Ex Machina bsik.tmTheme",
"translate_tabs_to_spaces": true,
"auto_complete_triggers": [{"selector": "source.python - string - comment - constant.numeric", "characters": "."}],
"complete_parameters": true,
"pep8_ignore": ["E501"]
brainsik /
Last active Dec 30, 2015
Quick logging config for Python shell
import logging; logging.basicConfig(level=logging.DEBUG)