Skip to content

Instantly share code, notes, and snippets.

View amorken's full-sized avatar

Anders Daljord Morken amorken

View GitHub Profile
@amorken
amorken / prometheus-nodeexporter.service
Last active September 18, 2018 08:24
Example Systemd configuration that starts the Prometheus node exporter and handles Consul registration.
[Unit]
Description=Prometheus Node Exporter
After=consul-client.target consul-server.target network.target
[Service]
User=prometheus
ExecStart=/usr/bin/node_exporter --web.listen-address :9109
ExecStartPost=/usr/local/bin/consul-cli service-register prometheus-nodeexporter --id=prometheus-nodeexporter --address=%H --port=9109
ExecStop=/usr/local/bin/consul-cli service-deregister prometheus-nodeexporter
@amorken
amorken / baseline.txt
Created June 14, 2017 07:56
TransportBenchmark with and without CodedInputStream.newInstance(ByteBuffer) - https://github.com/grpc/grpc-java/issues/2937
Benchmark (direct) (transport) Mode Cnt Score Error Units
TransportBenchmark.unaryCall1024 true INPROCESS sample 4088392 3178.022 ± 22.720 ns/op
TransportBenchmark.unaryCall1024:unaryCall1024·p0.00 true INPROCESS sample 1406.000 ns/op
TransportBenchmark.unaryCall1024:unaryCall1024·p0.50 true INPROCESS sample 3080.000 ns/op
TransportBenchmark.unaryCall1024:unaryCall1024·p0.90 true INPROCESS sample 3308.000 ns/op
TransportBenchmark.unaryCall1024:unaryCall1024·p0.95 true INPROCESS sample 3408.000 ns/op
TransportBenchmark.unaryCall1024:unaryCall1024·p0.99 true INPROCESS sample 4304.000 ns/op
TransportBenchmark.unaryCall1024:unaryCall1024·p0.999 true INPROCESS sample 14032.000 ns/op
TransportBenchmark.unary
@amorken
amorken / inotify-trigger.sh
Created June 28, 2012 10:42
Triggering a command when a file tree is changed using inotify
#!/bin/bash
# Watch a directory and run a script every time inotify reports that something
# changed, followed by 10 seconds of no changes. Handy for responding to incoming
# rsync jobs or the like.
#
# Requires that inotify-tools is installed.
WATCHDIR=${1:./}
TRIGGERCOMMAND=${2:-echo fired}
@amorken
amorken / tjomlid.vcl
Created June 26, 2012 21:20
VCL file for Wordpress @ tjomlid.com
# Default backend definition. Set this to point to your content
# server.
backend default {
# I have Virtual Hosts that only listen to the Public IP
# so no 127.0.0.1 for me
# Backend is running on port 80
.host = "82.116.79.20";
.port = "80";
.first_byte_timeout = 300s;
}