Skip to content

Instantly share code, notes, and snippets.

# I recently switched one of my Rails applications from Litespeed to Apache+Passenger
# with nginx on the frontend to handle static file requests. nginx proxies all non-static
# file requests to Apache+Passenger. I use page caching extensively, so that is why I
# need fast static file serving.
#
# I ran some quick tests comparing static file serving of Litespeed, Apache, and nginx.
# Here are the results:
#
# nginx 4400 requests/second
# Apache 2900 requests/second
#!/bin/bash -e
if test "$RS_REBOOT" = "true" ; then
echo "Skip HTTPD install on reboot."
logger -t RightScale "Skip nginx install on reboot."
service nginx start
exit 0 # Leave with a smile ...
fi
Author: ian <ian@rightscale.com>
Date: Tue Sep 15 17:12:05 2009 -0500
refs #4568 - a deployment can have ST that do not belong to the account. do not be so restrictive on the STE (server template executabl
diff --git a/app/controllers/deployments_controller.rb b/app/controllers/deployments_controller.rb
index 09cd380..7a9a565 100644
--- a/app/controllers/deployments_controller.rb
+++ b/app/controllers/deployments_controller.rb
@@ -435,7 +435,7 @@ class DeploymentsController < ApplicationController
#!/usr/bin/env ruby
def output_config
puts <<-END
graph_category App
graph_title passenger status
graph_vlabel count
sessions.label sessions
max.label max processes
804d8f2 HEAD@{0}: checkout: moving from master to input_refactor_4664
422df39 HEAD@{1}: pull : Fast forward
804d8f2 HEAD@{0}: checkout: moving from master to input_refactor_4664
804d8f2 HEAD@{0}: checkout: moving from master to input_refactor_4664
422df39 HEAD@{1}: pull : Fast forward
95b1e56 HEAD@{2}: checkout: moving from 57bc4b4b0e698f808df979ceaec922777196aa03 to master
804d8f2 HEAD@{0}: checkout: moving from master to input_refactor_4664
422df39 HEAD@{1}: pull : Fast forward
95b1e56 HEAD@{2}: checkout: moving from 57bc4b4b0e698f808df979ceaec922777196aa03 to master
57bc4b4 HEAD@{3}: checkout: moving from input_refactor_4664 to 57bc4b4b0e698f808df979ceaec922777196aa03
[client]
socket=/tmp/mysql.sock
[mysqld]
socket=/tmp/mysql.sock
datadir=/Users/ian/Apps/mysql5
@iwarshak
iwarshak / cassandra-1.xml
Created March 11, 2010 20:39
xml snippet for cassandra post
<ReplicationFactor>2</ReplicationFactor>
<ListenAddress>127.0.0.1</ListenAddress>
<CommitLogDirectory>/path/to/cassandra/bin/var.1/lib/cassandra/commitlog</CommitLogDirectory>
<DataFileDirectories>
<DataFileDirectory>/path/to/cassandra/bin/var.1/lib/cassandra/data</DataFileDirectory>
</DataFileDirectories>
<CalloutLocation>/path/to/cassandra/bin/var.1/lib/cassandra/callouts</CalloutLocation>
<StagingFileDirectory>/path/to/cassandra/bin/var.1/lib/cassandra/staging</StagingFileDirectory>
<ThriftAddress>127.0.0.1</ThriftAddress>
@iwarshak
iwarshak / cassandra-2.xml
Created March 11, 2010 20:40
xml snippet for cassandra post
<ReplicationFactor>2</ReplicationFactor>
<ListenAddress>127.0.0.1</ListenAddress>
<CommitLogDirectory>/path/to/cassandra/bin/var.1/lib/cassandra/commitlog</CommitLogDirectory>
<DataFileDirectories>
<DataFileDirectory>/path/to/cassandra/bin/var.1/lib/cassandra/data</DataFileDirectory>
</DataFileDirectories>
<CalloutLocation>/path/to/cassandra/bin/var.1/lib/cassandra/callouts</CalloutLocation>
<StagingFileDirectory>/path/to/cassandra/bin/var.1/lib/cassandra/staging</StagingFileDirectory>
<ThriftAddress>127.0.0.1</ThriftAddress>
class Base
end
class A < Base
end
class Base
class << self
attr_accessor :bar
end
@iwarshak
iwarshak / mongo_map_reduce_facets.rb
Created March 22, 2010 18:54
gists for mongo sharding post
require 'rubygems'
require 'mongo_mapper'
MongoMapper.connection = Mongo::Connection.new('localhost')
MongoMapper.database = 'books'
class Book
include MongoMapper::Document
CONTEXTS = ['authors', 'rating','keywords', 'genre']
CONTEXTS.each do |context|