This file contains hidden or 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 'thread' | |
Thread.abort_on_exception = true | |
module Enumerable | |
def peach n=nil, &block | |
pmap n, &block | |
self | |
end |
This file contains hidden or 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 'chef/knife' | |
module Plugins | |
class NodeCookbooks < Chef::Knife | |
banner "knife node cookbooks NODE" | |
deps do | |
require 'chef/search/query' | |
require 'chef/knife/search' |
This file contains hidden or 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 'chef/handler' | |
require 'chef/log' | |
require 'json' | |
# Based on https://docs.chef.io/handlers.html#cookbook-versions | |
# and http://dev.nuclearrooster.com/2011/05/10/chef-notifying-and-logging-updated-resources | |
module Handlers |
This file contains hidden or 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 'chef/handler' | |
require 'chef/log' | |
require 'json' | |
# Based on http://dev.nuclearrooster.com/2011/05/10/chef-notifying-and-logging-updated-resources/ | |
module Handlers | |
class UpdatedResources < Chef::Handler |
This file contains hidden or 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 'chef/handler' | |
require 'chef/log' | |
require 'json' | |
# Based on https://docs.chef.io/handlers.html#cookbook-versions | |
module Handlers | |
class CookbookVersions < Chef::Handler |
This file contains hidden or 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
F, [2014-11-06T14:13:36.636050 #51663] FATAL -- default-ubuntu-1404: The `berkshelf' gem is missing and must be installed or cannot be properly activated. Run `gem install berkshelf` or add the following to your Gemfile if you are using Bundler: `gem 'berkshelf'`. | |
F, [2014-11-06T14:13:59.797336 #51860] FATAL -- default-ubuntu-1404: The `berkshelf' gem is missing and must be installed or cannot be properly activated. Run `gem install berkshelf` or add the following to your Gemfile if you are using Bundler: `gem 'berkshelf'`. | |
F, [2014-11-06T14:14:17.284094 #52049] FATAL -- default-ubuntu-1404: The `berkshelf' gem is missing and must be installed or cannot be properly activated. Run `gem install berkshelf` or add the following to your Gemfile if you are using Bundler: `gem 'berkshelf'`. | |
I, [2014-11-06T14:14:34.938104 #52250] INFO -- default-ubuntu-1404: -----> Cleaning up any prior instances of <default-ubuntu-1404> | |
I, [2014-11-06T14:14:34.938218 #52250] INFO -- default-ubuntu-1404: -----> Destroying <default- |
This file contains hidden or 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 Version | |
include Comparable | |
attr_reader :a, :b, :c, :str | |
def initialize str | |
parts = str.split('.') | |
raise unless parts.length == 3 | |
@a, @b, @c = parts.map(&:to_i) | |
@str = str | |
end |
This file contains hidden or 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 'zk' | |
require './zk_ext' | |
ZK.open '10.0.0.100:2181' do |zk| | |
zk.with_lock('test') do | |
zk.explore '/' | |
end | |
end |

This file contains hidden or 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 python | |
# -*- coding: UTF-8 -*- | |
from marshal import dump, load | |
from random import sample | |
from glob import glob | |
from pdb import * | |
import sys | |
def run_experiment(residues, interests, ss_code=None, mind=0.0, maxd=100.0): |