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 random | |
def functionToCall(x="..."): | |
print "I got called with " + x + "!" | |
class SwitchTest: | |
state = {} | |
state_dict = {0: {"stat": "one", "function": functionToCall}, |
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/bash | |
brew install libmemcached | |
easy_install pip | |
pip install virtualenv | |
virtualenv VENV | |
source VENV/bin/activate | |
export CFLAGS=-Qunused-arguments | |
export CPPFLAGS=-Qunused-arguments | |
pip install pylibmc |
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
sudo ln -s /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain /Applications/Xcode.app/Contents/Developer/Toolchains/OSX10.9.xctoolchain |
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/bash | |
V_PATH=. | |
VENV=VENV | |
# check for folder path and name... | |
if [ $1 ]; then | |
V_PATH=$1 | |
fi | |
if [ $2 ]; then | |
VENV=$2 |
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/bash | |
sudo ssh-keygen -b 1024 -t rsa -f /etc/ssh/ssh_host_key | |
sudo ssh-keygen -b 1024 -t rsa -f /etc/ssh/ssh_host_rsa_key | |
sudo ssh-keygen -b 1024 -t dsa -f /etc/ssh/ssh_host_dsa_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
#!/bin/bash | |
echo "deb http://apt.newrelic.com/debian/ newrelic non-free" > newrelic.list | |
sudo cp newrelic.list /etc/apt/sources.list.d/newrelic.list | |
rm newrelic.list | |
# | |
wget -O- https://download.newrelic.com/548C16BF.gpg | sudo apt-key add - | |
sudo apt-get update | |
sudo apt-get install newrelic-sysmond | |
# | |
sudo nrsysmond-config --set license_key=$1 |
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/bash | |
wget http://archive.cloudera.com/cm5/installer/latest/cloudera-manager-installer.bin | |
chmod u+x cloudera-manager-installer.bin | |
sudo ./cloudera-manager-installer.bin |
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/bash | |
yum --enablerepo rpmforge install dkms | |
yum groupinstall -y "Development Tools" | |
yum install -y kernel-devel |
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
""" | |
The goal here is to create a "switch" like environment to allow for using | |
strings and other representations for dynamic comparison of two values. | |
Uses the operator library: https://docs.python.org/2/library/operator.html | |
""" | |
import operator | |
OPS = { | |
'=': operator.eq, |
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/bash | |
sudo iptables -A INPUT -i tun+ -j ACCEPT | |
sudo iptables -A FORWARD -i tun+ -j ACCEPT | |
sudo iptables -A FORWARD -i tun+ -o eth0 -m state --state RELATED,ESTABLISHED -j ACCEPT | |
sudo iptables -A FORWARD -i eth0 -o tun+ -m state --state RELATED,ESTABLISHED -j ACCEPT | |
# be sure to replace 10.8.0.0/24 with whatever is in your settings, this example for default install | |
sudo iptables -t nat -A POSTROUTING -s 10.8.0.0/24 -o eth0 -j MASQUERADE | |
sudo iptables -A OUTPUT -o tun+ -j ACCEPT |
OlderNewer