curl https://gist.github.com/raw/970438/caff9a09ed2d223b1123a69ede17cb19ad352af9/build.sh | sh
#Mac OS X
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
# for some reason facter takes the raw memorysize and reports it as | |
# a formatted string, which is useless for calculation | |
# | |
Facter.add("memorysize_raw") do | |
confine :kernel => :linux | |
setcode do | |
size = 0 | |
File.readlines("/proc/meminfo").each do |l| | |
size = $1.to_f if l =~ /^MemTotal:\s+(\d+)/ |
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/sh | |
# Git push then pull over ssh | |
# | |
# Supposing you have these environments on the same ssh git remote: | |
# project/origin.git | |
# project/dev/.git | |
# project/prod/.git | |
# | |
# You can then push the current branch and pull it in dev/ and prod/ by doing: | |
# $ git deploy dev |
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
require 'capistrano/version' | |
load 'deploy' | |
# Customize the following variables | |
set :domain, "host.example.com" | |
set :user, "username" | |
set :application, "my_wordpress_blog" | |
set :deploy_to, "/var/www/apps/#{application}" | |
# These variables probably don't need to change |
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
require 'sinatra_app' | |
require 'test/unit' | |
require 'rack/test' | |
set :environment, :test | |
class SinatraAppTest < Test::Unit::TestCase | |
include Rack::Test::Methods | |
# Make all tests transactional. |
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/sh | |
ME=soho | |
DIR=/Users/$ME/Sites/$1 | |
if [ ! -d $DIR ] | |
then | |
sudo -u $ME mkdir $DIR | |
sudo -u $ME touch $DIR/index.php | |
echo "<h1>$1</h1>" >> $DIR/index.php | |
fi |
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/sh | |
ME=your-username | |
DIR=/Users/$ME/Sites/$1 | |
if [ ! -d $DIR ] | |
then | |
sudo -u $ME mkdir $DIR | |
sudo -u $ME touch $DIR/index.php | |
echo "<h1>$1</h1>" >> $DIR/index.php | |
fi |
NewerOlder