Skip to content

Instantly share code, notes, and snippets.

View bytesandwich's full-sized avatar

Jack bytesandwich

  • Facebook
  • Sunnyvale, CA
View GitHub Profile
@bytesandwich
bytesandwich / parse_event.rb
Created April 10, 2019 19:36
Logstash ruby plugin file to collect spinnaker metrics in logstash
require "json"
require 'socket'
@hostname = Socket.gethostname
def register(params)
end
# Turns one Netflix spectator application feed into many generic metrics
# suitable for ingestion in influxdb.
@bytesandwich
bytesandwich / logstash.conf
Created April 10, 2019 19:34
Logstash config to collect/push spinnaker metrics from a localdebian install.
input {
http_poller {
# Poll the (Netflix project) spectator metrics
# from spinnaker services.
urls => {
clouddriver => "http://localhost:7002/spectator/metrics"
fiat => "http://localhost:7003/spectator/metrics"
igor => "http://localhost:8088/spectator/metrics"
front50 => "http://localhost:8080/spectator/metrics"
@bytesandwich
bytesandwich / postgres-master-announce.service
Created February 6, 2015 05:54
postgres master announce
[Unit]
Description=Announce Postgres Master
BindsTo=postgres-master.service
After=postgres-master.service
[Service]
ExecStart=/bin/sh -c "while true; do etcdctl set /services/postgres/master '{ \"host\": \"%H\", \"port\": 80, \"version\": \"52c7248a14\", \"ip\": \"'`ifconfig docker0 | awk '/\<inet\>/ { print $2}'`'\" }' --ttl 60;sleep 45;done"
ExecStop=/usr/bin/etcdctl rm /services/postgres/master
[X-Fleet]
@bytesandwich
bytesandwich / gist:3ff7c1bca6d4b652ef8c
Created February 6, 2015 05:44
postgres-master.service
[Unit]
Description=Postgres Master
After=docker.service
Requires=docker.service
[Service]
TimeoutStartSec=0
ExecStartPre=-/usr/bin/docker kill postgres-master
ExecStartPre=-/usr/bin/docker rm postgres-master
ExecStartPre=/usr/bin/docker pull postgres:9
@bytesandwich
bytesandwich / gist:8232912
Created January 3, 2014 04:47
Vim go setup
http://0value.com/my-Go-centric-Vim-setup
http://gmarik.info/blog/2010/10/08/ctags-on-OSX
set completeopt+=longest
set nu
@bytesandwich
bytesandwich / IntegrationTest.java
Created August 12, 2012 23:30
IntegrationTest.java
protected abstract static class ListComparer<T> {
protected abstract Comparable compareBy(T item);
protected boolean equalLists(List<T> result, List<T> expected) {
if (result == null || expected == null) {
return result == null && expected == null;
}
Comparator<T> comparator = new Comparator<T>() {
@bytesandwich
bytesandwich / file.txt
Created August 10, 2012 17:53
file.txt
-------------------------------------------------------------------------------
Test set: com.fasterxml.jackson.datatype.hibernate4.LazyLoadingTest
-------------------------------------------------------------------------------
Tests run: 1, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 0.235 sec <<< FAILURE!
testGetCustomerJson(com.fasterxml.jackson.datatype.hibernate4.LazyLoadingTest) Time elapsed: 0.235 sec <<< FAILURE!
junit.framework.AssertionFailedError: null
at junit.framework.Assert.fail(Assert.java:47)
at junit.framework.Assert.assertTrue(Assert.java:20)
at junit.framework.Assert.assertFalse(Assert.java:34)
at junit.framework.Assert.assertFalse(Assert.java:41)