Skip to content

Instantly share code, notes, and snippets.

View rosconap's full-sized avatar

RN rosconap

  • Thuisbioscoop BV
  • Amsterdam, Netherlands
View GitHub Profile
@nilsmagnus
nilsmagnus / sign_and_verify_test.go
Last active October 10, 2022 16:38
Sign a message and verify signature with go using PKCS1. Compatible with java (SHA256withRSA)
package main
import (
"crypto"
"crypto/rand"
"crypto/rsa"
"crypto/sha256"
"encoding/base64"
"testing"
)
@ijin
ijin / consul_dynamic_inventory.rb
Created June 22, 2014 15:22
dynamic inventory script for ansible using consul
#!/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|
@benwtr
benwtr / nagios.coffee
Last active January 13, 2016 08:29 — forked from oremj/nagios.coffee
# 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
#
@emsearcy
emsearcy / check_conntrack
Created June 7, 2012 00:46
Nagios conntrack table monitor
#!/usr/bin/env perl
#
# Script to check netfilter conntrack usage
# https://gist.github.com/gists/2885777
# emsearcy@osuosl.org
#
# Usage: check_conntrack -w WARN_USED% -c CRIT_USED%
#
# Returns:
# UNKNOWN if no conntrack support found