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 'deprec' | |
# deploy.rb for installing tracks | |
# | |
# http://github.com/bsag/tracks/tree/master | |
# | |
# This file demonstrates how simple deprec-2.0.0 can make installing a Rails app. | |
# | |
# If you want to use Passenger, Ruby Enterprise Edition and Apache, simple update | |
# the value for :domain below and you're ready to deploy. |
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
# install_chef_server.sh | |
# | |
# From list post by John Merrells <john@merrells.com> | |
# Modified by Mike Bailey <mike@bailey.net.au> | |
logfile="/root/log.txt" | |
echo "-----" >> $logfile | |
# New sources.list | |
cat > /etc/apt/sources.list << EOF |
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
# config/initializers/fingerprint.rb # XXX Breaks Rails asset bundling | |
# | |
# Mike Bailey <mike@bailey.net.au> | |
# | |
# Updates Rails Helpers to use fingerprint in path instead of timestamp in query string. | |
# | |
# Add the following to your Apache config to remove the fingerprints: | |
# | |
# # Remove fingerprints | |
# RewriteEngine On |
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
Domain.blueprint do | |
name { "domain#{sn}" } | |
primary_ns { "4.2.2.1" } | |
contact { "contact name" } | |
serial { "#{sn}" } | |
refresh { 120 } | |
retry { 120 } | |
expire { 120 } | |
minimum { 120 } | |
end |
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/env ruby | |
filename = ARGV[0] | |
end_marker = 0 | |
offset_increment = 1000 | |
lines = [] | |
fh = File.open filename | |
while lines.size < 10 |
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
class PostController < ApplicationController | |
respond_to :json, :html, :jpg, :xml | |
def index | |
respond_with(@posts = Post.all), | |
:methods => [:average_rating], | |
:include => :comments | |
end | |
def show |
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
## Encode | |
json = ActiveSupport::JSON.encode(object) # extra methods like :include | |
json = Offering.first.to_json(:include => :outlet, :methods => [:days_waiting]) | |
## Decode | |
ActiveSupport::JSON.decode(json) |
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
Section for VMware vCenter Converter Standalone, pid=2596, version=4.3.0, build=build-292238, option=Release | |
[2011-02-24 14:41:11.109 03884 warning 'App'] Failed to create console writer | |
[2011-02-24 14:41:11.249 02808 info 'App'] Current working directory: C:\Program Files\VMware\VMware vCenter Converter Standalone | |
[2011-02-24 14:41:11.249 02808 info 'App'] Trying converter_server | |
[2011-02-24 14:41:12.374 02808 info 'App'] [shutdownMgr,25] Ufa shutdown manager registered. | |
[2011-02-24 14:41:12.374 02808 info 'App'] [helper,453] Initializing SSL Contexts | |
[2011-02-24 14:41:12.406 02808 info 'Libs'] Using system libcrypto, version 9080CF | |
[2011-02-24 14:41:13.671 02808 info 'App'] Vmacore::InitSSL: doVersionCheck = true, handshakeTimeoutUs = 120000000 | |
[2011-02-24 14:41:13.671 02808 info 'App'] [helper,499] Initializing certificates | |
[2011-02-24 14:41:13.671 02808 info 'App'] [task,2061] [LRO] 32 max LROs |
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/env ruby | |
require 'rubygems' | |
require 'highline/import' | |
require 'mechanize' | |
require 'uri' | |
# Get details | |
domain = ask("your blinksale domain prefix") + '.blinksale.com' | |
login_page_url = "https://#{domain}/sessions/new" |
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
desc "Install Rack stack on Ubuntu server (8.04, 10.04)" | |
task :install_stack do | |
top.deprec.git.install | |
top.deprec.ruby.install # Uses ruby_vm_type | |
top.deprec.web.install # Uses web_server_type | |
top.deprec.app.install # Uses app_server_type | |
top.deprec.rails.install | |
top.deprec.logrotate.install | |
# top.deprec.monit.install # Not using monit lately | |
end |
OlderNewer