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
2014-02-21 04:34:34,784 INFO serf1: ['serf1', 'serf2', 'serf3'] joined | |
2014-02-21 04:34:34,883 INFO serf3: ['serf3', 'serf2', 'serf1'] joined | |
2014-02-21 04:34:34,787 INFO Added 1.1.1.1/24 to serf1 on eth1:1/24_tribe | |
2014-02-21 04:34:34,789 INFO Added 2.2.2.2/24 to serf1 on eth1:2/24_tribe | |
2014-02-21 04:34:34,790 INFO Added 3.3.3.3/24 to serf1 on eth1:3/24_tribe | |
2014-02-21 04:34:34,964 INFO serf2: ['serf2', 'serf1', 'serf3'] joined | |
root@serf1:~# service serf stop | |
serf stop/waiting |
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
# sample skeleton for a ruby API based on the ideas from http://www.oceanstore.org/publications/papers/pdf/iptps03-api.pdf | |
class DistributeKeyBasedRouter | |
def initialize(deliver_to_class, deliver_class_method = :delivered) | |
@delivery_callback_class = deliver_to_class | |
@delivery_callback_method = deliver_class_method | |
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
=== Epic Snow Leopard Upgrayyyyd Guide === | |
Son, you’re now living in the land of 64-bit systems. | |
That means that some of your 32-bit shit is now broken. | |
Not all is lost. | |
== Fixing MySQL weirdness |
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
db/*.sqlite3 | |
log/*.log | |
tmp/**/* | |
bin/* | |
vendor/gems/ruby/1.8/* | |
!vendor/gems/ruby/1.8/cache/ |
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/bash | |
# On OS X? Installed homebrew already? Interested in Riak? Get familiar! | |
# This command in your terminal should be a one-stop shop. | |
# curl http://gist.github.com/raw/308745/107168665a46decd540dd1c5d50ccdd82eb01051/ruby-riak | sh | |
brew install erlang wget | |
curl http://bitbucket.org/basho/riak/get/riak-0.8.tar.gz | tar zx | |
cd riak && make all rel | |
cd rel/riak && bin/riak start | |
wget http://bitbucket.org/basho/riak/raw/67c55dfd44f5/client_lib/jiak.rb |
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 'sinatra' | |
require 'yajl/json_gem' | |
post '/' do | |
@push = Yajl::Parser.new(:symbolize_keys => true).parse(params[:payload]) | |
appdir="/home/blackflag/app" | |
@output= Kernel.system("cd #{appdir}/shared/cached-copy && git pull origin master && cap deploy") | |
puts "\n output = #{@output} \n" | |
puts "I got some JSON: #{@push.inspect}" |
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 'warden' | |
require 'sinatra' | |
require 'cgi' | |
class LoginManager < Sinatra::Base | |
Warden::Manager.serialize_into_session{|id| id } | |
Warden::Manager.serialize_from_session{|id| id } | |
def call(env) |
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 'goliath' | |
require 'http_router' | |
# https://github.com/joshbuddy/http_router | |
HttpRouter::Rack.override_rack_builder! | |
class RackRoutes < Goliath::API | |
map('/get/:id') do |env| | |
[200, {'Content-type' => 'text/plain'}, ["My id is #{env['router.params'][:id]}\n"]] | |
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
# Copy it to fnordmetric directory and run with | |
# | |
# bundle exec ruby -Ilib -I. populate.rb live | |
# | |
# to generate fake current traffic or | |
# | |
# bundle exec ruby -Ilib -I. populate.rb past | |
# | |
# to generate fake stats for last month. | |
# |
OlderNewer