Skip to content

Instantly share code, notes, and snippets.

@rottenbytes
rottenbytes / nodes.erl
Created September 23, 2011 13:15 — forked from videlalvaro/nodes.erl
Find Erlang nodes in the cluster
#!/usr/bin/env escript
%% -*- erlang -*-
%%! -sname nodefinder
%% Usage:
%% chmod +x nodes.erl
%% ./nodes.erl 'somenode@host'
main([N]) ->
Node = list_to_atom(N),
@rottenbytes
rottenbytes / gist:1106603
Created July 26, 2011 12:05 — forked from tfheen/gist:780086
fixed the case where node has checked in less than 60 seconds ago
#! /usr/bin/env ruby
# Original by Tollef Fog Heen <tfheen _at_ err.no>
require 'chef/config'
require 'chef/search/query'
require 'chef/log'
require 'time'
require 'getoptlong'
require "ohai"
module MCollective
module Agent
class agentreload<RPC::Agent
action 'reload' do
validate :name, String
reply.fail! "#{request[:name]} not found." unless Agents.agentlist.include?(request[:name])
# we should iterate on @config.libdir here...
load(@config.libdir[0]+"/mcollective/agent/"+request[:name]+".rb")
end