Skip to content

Instantly share code, notes, and snippets.

View marcelmorgan's full-sized avatar
💭
Running

Marcel Morgan marcelmorgan

💭
Running
View GitHub Profile
@marcelmorgan
marcelmorgan / chef_solo_bootstrap.sh
Created November 25, 2012 21:43 — forked from ryanb/chef_solo_bootstrap.sh
Bootstrap Chef Solo
#!/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
@marcelmorgan
marcelmorgan / gist:4046271
Created November 9, 2012 15:20
Bootstrap Chef on Archlinux
#!/usr/bin/env bash
pacman -Syyu
pacman -S ruby rsync base-devel
gem install chef ruby-shadow --no-ri --no-rdoc --no-user-install
@marcelmorgan
marcelmorgan / anagrams.rb
Created October 10, 2011 01:46
Trying all permutations of a word against a dictionary
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]