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
// So this code is processing a channel of stuff with uniq id's. Pretend we have incomming stuffpackets | |
// from a network connection that are unsorted and need to be processed per id. The stuff processor will | |
// put these packets in their own channel to be processed with their own routine in thehandlymystuff | |
// function. It looks up the corresponding channel in a map. If the channel does not exists, it will be | |
// created and directly used for the first itteration and so on. | |
// StuffProcessor ... | |
type StuffProcessor struct { | |
StuffChan chan Stuff // ingest unsorted stuff packets from channel. | |
StuffDispatch map[string]chan Stuff // each stuff stream mapped id channel. |
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 bash | |
# Author: Rosco Nap / cloudrkt.com | |
# This script is used to check files with the .md extention (markdown) for spelling errors. | |
# It will run each .md file through aspell and returns an exit code other then 0 when it matches. | |
# Where are the markdown files located? | |
SEARCH_DIR="content/" | |
# Set some fancy colors to indicate errors and wrongly spelled words. |
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 | |
require 'net/http' | |
require 'uri' | |
require 'json' | |
output = {} | |
s_json = JSON.parse(Net::HTTP.get_response(URI.parse('http://localhost:8500/v1/catalog/services')).body) | |
services = s_json.keys.reject{|k| k == 'consul'} | |
services.each do |srv| |
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
# Description: | |
# This script receives pages in the formats | |
# /usr/bin/curl -d host="$HOSTALIAS$" -d output="$SERVICEOUTPUT$" -d description="$SERVICEDESC$" -d type=service -d notificationtype="$NOTIFICATIONTYPE$ -d state="$SERVICESTATE$" $CONTACTADDRESS1$ | |
# /usr/bin/curl -d host="$HOSTNAME$" -d output="$HOSTOUTPUT$" -d type=host -d notificationtype="$NOTIFICATIONTYPE$" -d state="$HOSTSTATE$" $CONTACTADDRESS1$ | |
# | |
# Based on a gist by oremj (https://gist.github.com/oremj/3702073) | |
# | |
# Configuration: | |
# HUBOT_NAGIOS_URL - https://<user>:<password>@nagios.example.com/cgi-bin/nagios3 | |
# |