View postgres_queries_and_commands.sql
-- show running queries (pre 9.2)
SELECT procpid, age(query_start, clock_timestamp()), usename, current_query
FROM pg_stat_activity
WHERE current_query != '<IDLE>' AND current_query NOT ILIKE '%pg_stat_activity%'
ORDER BY query_start desc;
-- show running queries (9.2)
SELECT pid, age(query_start, clock_timestamp()), usename, query
FROM pg_stat_activity
WHERE query != '<IDLE>' AND query NOT ILIKE '%pg_stat_activity%'
View blockingreader.go
package main
import (
"fmt"
"io"
"os"
"github.com/fsouza/go-dockerclient"
)
View 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 {
View kafkamon.scala
/**
* 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
*
View nitro_logback.lua
-- 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)
View out.txt
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)
View Services Layout.md

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')
View gist:53be1fc306543df4ffdd
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/')
View gist:9648383
#!/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
View bootcfg_esxi55.template
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