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
import time | |
from kazoo.client import KazooClient | |
import logging | |
logging.basicConfig(level=logging.ERROR) | |
path = "/some/path" | |
zk = KazooClient() |
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
--- | |
name: micro_bosh | |
logging: | |
level: DEBUG | |
network: | |
ip: [Desired IP Address for Micro BOSH] | |
netmask: [Desired Netmask for Micro BOSH] | |
gateway: [Desired Gateway for Micro BOSH] |
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
#only dealing with opaque types here; no struct gen | |
require 'cast' | |
CallbackTypes = {} | |
def ffi_type(t) | |
if t.Pointer? | |
if t.type.Char? | |
:string | |
elsif t.type.CustomType? and CallbackTypes[t.type.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
elsif name == "winnt" | |
product_type = node[:kernel][:os_info][:product_type].to_i | |
version_major, version_minor, version_build = | |
node[:kernel][:os_info][:version].split(".").map { |v| v.to_i } | |
if version_major == 4 | |
distro = "nt" | |
elsif version_major == 5 | |
distro = case version_minor | |
when 0 then "2000" |
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 'win32ole' | |
require 'nokogiri' | |
wsman = WIN32OLE.new("WSMAN.Automation") | |
session = wsman.CreateSession | |
locator = wsman.CreateResourceLocator("winrm/config") | |
response = session.Get(locator) | |
xml = Nokogiri::XML.parse(response).remove_namespaces! | |
puts xml #to hash?? |
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
#using opscode/chef master branch at a9520267093907bb51bb0066f3d8eaf683d7b91d + a handful of unrelated patches | |
#and: gem1.9.1 install knife-windows/pkg/knife-windows-0.0.2.gem | |
/usr/lib/ruby/gems/1.9.1/gems/chef-0.10.0.dougm/lib/chef/knife.rb:90:in `require': no such file to load -- chef/knife/winrm.rb (LoadError) | |
from /usr/lib/ruby/gems/1.9.1/gems/chef-0.10.0.dougm/lib/chef/knife.rb:90:in `block in load_commands' | |
from /usr/lib/ruby/gems/1.9.1/gems/chef-0.10.0.dougm/lib/chef/knife.rb:90:in `each' | |
from /usr/lib/ruby/gems/1.9.1/gems/chef-0.10.0.dougm/lib/chef/knife.rb:90:in `load_commands' | |
from /usr/lib/ruby/gems/1.9.1/gems/chef-0.10.0.dougm/lib/chef/knife.rb:123:in `run' | |
from /usr/lib/ruby/gems/1.9.1/gems/chef-0.10.0.dougm/lib/chef/application/knife.rb:128:in `run' | |
from /usr/lib/ruby/gems/1.9.1/gems/chef-0.10.0.dougm/bin/knife:25:in `<top (required)>' | |
from /usr/bin/knife:19:in `load' |
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
#knife exec ... | |
seen = {} | |
search(:node, "roles:hudson_jobs").sort{|a,b| a.os<=>b.os}.each {|n| | |
os = n.sigar.platform.description | |
next if seen[os] | |
printf "%-20s %-12s %s\n", n.network[:default_gateway], n.network[:default_interface], os | |
seen[os] = true | |
} | |
__END__ | |
10.136.251.125 en0 AIX 6.1 |
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
/* print env from all processes */ | |
#include <stdio.h> | |
#include <sigar.h> | |
static int env_getall(void *data, | |
const char *key, int klen, | |
char *val, int vlen) | |
{ | |
printf("%s=%s\n", key, val); | |
return SIGAR_OK; |
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
% knife cookbook site share hudson Applications -c ~/.chef/opscode-platform.rb | |
INFO: Validating ruby files | |
INFO: Validating templates | |
INFO: Syntax OK | |
/Library/Ruby/Gems/1.8/gems/chef-0.9.8/lib/chef/knife/cookbook_site_share.rb:49:in `run': undefined method `create_build_dir' for Chef::CookbookUploader:Class (NoMethodError) | |
from /Library/Ruby/Gems/1.8/gems/chef-0.9.8/lib/chef/knife.rb:127:in `run' | |
from /Library/Ruby/Gems/1.8/gems/chef-0.9.8/lib/chef/application/knife.rb:118:in `run' | |
from /Library/Ruby/Gems/1.8/gems/chef-0.9.8/bin/knife:25 | |
from /usr/bin/knife:19:in `load' | |
from /usr/bin/knife:19 |
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
import hudson.model.* | |
import hudson.slaves.* | |
node = new DumbSlave("testing", "Testing node", "/home/hudson", "2", Node.Mode.NORMAL, "test label", new JNLPLauncher(), new RetentionStrategy.Always(), new ArrayList()) | |
hudson.model.Hudson.instance.addNode(node) |
NewerOlder