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 zsh | |
# | |
# ZWS 1.2 (2006-03-22) | |
# | |
# Copyright © 2004-2006, Adam Chodorowski. All rights reserved. | |
# This file is part of the ZWS program, which is distributed under | |
# the terms of version 2 of the GNU General Public License. | |
# =========================================================================== | |
# Initialization. |
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
# | |
# Cookbook Name:: munin | |
# Recipe:: default | |
# | |
# Copyright 2008, OpsCode, Inc. | |
# | |
# Licensed under the Apache License, Version 2.0 (the "License"); | |
# you may not use this file except in compliance with the License. | |
# You may obtain a copy of the License at | |
# |
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
munin_nodes = Chef::Node.list.map do |name| | |
Chef::Node.load(name) | |
end.select do |node| | |
node.recipe_list.include?( "munin-node" ) | |
end | |
munin_node_list = {} | |
munin_nodes.each do |node| | |
munin_node_list[node.attribute[:fqdn]] = node.attribute[:ipaddress] |
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/ruby | |
require 'rubygems' | |
require 'thor' | |
require 'chef' | |
require 'chef/node' | |
require 'chef/rest' | |
Chef::Config.from_file("/etc/chef/server.rb") | |
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 'active_support' | |
require 'active_record' | |
# punch the duck | |
# Module initialisation and plug-in code inspired by will_paginate... | |
module MoneyHandler | |
module Validations | |
module ClassMethods |
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 'activerecord' | |
module Foo | |
def foo | |
puts "foo" | |
end | |
end | |
ActiveRecord::Validations::ClassMethods.send(:include, Foo) |
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 | |
# bin/console.rb | |
# a nice little ruby console for your Sinatra app | |
ENV["RACK_ENV"] ||= ( ARGV[0] || 'development' ) | |
this_file = File.expand_path( __FILE__ ) | |
app_file = File.expand_path( File.join( File.dirname( __FILE__), '../app' )) | |
cmd = "irb -r #{ this_file } -r irb/completion --simple-prompt" |
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 'eventmachine' | |
@config = { | |
:host => "127.0.0.1", | |
:port => 9666 | |
} | |
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
EventMachine::run do | |
# Policy Socket Server | |
EventMachine::start_server( Socky::HOST, | |
Socky::Policy::PORT, | |
Socky::Policy::Server ) | |
# XML Socket Server | |
EventMachine::start_server( Socky::HOST, | |
Socky::XmlSocket::PORT, |
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' | |
module Socky | |
module Policy | |
DEBUG = true | |
HOST = 'localhost' | |
PORT = 843 | |
EOF = "\r\000" | |
REQUEST = "<policy-file-request/>\000" |
OlderNewer