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 bash | |
apt-get -y update | |
apt-get -y install build-essential zlib1g-dev libssl-dev libreadline6-dev libyaml-dev htop tmux | |
cd /tmp | |
wget ftp://ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.3-p327.tar.gz | |
tar -xvzf ruby-1.9.3-p327.tar.gz | |
cd ruby-1.9.3-p327/ | |
./configure --prefix=/usr/local | |
make | |
make install |
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 bash | |
pacman -Syyu | |
pacman -S ruby rsync base-devel | |
gem install chef ruby-shadow --no-ri --no-rdoc --no-user-install |
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
def try_all_permutations(word, dictionary, pos) | |
if word[pos].nil? | |
raise "Position #{pos} not in word list" | |
elsif pos == (word.length - 1) | |
puts word if dictionary.member? word | |
else | |
try_all_permutations(word, dictionary, pos+1) | |
for i in ((pos+1)..(word.length-1)) | |
word[i], word[pos] = word[pos], word[i] |
NewerOlder