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 RedisException < Exception | |
attr_accessor :original_exception | |
end | |
class Redis | |
class Client | |
def call(*args) | |
begin | |
process(args) do | |
read | |
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
require 'rubygems' | |
require 'mongo' | |
module MongoPubSub | |
QUEUES_COLLECTION = 'queues' | |
class EndSubscriptionException < Exception; end | |
class Publisher | |
def initialize(queue_name, mongo_connection) | |
# Initialize queue collection as a capped collection | |
if not mongo_connection[QUEUES_COLLECTION].collection_names.include?(queue_name) |
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 configuration file for the Samba suite for Debian GNU/Linux. | |
# | |
# | |
# This is the main Samba configuration file. You should read the | |
# smb.conf(5) manual page in order to understand the options listed | |
# here. Samba has a huge number of configurable options most of which | |
# are not shown in this example | |
# | |
# Some options that are often worth tuning have been included as |
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 | |
Thread.new do | |
sleep(15) | |
puts "dumping stacks" | |
puts caller_for_all_threads.inspect | |
puts "done." | |
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
require 'rubygems' | |
require 'eventmachine' | |
require 'evma_httpserver' | |
require 'event_utils' | |
require 'singleton' | |
require 'syslog' | |
require 'trollop' | |
require 'yaml' | |
class Syslogger |
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
module Net | |
class HTTP < Protocol | |
def connect | |
D "opening connection to #{conn_address()}..." | |
s = timeout(@open_timeout) { TCPSocket.open(conn_address(), conn_port()) } | |
D "opened" | |
if use_ssl? | |
unless @ssl_context.verify_mode | |
warn "warning: peer certificate won't be verified in this SSL session" |
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 | |
diff -x .gitignore -x .DS_Store -x metadata.json -x "README" -qr cookbooks/ /srv/chef/cookbooks/ | grep -v "Only in | |
/srv/chef/cookbooks/" | sed -e "s/.*cookbooks\/[ :]*//;s/\/.*//;s/:.*//" | sort | uniq | xargs knife cookbook upload | |
for a in `diff -x .gitignore -x metadata.json -x "README" -qr cookbooks/ /srv/chef/cookbooks/ | grep "Only in /srv/ | |
chef/cookbooks/" | sed -e "s/.*cookbooks\/[ :]*//;s/\/.*//;s/:.*//" | sort | uniq`; do | |
echo "y" | knife cookbook delete $a | |
done |
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 'superunpack' | |
class Category < Complex | |
Blong :index | |
Blong :identifier | |
Blong :dirty | |
CString :long_name | |
CString :short_name |
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
# This recipe should be called at the beginning of the run_list | |
# If we are not the last item of the run_list break | |
order = node.recipes | |
if order[0] != "firstrecipe" | |
Chef::Log.error("First Recipe should be the first recipe to run; current run list is "+order.inspect) | |
raise "Please refactor my runlist" | |
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
order = node.recipes | |
if order[-1] != "lastrecipe" | |
Chef::Log.error("Last Recipe should be the last recipe to run") | |
raise "Please refactor my runlist" | |
end | |
# This recipe is tightly integrated with monitored in fotonauts and recipe | |
# firstrecipe |