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/local/bin/bash | |
NAGIOS_BASEURL="https://mynagios.server.tld" | |
NAGIOS_CGIURL="${NAGIOS_BASEURL}/nagios/cgi-bin/" | |
function hostgroup_links { | |
URL="${NAGIOS_CGIURL}status.cgi?hostgroup=" | |
[ -n "$*" ] && echo $* | tr ',' "\n" | sed -e 's,^, ,' -e "s,^ \([^ ]*\)$, \1 (${URL}\1)," || echo ' NONE'; | |
} |
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
define hostgroup{ | |
hostgroup_name servers | |
alias Class - Servers | |
} |
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 sh | |
### Mirror all of the opscode-cookbooks repositories | |
trap "exit 1" INT TERM # exit gracefully if we're in the main loop | |
repos=$(curl -s -o- https://api.github.com/users/opscode-cookbooks/repos\?per_page\=1000 \ | |
| ruby -rubygems -e 'require "json"; JSON.load(STDIN.read).each{|r| puts r["git_url"]}') | |
for repo in $repos ; do |
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 'chef' | |
require 'json' | |
# Load constants from rake config file. | |
require File.join(File.dirname(__FILE__), 'config', 'rake') | |
# Detect the version control system and assign to $vcs. Used by the update | |
# task in chef_repo.rake (below). The install task calls update, so this | |
# is run whenever the repo is installed. |
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
# arg1 = "String to expand as the run command, $key will be interpretted as the item name" | |
# arg2..n = items to iterate across | |
function tmux_windows() { | |
session="tmux-cmd-$$" | |
tmux new-session -d -s $session | |
cmd=$1 ; shift | |
index=1 | |
while [ ! -z $1 ] ; do | |
index=$((++index)) | |
export var=$1 ; shift |
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
#!/bin/bash | |
# This is the current stable release to default to, with Omnibus patch level (e.g. 10.12.0-1) | |
# Note that the chef template downloads 'x.y.z' not 'x.y.z-r' which should be a duplicate of the latest -r | |
use_shell=0 | |
prerelease="false" | |
# Check whether a command exists - returns 0 if it does, 1 if it does not | |
exists() { |
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
#autoload | |
vsnap() { | |
trap "exit 1" INT | |
if [[ $#@ -ne 2 ]] ; then | |
echo 'usage: vsnap VM_NAME SNAPSHOT_DIR' | |
return 1 | |
fi | |
lastsnap="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
search(:node).map { |n| {fqdn: n['fqdn'], ip: n['ipaddress']} }.each do |i| | |
Chef::Log.info "Creating: host #{i[:fqdn]}" | |
djbdns_rr "host #{i[:fqdn]}" do | |
fqdn i[:fqdn] | |
cwd "#{node[:djbdns][:tinydns_dir]}/root" | |
ip i[:ip] | |
type "host" | |
action :add |
I hereby claim:
- I am jssjr on github.
- I am jssjr (https://keybase.io/jssjr) on keybase.
- I have a public key whose fingerprint is 2081 E230 3001 6508 8847 1BBF A0A8 DB0F D1EA B94D
To claim this, I am signing this object:
OlderNewer