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 OnDestroyMiddleware | |
| def initialize(app, env) | |
| @app = app | |
| end | |
| def call(env) | |
| env["config"].vm.provisioners.each do |provisioner| | |
| env.ui.info "Attempting to remove client #{provisioner.config.node_name}" | |
| `knife client show #{provisioner.config.node_name}` | |
| if $?.to_i == 0 | 
  
    
      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
    
  
  
    
  | #!/opt/csw/bin/ruby | |
| # | |
| # run with something like iostat -nx 10 | iostat_to_graphite.rb | |
| # | |
| require 'socket' | |
| graphite_host='graphite' | |
| graphite_port=2003 | 
  
    
      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
    
  
  
    
  | import copy | |
| # Имплементация прототип ориентированного internal DSL для Python по мотивам Io Language http://habrahabr.ru/blogs/crazydev/28041/ | |
| # Implementation of prototype oriented internal DSL for python based on article about Io Language http://habrahabr.ru/blogs/crazydev/28041/ | |
| class IoObject(dict): | |
| def __init__(self): | |
| self.clone = copy.copy | |
| def __getattr__(self, attr): | |
| if 'get_slot' in self: | |
| val = self["get_slot"](attr)#может вызвать бесконечность / infinite loop can occur | 
  
    
      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
    
  
  
    
  | # ADD this to Rakefile and run it by issuing rake roles.to_json | |
| ROLE_DIR = File.expand_path(File.join(TOPDIR, "roles")) | |
| namespace :roles do | |
| desc "Convert ruby roles from ruby to json, creating/overwriting json files." | |
| task :to_json do | |
| Dir.glob(File.join(ROLE_DIR, '*.rb')) do |rb_file| | |
| role = Chef::Role.new | |
| role.from_file(rb_file) | |
| json_file = rb_file.sub(/\.rb$/,'.json') | 
  
    
      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
    
  
  
    
  | import tornado.httpserver, tornado.ioloop, tornado.options, tornado.web, os.path | |
| from tornado.options import define, options | |
| define("port", default=8888, help="run on the given port", type=int) | |
| class Application(tornado.web.Application): | |
| def __init__(self): | |
| handlers = [ | |
| (r"/", HomeHandler), | |
| (r"/upload", UploadHandler) | 
NewerOlder