Skip to content

Instantly share code, notes, and snippets.

Karl Matthias relistan

View GitHub Profile
View Keybase.md

Keybase proof

I hereby claim:

  • I am relistan on github.
  • I am relistan (https://keybase.io/relistan) on keybase.
  • I have a public key ASAFN-_0eLk8YPjMdYWgLmXs9RxtcSbJmdQLMUXSLcG1fQo

To claim this, I am signing this object:

@relistan
relistan / env_var_provider.ex
Last active Dec 18, 2018
Elixir Distillery Env Var Provider
View env_var_provider.ex
defmodule EnvVar.Provider do
use Mix.Releases.Config.Provider
require Logger
def init(app: app, prefix: prefix, env_map: env_map) do
persist(app, prefix, env_map)
end
# E.g.
@relistan
relistan / Dockerfile
Created Dec 5, 2017
Sidecar Envoy Docker container
View Dockerfile
FROM envoyproxy/envoy:v1.5.0
RUN apt-get update
COPY envoy.yaml /etc/envoy.yaml
ADD run.sh /run.sh
CMD /run.sh
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%'
@relistan
relistan / blockingreader.go
Last active May 7, 2016
block-docker-container
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 {
@relistan
relistan / kafkamon.scala
Created Mar 14, 2016
Kafka Offset Monitor
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
*
@relistan
relistan / nitro_logback.lua
Created Jan 30, 2016
Logback standard output parser for Heka
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)
@relistan
relistan / out.txt
Created Jun 23, 2014
Validating Centurion
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)
@relistan
relistan / Services Layout.md
Last active Aug 29, 2015
Centurion with etcd Proof-of-Concept
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')
You can’t perform that action at this time.