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 "fog" | |
def exec_commands_in_server(server, cmds) | |
results = server.ssh(cmds) do |stdout, stderr| | |
$stdout.puts stdout unless stdout.empty? | |
$stderr.puts stderr unless stderr.empty? | |
end | |
unless results.all? { |res| res.status == 0 } | |
puts "\nWhoops! something went wrong! :(" |
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
#!/usr/bin/env bash | |
sudo apt-get install build-essential libssl-dev libreadline6-dev | |
sudo gem install fpm | |
wget ftp://ftp.ruby-lang.org//pub/ruby/1.9/ruby-1.9.2-p180.tar.gz | |
tar -zxvf ruby-1.9.2-p180.tar.gz | |
cd ruby-1.9.2-p180 | |
time (./configure --prefix=/usr && make && make install DESTDIR=/tmp/installdir) | |
cd .. |
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
--- runner.rb.orig 2010-12-03 18:47:21.000000000 -0300 | |
+++ runner.rb 2010-12-03 18:48:16.000000000 -0300 | |
@@ -50,6 +50,9 @@ | |
# Determine the appropriate provider for the given resource, then | |
# execute it. | |
def run_action(resource, action) | |
+ # Resolve lazy/forward references in notifications | |
+ resource.resolve_notification_references | |
+ | |
resource.run_action(action) |
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
#!/usr/bin/env ruby | |
require 'rubygems' | |
require 'redis' | |
r = Redis.new(:timeout => 1) | |
append_fsync_val = r.config(:get, 'appendfsync').values.first | |
puts "Disabling appendfsync..." | |
r.config(:set, 'appendfsync', 'no') |
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
[Thread debugging using libthread_db enabled] | |
[New Thread 0x7f248ff936f0 (LWP 1744)] | |
keysCommand (c=0x69c3ec78) at redis.c:4612 | |
4612 if ((pattern[0] == '*' && pattern[1] == '\0') || | |
#0 keysCommand (c=0x69c3ec78) at redis.c:4612 | |
#1 0x000000000040f213 in call (c=0x30ee0948, cmd=0x1444528) at redis.c:2275 | |
#2 0x0000000000419102 in processCommand (c=0x69c3ec78) at redis.c:2459 | |
#3 0x00000000004183d8 in processInputBuffer (c=0x69c3ec78) at redis.c:2673 | |
#4 0x0000000000419bad in readQueryFromClient (el=<value optimized out>, |
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
deploy@redis1:~$ redis-stat latency delay 100 [20/161] | |
1: 0.52 ms | |
2: 0.13 ms | |
3: 0.48 ms | |
4: 0.34 ms | |
5: 0.14 ms | |
6: 0.19 ms | |
7: 0.47 ms | |
8: 0.48 ms | |
9: 0.18 ms |
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
--- src/http/modules/ngx_http_proxy_module.c.orig 2010-08-03 09:59:14.000000000 -0300 | |
+++ src/http/modules/ngx_http_proxy_module.c 2010-11-02 14:58:16.000000000 -0300 | |
@@ -73,6 +73,8 @@ | |
ngx_uint_t headers_hash_max_size; | |
ngx_uint_t headers_hash_bucket_size; | |
++ ngx_flag_t queue_wait_hdrs; | |
} ngx_http_proxy_loc_conf_t; | |
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
--- src/http/modules/ngx_http_proxy_module.c.orig 2010-09-21 02:07:05.000000000 -0300 | |
+++ src/http/modules/ngx_http_proxy_module.c 2010-09-21 02:09:05.000000000 -0300 | |
@@ -74,6 +74,8 @@ | |
ngx_uint_t headers_hash_max_size; | |
ngx_uint_t headers_hash_bucket_size; | |
+ | |
+ ngx_flag_t queue_wait_hdrs; | |
} ngx_http_proxy_loc_conf_t; | |
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
Algorithm | |
---------- | |
Let's say we have a cluster of nodes A < B < C where A is the leader, and B and C are | |
candidates. We want to add a new candidate D to the cluster, and we select node B as | |
the seed node. | |
When node D is started, the following happens: | |
(1) D sends a 'join' msg to B, and D starts monitoring B | |
(2) B replies with a 'hasLeader, A' message |
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
class Ohm::Model | |
@@associations = ::Hash.new { |hash, key| hash[key] = [] } | |
@@references = ::Hash.new { |hash, key| hash[key] = [] } | |
def self.associations | |
@@associations[self] | |
end | |
def associations | |
self.class.associations |
NewerOlder