Skip to content

Instantly share code, notes, and snippets.

View relistan's full-sized avatar

Karl Matthias relistan

View GitHub Profile
@relistan
relistan / logback_test.java
Created April 29, 2016 12:39
logback_test.java
package hello;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public class MyApp1 {
final static Logger logger = LoggerFactory.getLogger(MyApp1.class);
private static void setDefaultUncaughtExceptionHandler() {
try {
@relistan
relistan / kafkamon.scala
Created March 14, 2016 22:50
Kafka Offset Monitor
/**
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
@relistan
relistan / nitro_logback.lua
Created January 30, 2016 00:01
Logback standard output parser for Heka
-- A Heka Decoder for a semi-standard logback entry
local os = require("os")
local lpeg = require("lpeg")
local dash = lpeg.P("-")
local colon = lpeg.P(":")
local space = lpeg.S(" \t")
local eol = lpeg.P(-1)
@relistan
relistan / out.txt
Created June 23, 2014 22:25
Validating Centurion
kmatthias-mbp:dockercon kmatthias$ bundle exec centurion -p test -e production -a deploy
** Invoke environment:production (first_time)
** Invoke environment:common (first_time)
** Execute environment:common
** Execute environment:production
** Invoke deploy (first_time)
** Execute deploy
** Invoke deploy:get_image (first_time)
** Execute deploy:get_image
** Invoke deploy:pull_image (first_time)
@relistan
relistan / Services Layout.md
Last active August 29, 2015 14:02
Centurion with etcd Proof-of-Concept

Services Layout

The following code run from inside a Ruby script that has loaded the etcd gem would create the necessary keys to deploy using the above code.

client.set('/services/fooservice/ports/3021', value: 9292)
client.set('/services/fooservice/env/TESTING_URL', value: 'http//foo.example.com/asdf')
@relistan
relistan / gist:53be1fc306543df4ffdd
Created May 29, 2014 18:37
etcd service discovery and configuration schema
client.set('/services/fooservice/ports/3021', value: 9292)
client.set('/services/fooservice/env/TESTING_URL', value: 'http//foo.com/asdf')
client.set('/services/fooservice/hosts/chi-staging-foo-1.nr-ops.net', value: 'up')
client.set('/services/fooservice/hosts/chi-staging-foo-2.nr-ops.net', value: 'up')
client.set('/services/fooservice/hosts/chi-staging-foo-3.nr-ops.net', value: 'down')
client.set('/services/fooservice/endpoints/chi-staging-foo-1.nr-ops.net', value: 'http://chi-staging-foo-1.nr-ops.net:3021/')
client.set('/services/fooservice/endpoints/chi-staging-foo-2.nr-ops.net', value: 'http://chi-staging-foo-2.nr-ops.net:3021/')
client.set('/services/fooservice/endpoints/chi-staging-foo-3.nr-ops.net', value: 'http://chi-staging-foo-3.nr-ops.net:3021/')
@relistan
relistan / gist:9648383
Last active August 29, 2015 13:57
Inspect the remotes for a directory full of git repos, filtering for newrelic
#!/bin/bash
REPOS=""
for config in `find . -maxdepth 3 -name config | grep '.git'`; do
egrep "github.com:newrelic|github.com/newrelic" $config > /dev/null
if [[ $? -eq 0 ]]; then
repo_dir=`dirname $(dirname ${config})`
REPOS="${REPOS} `basename ${repo_dir}`"
fi
done
@relistan
relistan / bootcfg_esxi55.template
Created December 4, 2013 19:33
VMWare ESXi Server 5.5 for DELL - Cobbler Configs
bootstate=0
title=Loading ESXi installer
prefix=$img_path
kernel=tboot.b00
#if $getVar('system_name','') != ''
#set $what = "system"
#else
#set $what = "profile"
#end if
kernelopt=ks=http://$server:$http_port/cblr/svc/op/ks/$what/$name
@relistan
relistan / upstart_completion.sh
Created November 14, 2013 17:31
Upstart bash auto-completion that works on RHEL/CentOS with older versions of Upstart.
# bash-completion for the upstart event-based init replacement
# (http://upstart.ubuntu.com / https://launchpad.net/upstart)
#
# We don't provide completion for 'init' itself for obvious reasons.
# Original is from: https://bugs.launchpad.net/ubuntu/+source/upstart/+bug/672067/+attachment/1765103/+files/upstart.sh
_upstart_conf_events()
{
initctl list|awk '{print $1}'
@relistan
relistan / memtest
Created November 7, 2013 23:21
Machine burn-in script
#!/bin/bash
#
# memtest
#
# A general purpose memory tester script, with options for enabling extra
# simultaneous tests in an attempt to test the capacity of the power supply
# in the machine. You can find the original source of this script and
# additional documentation on its usage by visiting my work web page at
# http://people.redhat.com/~dledford/
#