Skip to content

Instantly share code, notes, and snippets.

#!/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
/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 $*
#!/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
RailsAllowModRewrite on
PassengerUseGlobalQueue on
PassengerMaxPoolSize 30
sudo nginx -t -c /etc/nginx/nginx.conf
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
sudo haproxy -f /etc/haproxy/haproxy.conf -p /var/run/haproxy.pid -sf $(</var/run/haproxy.pid)
>> require 'rufus/mnemo'
>> s = Rufus::Mnemo::from_integer rand(8**5)
=> "bisoshi"
# 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
require 'rubygems'
require 'eventmachine'
require 'evma_httpserver'
require 'cgi'
class Room < EM::Channel
end
$room = Room.new
$welcome_html = DATA.read