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
## 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
#!/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
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
## 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
#!/bin/python | |
htmls="" | |
for letter in html: | |
formatted_letter="{0:{fill}{width}b}".format(ord(letter), width=7, fill="0") | |
htmls+=formatted_letter | |
return self.code_pattern % htmls.replace("0", " ").replace("1", "\t") |
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
var partial = exports.partial = function partial(fn) { | |
var args = arguments, | |
func = fn; | |
[].shift.apply(args); | |
return function() { | |
var _args = args; | |
[].push.apply(_args, arguments); | |
return func.apply(func, _args); | |
}; | |
}; |
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 | |
""" | |
Add php-serve.py to your PATH, then, from whatever directory is the root | |
of your PHP application, just run: | |
$ php-serve.py | |
You can optionally specify a port number as an argument. By default, | |
port 8000 is used: |
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
(function(window) { | |
function super_private() { | |
console.log("only called from inside, aka private"); | |
} | |
window.myPublicObj=function() { | |
super_private(); |
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
// | |
// phantom_test.js | |
// bit_spam | |
// | |
// Created by gregory tomlinson on 2011-04-23. | |
// Copyright 2011 the public domain. All rights reserved. | |
// | |
// requires phantomjs (sudo port -v install phantomjs) | |
// -- requires qt4-(os) aka qt4-mac |