Skip to content

Instantly share code, notes, and snippets.

@brainsik
brainsik / terraform.log
Last active February 24, 2016 01:32
Reproducing Terraform GH Issue #5290
$ terraform plan
Refreshing Terraform state prior to plan...
The Terraform execution plan has been generated and is shown below.
Resources are shown in alphabetical order for quick scanning. Green resources
will be created (or destroyed and then created if an existing resource
exists), yellow resources are being changed in-place, and red resources
will be destroyed.
@brainsik
brainsik / terraform.log
Last active February 23, 2016 03:04
Reproducing Terraform GH Issue #4488
$ terraform plan
Refreshing Terraform state prior to plan...
The Terraform execution plan has been generated and is shown below.
Resources are shown in alphabetical order for quick scanning. Green resources
will be created (or destroyed and then created if an existing resource
exists), yellow resources are being changed in-place, and red resources
will be destroyed.
@brainsik
brainsik / get_me_loggin.py
Last active December 30, 2015 07:49
Quick logging config for Python shell
import logging; logging.basicConfig(level=logging.DEBUG)
@brainsik
brainsik / Python.sublime-settings
Created December 3, 2013 01:50
My ST3 Python 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
brainsik / monocle_tx_redis_sub.py
Created November 14, 2013 22:21
Monocle Twisted Redis subscriber
# 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
@brainsik
brainsik / curlit.sh
Created October 31, 2013 21:15
Solves the "coding" challenge at letsrevolutionizetesting.com
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
@brainsik
brainsik / example.sh
Created July 31, 2011 15:49
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
brainsik / postactivate
Created June 5, 2011 20:42
Keep per virtualenv postactivate scripts in WORKON_HOME
#!/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
@brainsik
brainsik / gist:976895
Created May 17, 2011 17:20 — forked from mwhooker/gist:969121
ambient steampunk
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
@brainsik
brainsik / gist:971526
Created May 13, 2011 23:57
sudo -H for Fabric
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