Skip to content

Instantly share code, notes, and snippets.

Avatar

Hans Hasselberg i0rek

View GitHub Profile
View gist:cda247e94d30bfe91cee
The initial observed cluster behavior:
1) Constant churn of nodes between Failed and Alive
2) Message bus saturated (~150 updates/sec)
3) Subset of cluster affected
4) Some nodes that are flapping don't exist! (Node dead, or agent down)
One immediate question is how the cluster remained in an unstable
state. We expect that the cluster should converge and return to
a quiet state after some time. However, there was a bug in the
low level SWIM implementation (memberlist library).
View advanced_auth.rb
e = Typhoeus::Easy.new
e.auth = {
:username => 'username',
:password => 'password',
:method => Typhoeus::Easy::AUTH_TYPES[:CURLAUTH_NTLM]
}
e.url = "http://example.com/auth_ntlm"
e.method = :get
e.perform
View caching.rb
hydra = Typhoeus::Hydra.new
hydra.cache_setter do |request|
@cache.set(request.cache_key, request.response, request.cache_timeout)
end
hydra.cache_getter do |request|
@cache.get(request.cache_key) rescue nil
end
@i0rek
i0rek / hack.sh
Created Mar 31, 2012 — forked from erikh/hack.sh
OSX For Hackers
View hack.sh
#!/usr/bin/env sh
##
# This is script with usefull tips taken from:
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
#
# install it:
# curl -sL https://raw.github.com/gist/2108403/hack.sh | sh
#