This file contains hidden or 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
require 'rubygems' | |
require 'aws-sdk' | |
puts "\nLoading instances..." | |
if File.exist?('instances.yaml') | |
instances_by_id = YAML.load_file('instances.yaml') | |
puts "Loaded %d instances from instances.yaml" % [instances_by_id.count] | |
else | |
instances_by_id = Hash.new | |
ec2 = AWS::EC2.new |
This file contains hidden or 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
1. Install all the required libraries: | |
sudo apt-get update && sudo apt-get -y install \ | |
unzip \ | |
perl \ | |
wget \ | |
curl \ | |
make \ | |
ncftp \ | |
liburi-perl \ |
This file contains hidden or 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://virtual-machine.org/debian-6-amd64-x86_64-vmware-image-download |
This file contains hidden or 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 | |
EC2_DIR=/usr/local/ec2 | |
wget http://s3.amazonaws.com/ec2-downloads/ec2-api-tools.zip -O ec2-api-tools.zip | |
wget http://s3.amazonaws.com/ec2-downloads/ec2-ami-tools.zip -O ec2-ami-tools.zip | |
mkdir -p $EC2_DIR | |
rm -rf $EC2_DIR/* | |
unzip -o -d $EC2_DIR ec2-api-tools.zip | |
unzip -o -d $EC2_DIR ec2-ami-tools.zip | |
cp -r $EC2_DIR/ec2-api-tools*/* $EC2_DIR | |
cp -r $EC2_DIR/ec2-ami-tools*/* $EC2_DIR |
This file contains hidden or 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
echo "sun-java6-jdk shared/accepted-sun-dlj-v1-1 boolean true" | debconf-set-selections | |
DEBIAN_FRONTEND=noninteractive aptitude install -y -f sun-java6-jre sun-java6-bin sun-java6-jdk |
This file contains hidden or 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
Some tests... | |
Number of unique paths from (0,0) to (0,0) on board of size 1x1 is 1 | |
Number of unique paths from (0,0) to (1,1) on board of size 2x2 is 2 | |
Number of unique paths from (0,0) to (2,2) on board of size 3x3 is 12 | |
Number of unique paths from (0,0) to (3,3) on board of size 4x4 is 184 | |
Number of unique paths from (0,0) to (4,4) on board of size 5x5 is 8512 |
This file contains hidden or 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 vim /etc/sysctl.conf | |
#Increase ephemeral port range | |
net.inet.ip.portrange.first=32768 | |
#Decrease closing timeout | |
net.inet.tcp.msl=1000 |
This file contains hidden or 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 perl -pi -e 's|(\x52\x6F\x74\x61\x74\x69\x6F\x6E\x61\x6C\x00).{9}(\x00\x51)|$1\x41\x50\x50\x4C\x45\x20\x53\x53\x44$2|sg' /System/Library/Extensions/IOAHCIFamily.kext/Contents/PlugIns/IOAHCIBlockStorage.kext/Contents/MacOS/IOAHCIBlockStorage | |
sudo kextcache -system-prelinked-kernel | |
sudo kextcache -system-caches | |
sudo cp /System/Library/Extensions/IOAHCIFamily.kext/Contents/PlugIns/IOAHCIBlockStorage.kext/Contents/MacOS/IOAHCIBlockStorage.original /System/Library/Extensions/IOAHCIFamily.kext/Contents/PlugIns/IOAHCIBlockStorage.kext/Contents/MacOS/IOAHCIBlockStorage |
This file contains hidden or 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
Add "user_pref("general.useragent.override", "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:15.0) Gecko/20120427 Firefox/15.0a1");" | |
to prefs file: /usr/lib/firefox/defaults/pref/channel-prefs.js |
This file contains hidden or 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
Terminal -> Preferences -> Settings -> Keyboard tab | |
Home - \001 (or press Ctrl+a) | |
End - \005 (or press Ctrl+e) | |
Page Up - \033[5~ | |
Page Down - \033[6~ |