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/bash -xe | |
EBS_DEVICE='/dev/sdh' | |
INSTANCE_ID=$1 | |
AKI=${2:-'aki-5f15f636'} | |
ARI=${3:-'ari-0915f660'} | |
ARCH=${4:-'i386'} | |
SIZE=${5:-10} | |
AZ=${6:-'us-east-1d'} | |
NAME=${7:-"ami-from-$INSTANCE_ID"} |
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 'net/ftp' | |
load 'aws.rb' | |
def execute_ffmpeg(command) | |
progress = nil | |
IO.popen(command) do |pipe| | |
pipe.each("r") do |line| | |
if line =~ /Duration: (d{2}):(d{2}):(d{2}).(d{1})/ | |
duration = (($1.to_i * 60 + $2.to_i) * 60 + $3.to_i) * 10 + $4.to_i |
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
# Genenerate random passwords for beta users, save the results in a csv | |
require 'rubygems' | |
require 'digest' | |
require "mysql" | |
require 'fastercsv' | |
def generate_hash(string) | |
Digest::SHA1.hexdigest(string) | |
end | |
# Generate random password | |
def generate_passwd(len) |
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/ruby -w | |
require 'rubygems' | |
require 'mongo' | |
require 'thread' | |
include Mongo | |
db = Connection.new('localhost',27017,:slave_ok => true).db('test') | |
coll = db['cappedCollection'] |
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
sudo mkdir /usr/local | |
sudo chown -R $USER /usr/local | |
curl -Lsf http://github.com/mxcl/homebrew/tarball/master | tar xvz -C /usr/local --strip 1 |
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
brew install git | |
brew update | |
brew install wget | |
brew install mysql | |
brew install memcached | |
brew install postgres | |
brew install redis | |
brew install mongodb |
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
mkdir -p ~/.rvm/src/ && cd ~/.rvm/src && rm -rf ./rvm/ && git clone --depth 1 git://github.com/wayneeseguin/rvm.git && cd rvm && ./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
if [[ -s /Users/YOUR_USERNAME/.rvm/scripts/rvm ]] ; then source /Users/YOUR_USERNAME/.rvm/scripts/rvm ; 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
rvm install 1.8.7 | |
rvm install 1.9.2 | |
rvm --default 1.9.2 | |
ruby -v | |
which ruby | |
gem install rails |
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
tcp_nopush on; | |
tcp_nodelay off; |
OlderNewer