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
#!/bin/sh | |
### BEGIN INIT INFO | |
# Provides: haproxy | |
# Required-Start: $local_fs $network | |
# Required-Stop: $local_fs | |
# Default-Start: 2 3 4 5 | |
# Default-Stop: 0 1 6 | |
# Short-Description: fast and reliable load balancing reverse proxy | |
# Description: This file should be used to start and stop haproxy. | |
### END INIT INFO |
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
[david@calavera:voldemort-0.81]$ jdev -S jirb | |
no such file to load -- wirble | |
jruby-1.5.1 > require 'lib/voldemort_client' | |
=> true |
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
# Migrating my old .gitconfig blog post from 2007 to here so I can update it easier. | |
# Original URL: | |
# http://geek.susanpotter.net/2007/11/my-gitconfig.html | |
[user] | |
name = Susan Potter # make sure you change this | |
email = me@susanpotter.net # make sure you change this | |
[color] | |
diff = auto | |
status = auto | |
branch = auto |
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
bash -c ' | |
echo <%= @config[:chef_node_name] %> > /tmp/chef_node_name | |
cat /tmp/chef_node_name | cut -d. -f1 > /tmp/proper_hostname | |
cat /tmp/chef_node_name | cut -d. -f2 | tr -d "\n" > /tmp/proper_dnsdomainname | |
echo -n "." >> /tmp/proper_dnsdomainname | |
cat /tmp/chef_node_name | cut -d. -f3 >> /tmp/proper_dnsdomainname | |
IPV4ADDR=`ip addr | grep eth0 | grep "inet " | cut -d " " -f 6 | cut -d \/ -f 1` |
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 'rubygems' | |
require 'rack' | |
class Object | |
def webapp | |
class << self | |
define_method :call do |env| | |
func, *attrs = env['PATH_INFO'].split('/').reject(&:empty?) | |
[200, {}, send(func, *attrs)] | |
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
files = directory.files.all | |
truncated = files.is_truncated | |
while truncated | |
set = directory.files.all( :marker => files.last.key ) | |
truncated = set.is_truncated | |
files = files + set | |
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
include $(GOROOT)/src/Make.inc | |
GOFMT=gofmt -spaces=true -tabindent=false -tabwidth=4 | |
all: | |
$(GC) jsontest.go | |
$(LD) -o jsontest.out jsontest.$O | |
format: | |
$(GOFMT) -w jsontest.go |
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
#ruby19 added ObjectSpace.count_objects method which returns a hash of types+counts of objects in current process #standup | |
#ruby19 allows default parameters in procs & lambdas! ex: f = -> a,b=1,*c { p [a,b,c] }; f.call(1); f.(1,2); f[1,2,3] #standup | |
#ruby19 no longer supports .each on a string! instead, use: .chars, .bytes, .lines #standup | |
#ruby19 supports 3 ways to call a proc! ex: f =->n {[:hello, n]}; f[:ruby]; f.call(:ruby); f.(:ruby) #standup | |
#ruby19 hashes preserve the insertion order of elements! for the curious: http://bit.ly/e0oEun #standup |
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 'zmq' | |
require 'json' | |
handler_ctx = ZMQ::Context.new(1) | |
# receive and response for mongrel2 handlers | |
# queue address corresponds to what's in the configuration | |
recv_queue = handler_ctx.socket(ZMQ::PULL) | |
recv_queue.connect("tcp://127.0.0.1:9999") |
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
bash -c ' | |
rpm -Uvh http://download.fedora.redhat.com/pub/epel/5/x86_64/epel-release-5-4.noarch.rpm | |
yum install -q -y sudo gcc gcc-c++ automake autoconf make readline-devel.x86_64 libffi-devel.x86_64 libyaml-devel.x86_64 zlib-devel.x86_64 openssl-devel.x86_64 wget | |
# This may not be necessary for you | |
yum remove -q -y ruby-libs ec2-ami-tools | |
wget http://someurl.domain.com/ruby-1.9.2p180_x86_64.rpm -O /tmp/ruby-1.9.2p180_x86_64.rpm | |
yum localinstall --nogpgcheck -q -y /tmp/ruby-1.9.2p180_x86_64.rpm |
OlderNewer