This file contains 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
## delay sourcing venv to workon call | |
## replace "source /Library/Frameworks/Python.framework/Versions/2.6/bin/virtualenvwrapper.sh" | |
## with below block | |
function load_env { | |
if [ type -p workon &> /dev/null ]; then | |
# nothing, source is loaded | |
workon "$@" | |
else | |
unalias workon | |
source /Library/Frameworks/Python.framework/Versions/2.6/bin/virtualenvwrapper.sh |
This file contains 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
http://stackoverflow.com/questions/598672/git-how-to-squash-the-first-two-commits | |
# Go back to the last commit that we want to form the initial commit (detach HEAD) | |
git checkout <sha1_for_B> | |
# reset the branch pointer to the initial commit, | |
# but leaving the index and working tree intact. | |
git reset --soft <sha1_for_A> | |
# amend the initial tree using the tree from 'B' |
This file contains 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
#!/usr/bin/env python | |
### Requires latest boto (cuz I checked in code to boto a moment ago) | |
import uuid | |
from boto.mturk.connection import MTurkConnection | |
from boto.mturk.question import Question, QuestionForm, QuestionContent | |
from boto.mturk.question import AnswerSpecification, FreeTextAnswer | |
from boto.mturk.question import Overview | |
#from boto.mturk.qualification import Qualifications # these exist! |
This file contains 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
## actually install them all these (use -s to simulate -- not install) | |
sudo apt-get -y upgrade | |
sudo apt-get -y install build-essential ssh openssl nginx python-dev locate python-virtualenv \ | |
git-core libevent-dev curl nmap fail2ban python-pycurl netcat cryptcat socat gdb python-scapy python-crypto wireshark python-pyx | |
## python-scapy python-crypto wireshark python-pyx are for admin scripts etc | |
## restart? | |
# sudo init 6 |
This file contains 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
# derived from http://www.jonathanmoeller.com/screed/?p=1669 | |
# and comments, and needed modifications to work on 10.10 | |
sudo cp /etc/network/interfaces /etc/network/interfaces~backup | |
sudo vi /etc/network/interfaces | |
## leave this alone | |
## auto lo | |
## iface lo inet loopback |
This file contains 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
/* | |
filename: basic.css | |
http://unlicense.org/ | |
author: gregory tomlinson | |
*/ | |
*{ padding:0; margin:0; } | |
h1,h2,h3,h4,h5,h6,input,textarea,select,option, body { | |
font-family:Arial, sans-serif; |
This file contains 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
## http://stackoverflow.com/questions/675370/tab-completion-in-python-interpreter-in-os-x-terminal/987402#987402 | |
import rlcompleter | |
import readline | |
readline.parse_and_bind ("bind ^I rl_complete") | |
#Whereas this one does not: | |
#import readline, rlcompleter | |
#readline.parse_and_bind("tab: complete") |
This file contains 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
# display current git branch | |
export WORKON_HOME=$HOME/.virtualenvs | |
source /usr/local/bin/virtualenvwrapper.sh | |
function has_virtualenv { | |
if [ -e .venv ]; then | |
curr_env=`cat .venv` |
This file contains 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 pylibmc | |
import Queue | |
import logging | |
import functools | |
""" | |
This is a transparent pool library that wraps a pylibmc client | |
from MemcachePool import mc | |
mc.get(key) |
This file contains 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
# sample for 127.0.0.1:4414 | |
simplequeue -p 4414 -a 127.0.0.1 | |
The actual code for command line args to simplequeue: | |
address = "0.0.0.0"; | |
port = 8080; | |
opterr = 0; |