Skip to content

Instantly share code, notes, and snippets.

@dlutzy
dlutzy / gist:2469037
Created Apr 23, 2012
Multi VM Vagrantfile
View gist:2469037
# -*- mode: ruby -*-
# vi: set ft=ruby :
# David Lutz's Multi VM Vagrantfile
# inspired from Mark Barger's https://gist.github.com/2404910
boxes = [
{ :name => :web, :role => 'web_dev', :ip => '192.168.33.1', :ssh_port => 2201, :http_fwd => 9980, :cpus =>4, :shares => true },
{ :name => :data, :role => 'data_dev', :ip => '192.168.33.2', :ssh_port => 2202, :mysql_fwd => 9936, :cpus =>4 },
{ :name => :railsapp, :role => 'railsapp_dev', :ip => '192.168.33.3', :ssh_port => 2203, :http_fwd => 9990, :cpus =>1}
]
@dlutzy
dlutzy / gist:3484521
Created Aug 27, 2012
Test Driven Sysadmin 1
View gist:3484521
apt-get -y install links
@dlutzy
dlutzy / gist:3484567
Created Aug 27, 2012
Test Driven Sysadmin 2
View gist:3484567
#!/bin/bash
if which links > /dev/null
then
echo "Test passed. links is already installed"
else
echo "Test failed. links is not installed, installing now..."
echo "apt-get -y install links"
apt-get -y install links
@dlutzy
dlutzy / gist:3484576
Created Aug 27, 2012
Test Driven Sysadmin 3
View gist:3484576
#!/bin/bash
function installinator()
{
if which apt-get > /dev/null
then
echo "I'm a debian based system probably ubuntu"
INSTALLER="apt-get"
fi
if which yum > /dev/null
@dlutzy
dlutzy / gist:3484619
Created Aug 27, 2012
Babushka Dependancy Template
View gist:3484619
dep 'dependancy name' do
met? {
}
meet {
}
end
@dlutzy
dlutzy / links1.rb
Created Aug 27, 2012
Test Driven Sysadmin 4
View links1.rb
dep 'links is installed' do
met? {
which "links"
}
meet {
log "Test failed. links is not installed, installing now..."
shell "apt-get -y install links"
}
@dlutzy
dlutzy / links2.rb
Created Aug 27, 2012
Test Driven Sysadmin 5
View links2.rb
dep 'links.bin' do
met? {
which "links"
}
installs {
via :apt, "links"
}
end
@dlutzy
dlutzy / links3.rb
Created Aug 27, 2012
Test Driven Sysadmin 6
View links3.rb
dep 'links.bin' do
met? {
which "links"
}
installs "links"
end
@dlutzy
dlutzy / links4.rb
Created Aug 27, 2012
Test Driven Sysadmin 7
View links4.rb
dep 'links.bin' do
installs "links"
end
@dlutzy
dlutzy / links5.rb
Created Aug 27, 2012
Test Driven Sysadmin 7
View links5.rb
dep 'links.bin'