Skip to content

Instantly share code, notes, and snippets.

##################################################################
# /etc/elasticsearch/elasticsearch.yml
#
# Base configuration for a write heavy cluster
#
# Cluster / Node Basics
cluster.name: logng
# Node can have abritrary attributes we can use for routing
sudo iptables -F
sudo iptables -A INPUT -i lo -j ACCEPT
sudo iptables -A INPUT -i ! lo -d 127.0.0.0/8 -j REJECT
sudo iptables -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
sudo iptables -A OUTPUT -j ACCEPT
sudo iptables -A INPUT -p tcp --dport 80 -j ACCEPT
sudo iptables -A INPUT -p tcp --dport 10000 -j ACCEPT
sudo iptables -A INPUT -p tcp --dport 443 -j ACCEPT
sudo iptables -A INPUT -p tcp --dport 3333 -j ACCEPT
sudo iptables -A INPUT -p tcp --dport 3000 -j ACCEPT
# This plugin is used to automatically restart the Passenger Rails
# Useful if the Rails site is hooked into CC.rb and served by Passenger
# at the same time.
class Passenger
def initialize(project = nil)
@project = project
end
def build_finished(build)
@sr3d
sr3d / gist:134895
Created June 23, 2009 22:35
Dump a table to a CSV file
mysql -h HOST -u USERNAME --password=PASSWORD DATABASE -B -e "SELECT id,email,first_name,last_name,state,zip_code FROM users" | sed 's/\t/","/g;s/^/"/;s/$/"/;s/\n//g' > filename.csv
# getting the facebook permanent session key.
s = Facebooker::Session.new( "API_KEY", "SESCRET_KEY")
s.auth_token = "THE_6_DIGIT_CODE"
s.secure! :generate_session_secret => false
puts s.session_key
page_id = 102329749861
params = {
:v => '1.0',
:api_key => FACEBOOKER["api_key"],
:method => 'stream.get',
:format => 'XML',
:source_ids => page_id,
:session_key => 'bd7156a08fefbd368b54d2da-54500509',
:limit => 2
# http://code.google.com/codejam/contest/dashboard?c=32003#s=p1
#2
#WRWWLWWLWWLWLWRRWRWWWRWWRWLW WWRRWLWLWWLWWLWWRWWRWWLW
#WW WW
require 'ruby-debug'
class Cell
attr_accessor :x, :y, :walls
@sr3d
sr3d / chat_server.rb
Created September 10, 2009 22:11 — forked from tobi/chat_server.rb
require 'rubygems'
require 'eventmachine'
require 'evma_httpserver'
require 'cgi'
class Room < EM::Channel
end
$room = Room.new
$welcome_html = DATA.read
var gameTrigger = [
{
when: 2
,delayMin: 4 /* time between creep spawns */
,delayMax: 5
,multiplier: 1
,creeps: [
{ count: 5, type: Soot }
,{ count: 5, type: SootLevel2 }
,{ count: 4, type: Soot }

Coding Rails with Homebrew

Right now, this assumes you are using Snow Leopard.

Install Homebrew

Homebrew is MacPorts (or APT) without the suck. http://github.com/mxcl/homebrew