Skip to content

Instantly share code, notes, and snippets.

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
@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"
@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),
#
# Cookbook Name:: haproxy
# Recipe:: default
# Author:: Joe Williams <joe@joetify.com>
package "haproxy" do
action :install
end
haproxy_templates = [ "global", "defaults", "frontend", "SOMEBACKEND" ]
@rottenbytes
rottenbytes / ideal ops.md
Created May 28, 2012 13:53 — forked from bhenerey/ideal ops.md
ideal ops checklist

In a perfect world, where things are done well, not just quickly, I would expect to find the following when joining the company:

Documentation

  • Accurate / up-to-date systems architecture diagram

  • Accurate / up-to-date network diagram

  • Out-of-hours support plan

  • Incident management plan

@rottenbytes
rottenbytes / nagios.coffee
Created October 2, 2012 12:05 — forked from oremj/nagios.coffee
Nagios script for hubot
# Description:
# This script receives pages in the formats
# /usr/bin/curl -d host="$HOSTALIAS$" -d output="$SERVICEOUTPUT$" -d description="$SERVICEDESC$" -d type=service -d state="$SERVICESTATE$" $CONTACTADDRESS1$
# /usr/bin/curl -d host="$HOSTNAME$" -d output="$HOSTOUTPUT$" -d type=host -d state="$HOSTSTATE$" $CONTACTADDRESS1$
#
# Author:
# oremj
irc = require('irc')
-- Calculate From : http://munin-monitoring.org/browser/munin/plugins/node.d/postgres_streaming_.in
-- with help : http://www.postgresql.org/docs/9.3/static/monitoring-stats.html#PG-STAT-REPLICATION-VIEW
-- http://eulerto.blogspot.fr/2011/11/understanding-wal-nomenclature.html
create or replace function CalculateNumericalOffset(text)
returns bigint
language sql
as $$
select ('x'||lpad( 'ff000000', 16, '0'))::bit(64)::bigint
* ('x'||lpad( split_part( $1 ,'/',1), 16, '0'))::bit(64)::bigint
-- Calculate From : http://munin-monitoring.org/browser/munin/plugins/node.d/postgres_streaming_.in
-- with help : http://www.postgresql.org/docs/9.3/static/monitoring-stats.html#PG-STAT-REPLICATION-VIEW
-- http://eulerto.blogspot.fr/2011/11/understanding-wal-nomenclature.html
create or replace function CalculateNumericalOffset(text)
returns bigint
language sql
as $$
select ('x'||lpad( 'ff000000', 16, '0'))::bit(64)::bigint
* ('x'||lpad( split_part( $1 ,'/',1), 16, '0'))::bit(64)::bigint
.DS_Store
*.log
Gemfile.lock
java -cp clojure.jar clojure.main -e "(use 'clojure.xml) (->> (java.io.File. \"pom.xml\") (clojure.xml/parse) (:content) (filter #(= (:tag %) :version)) (first) (:content) (first) (println))"