This file contains hidden or 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 | |
| # | |
| # Find bloating passengers and kill them gracefully. Run from cron every minute. | |
| # | |
| MEM_LIMIT = ARGV[0].to_i || 500 | |
| module Process | |
| def self.running?(pid) | |
| begin |
This file contains hidden or 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/ree-gem | |
| #!/bin/sh | |
| /opt/ruby-enterprise-1.8.6-20081205/bin/gem $* | |
| /usr/bin/ree-ruby | |
| #!/bin/sh | |
| /opt/ruby-enterprise-1.8.6-20081205/bin/ruby $* |
This file contains hidden or 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 | |
| # | |
| # Find bloating passengers and kill them gracefully. Run from cron every minute. | |
| # | |
| MEM_LIMIT = ARGV[0].to_i || 500 | |
| module Process | |
| def self.running?(pid) | |
| begin |
This file contains hidden or 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
| RailsAllowModRewrite on | |
| PassengerUseGlobalQueue on | |
| PassengerMaxPoolSize 30 |
This file contains hidden or 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 nginx -t -c /etc/nginx/nginx.conf |
This file contains hidden or 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
| cd /usr/src/ | |
| sudo wget http://haproxy.1wt.eu/download/1.3/src/haproxy-1.3.15.2.tar.gz | |
| sudo tar zxvf haproxy-1.3.15.2.tar.gz | |
| sudo aptitude install libpcre++-dev | |
| sudo make TARGET=linux26 CPU=i386 USE_STATIC_PCRE=1 | |
| sudo make install | |
| sudo haproxy -f /etc/haproxy/haproxy.conf | |
| https:// ..url.. /haproxy?stats |
This file contains hidden or 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 haproxy -f /etc/haproxy/haproxy.conf -p /var/run/haproxy.pid -sf $(</var/run/haproxy.pid) |
This file contains hidden or 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 'rufus/mnemo' | |
| >> s = Rufus::Mnemo::from_integer rand(8**5) | |
| => "bisoshi" |
This file contains hidden or 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
| # This method is heavily adapted from the Rails method of determining the subdomain. | |
| require 'rubygems' | |
| require 'sinatra' | |
| require 'rack/request' | |
| # We re-open the request class to add the subdomains method | |
| module Rack | |
| class Request | |
| def subdomains(tld_len=1) # we set tld_len to 1, use 2 for co.uk or similar |
This file contains hidden or 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 'rubygems' | |
| require 'eventmachine' | |
| require 'evma_httpserver' | |
| require 'cgi' | |
| class Room < EM::Channel | |
| end | |
| $room = Room.new | |
| $welcome_html = DATA.read |
OlderNewer