Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/env ruby
require 'rubygems' if RUBY_VERSION < '1.9.0'
require 'sensu-handler'
require 'hipchat'
require 'timeout'
module Sensu::Extension
class Hipchat < Handler # Sub-class the appropriate extension type
@steveberryman
steveberryman / gist:170d23d1258543e7ab53
Created July 23, 2014 16:41
hipchat-extension.rb
#/usr/bin/env ruby
# Sends events to hipchat for wonderful chatty notifications
#
# This extension requires the hipchat gem
#
# The reason I wrote this instead of using the normal hipchat handler, is that with Flapjack
# all events are handled unless you do crazy filtering stuff. Also with a large number of events
# and checks the sensu server can get overloaded with forking stuff. So anyway, hipchat extension :)
#
@tomasol
tomasol / gist:1959192
Created March 2, 2012 15:32
Elastic Search on ec2
Elastic Search on ec2
ami: Ubuntu 11.10 Oneiric EBS boot Canonical ubuntu@ ami-a0ba68c9
apt-get install:
openjdk-7-jdk
xfsprogs
htop
create new ebs (20gb), mount as sdf
mkfs.xfs /dev/xvdf
@bernd
bernd / collectd-redis.conf
Created April 2, 2012 08:23
collectd redis metrics in ruby
LoadPlugin exec
<Plugin exec>
Exec "nobody:nogroup" "/path/to/collectd-redis.rb" "127.0.0.1" "6379"
</Plugin>
@willyg302
willyg302 / .lambda.yml
Last active May 15, 2016 09:43
Python hello world from Lambda
config:
FunctionName: lambda-python
Handler: index.handler
Runtime: nodejs
Description: Python hello world from Lambda
install: make
@chernjie
chernjie / logrotate.d-docker
Created April 17, 2015 17:31
Logrotate docker logs, copy this file to /etc/logrotate.d/docker
/var/lib/docker/containers/*/*-json.log {
dateext
daily
rotate 365
compress
delaycompress
missingok
}
@danielwegener
danielwegener / Jenkinsfile
Created January 23, 2017 13:18
Jenkinsfile docker template configuration for jenkins docker plugin
properties([
[$class : 'DockerJobProperty',
cleanImages : true,
dockerJobTemplate: [$class : 'DockerJobTemplateProperty',
cloudname: 'DockerHost-9',
// Supports other properties from https://git.io/vM5wf
template : [$class : 'DockerTemplate',
labelString : 'my-worker-label',
instanceCapStr : '4',
mode : 'EXCLUSIVE',
@dimitrovs
dimitrovs / dockerhost.sh
Last active September 17, 2017 20:36
Add the IP of a dockerhost to the /etc/hosts file of a Docker container if not already there.
#!/bin/bash
if [[ -z $(grep dockerhost /etc/hosts) ]]
then
echo `/sbin/ip route|awk '/default/ { print $3 }'` dockerhost >> /etc/hosts
fi
@atschwarz
atschwarz / SleepTimer.md
Last active December 3, 2017 01:27
OpenHAB2 - Generic sleep timer

OpenHAB2 - Generic sleep timer

The following describes the necessary Functions and Procedures to create a small "Sleep Timer Library" for OpenHAB (Don't know, if Library is the correct title, but you know what I mean ;-)). Using this approach, it's easy for you to create your own custom sleep timers.

NOTE: This stuff doesn't depend on any add-on.

Usage example

The usage example does not cover initialization or recovery on system start and demonstrates a VERY BASIC example. But it's not very hard for you to integrate and customize it to your needs ;-)

1. Create a rule, e.g. inside the file SleepTimer.rules and paste in the following code.