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
{:period=>150000, | |
:type=>{:description=>"DISK", :code=>51}, | |
:details=>{:path=>"/", :fs_critical=>95, :fs_warn=>90}, | |
:threshold=>0, | |
:send_interval=>0, | |
:monitor_id=>"q86950d1e9", | |
:timeout=>100000} |
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 | |
# | |
# Reload Splunk Apps | |
# | |
# Author:: Greg Albrecht <gba@splunk.com> | |
require 'net/http' | |
require 'net/https' | |
@http = Net::HTTP.new('splunk.example.com', 8089) |
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
{ | |
"node": { | |
"status": "running", | |
"provider_id": "pa931001", | |
"tags": ["agent"], | |
"color": "#fffffff", | |
"ipaddress": "1.2.3.4", | |
"id": "n1ad8bdcc9", | |
"name": "test", | |
"private_ips": [], |
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
apt_repository 'nodejs' do | |
action :add | |
uri 'http://ppa.launchpad.net/chris-lea/node.js/ubuntu' | |
distribution node['lsb']['codename'] | |
components ['main'] | |
key 'C7917B12' | |
keyserver 'keyserver.ubuntu.com' | |
end | |
['nodejs', 'nodejs-dev', 'npm', 'build-essential'].each do |pkg| |
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
# $SPLUNK_HOME/etc/system/local/inputs.conf | |
[batch:///var/mail] | |
disabled = false | |
move_policy = sinkhole | |
sourcetype = mbox |
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 | |
# I've encountered this pattern in every language I've used: | |
# | |
# 1. Given a list of items. | |
# 2. I want to convert this list to a string. | |
# 3. Where the items are separated by a comma. | |
# 4. The last item should not end with a comma. | |
# | |
# This is what I'm using, but I feel there's a better way: |
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
package 'apache' | |
file '/etc/apache.conf' | |
service 'httpd' | |
1.to_f | |
=> 1.0 |
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 | |
# Extract pwned twitter accounts. | |
require 'open-uri' | |
pbs = ['Kc9ng18h', 'vCMndK2L', 'JdQkuYwG', 'fw43srjY', 'jv4LBjPX'] | |
pbs.each{ |pb| puts open("http://pastebin.com/raw.php?i=#{pb}").read } |
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
# -*- coding: utf-8 -*- | |
# Author: Douglas Creager <dcreager@dcreager.net> | |
# This file is placed into the public domain. | |
# Calculates the current version number. If possible, this is the | |
# output of “git describe”, modified to conform to the versioning | |
# scheme that setuptools uses. If “git describe” returns an error | |
# (most likely because we're in an unpacked copy of a release tarball, | |
# rather than in a git working copy), then we fall back on reading the | |
# contents of the RELEASE-VERSION file. |