Right now, this assumes you are using Snow Leopard.
Homebrew is MacPorts (or APT) without the suck. http://github.com/mxcl/homebrew
#!/usr/bin/env ruby | |
require 'rubygems' | |
require 'thor' | |
require 'twitter' | |
class TNT < Thor | |
map "MESSAGE" => :post | |
desc "post \"message\"", "Post a message to Twitter" |
Rails::Initializer.run do |config| | |
# Read from config/memcached.yml to setup Memcache instance | |
# Individual caching mechanisms are enabled in environment specific configs | |
require 'memcache' | |
mservers = if (File.exist?(mconfig = Rails.root+'config'+'memcached.yml')) | |
YAML.load_file(mconfig)[RAILS_ENV].delete('servers') | |
end | |
MemCacheConnection = MemCache.new(mservers || 'localhost:11211', :namespace => "_myapp") | |
end |
[~] brew install libwmf | |
==> Downloading http://downloads.sourceforge.net/project/wvware/libwmf/0.2.8.4/libwmf-0.2.8.4.tar.gz | |
File already downloaded and cached to /Users/dstrelau/Library/Caches/Homebrew | |
==> ./configure --prefix=/usr/local/Cellar/libwmf/0.2.8.4 --disable-debug | |
checking for a BSD-compatible install... /usr/bin/install -c | |
checking whether build environment is sane... yes | |
checking for gawk... no | |
checking for mawk... no | |
checking for nawk... no | |
checking for awk... awk |
Right now, this assumes you are using Snow Leopard.
Homebrew is MacPorts (or APT) without the suck. http://github.com/mxcl/homebrew
# | |
# Rack middleware to log both request info and server response. | |
# | |
# Usage: | |
# use RequestResponseLogger, | |
# :logfile => Rails.root.join('log','mobile.log'), | |
# :path => /^\/mobile\// | |
class RequestResponseLogger | |
def initialize(app, options={}) |
server { | |
error_page 503 @503; | |
location = /503.html { } | |
location = /down_for_maintenance.html { } | |
location @503 { | |
# If we are in maintenance mode and returning a 503, | |
# show the special maintenance page | |
if ( -f $document_root/SHOW_MAINTENANCE_PAGE ) { | |
rewrite ^.*$ /down_for_maintenance.html; |
[~] brew install redis | |
/usr/local/Library/Formula/redis.rb:3: warning: already initialized constant REDIS_CONF | |
==> Downloading http://redis.googlecode.com/files/redis-1.02.tar.gz | |
######################################################################## 100.0% | |
==> make | |
/Developer/usr/llvm-gcc-4.2/bin/llvm-gcc-4.2 -c -O4 -march=core2 -mmmx -msse3 -w -pipe -fomit-frame-pointer -mmacosx-version-min=10.6 -g -rdynamic -ggdb adlist.c | |
/Developer/usr/llvm-gcc-4.2/bin/llvm-gcc-4.2 -c -O4 -march=core2 -mmmx -msse3 -w -pipe -fomit-frame-pointer -mmacosx-version-min=10.6 -g -rdynamic -ggdb ae.c | |
/Developer/usr/llvm-gcc-4.2/bin/llvm-gcc-4.2 -c -O4 -march=core2 -mmmx -msse3 -w -pipe -fomit-frame-pointer -mmacosx-version-min=10.6 -g -rdynamic -ggdb anet.c | |
/Developer/usr/llvm-gcc-4.2/bin/llvm-gcc-4.2 -c -O4 -march=core2 -mmmx -msse3 -w -pipe -fomit-frame-pointer -mmacosx-version-min=10.6 -g -rdynamic -ggdb dict.c | |
/Developer/usr/llvm-gcc-4.2/bin/llvm-gcc-4.2 -c -O4 -march=core2 -mmmx -msse3 -w -pipe -fomit-frame-pointer |
#!/usr/bin/env ruby | |
require 'typhoeus' | |
HOST = 'http://yourhost.com' | |
CONCURRENTS = 5 | |
urls = File.readlines(ARGV.shift) | |
hydra = Typhoeus::Hydra.new | |
queue_req = lambda do |resp| |
source "http://gems.github.com" | |
source "http://gemcutter.org" | |
bundle_path "vendor/bundled_gems" | |
gem "rails", "2.3.4" | |
gem "aasm", "2.1.1" | |
gem "activemerchant", "1.4.2", :require_as => "active_merchant" | |
gem "alchemy", "0.11.2" ### A private gem. It depends on "httparty", "> 0.3" | |
gem "fastercsv", "1.5.0" |
POSSIBLE = [('a'..'z'),('A'..'Z'),(0..9),'.','/'].inject([]) {|s,r| s+Array(r)} | |
def shadow(password) | |
salt = Array.new(8) { POSSIBLE[ rand(POSSIBLE.size) ] } | |
password.crypt("$1$#{salt}") | |
end |