This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"bytes" | |
"encoding/json" | |
"flag" | |
"fmt" | |
"log" | |
"net/http" | |
"net/url" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Wait until consul instance on clust | |
INSTANCE_IP="127.0.0.1" | |
NEXT_WAIT_TIME=0 | |
MAX_WAIT_TIME=35 | |
check_consul_sync() { | |
# If we don't have leaders _last_log_index then get it |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"flag" | |
"fmt" | |
"log" | |
"net/http" | |
) | |
func initFlags(addr *string, port *int, retCode *int, body *string) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
trap 'echo captured;sleep 30;exit' SIGINT SIGTERM && while true; do sleep 1; done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Package main is an example of how handler pattern works in golang. | |
// | |
// At first you will need some sort of start point. To do this we create | |
// ExampleHandler interface, this interface has a trigger method that will | |
// execute the chain, in his case is RunExample, it accepts a writer, and a | |
// custom input object, as you see there is an out and an in parameter. | |
// | |
// We could work like this you can create multiple ExampleHandlers in a helper | |
// function and call them on in another. But this is not very handy and it smells | |
// |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
gvm install go1.6.2 | |
gvm use go1.6.2 --default | |
gvm pkgset create slok | |
gvm pkgenv slok | |
# Add this lines | |
export GOPATH; GOPATH="/home/slok/projects/work/go:/home/slok/projects/personal/go:$GOPATH" | |
export PATH; PATH="/home/slok/projects/work/go/bin:/home/slok/projects/personal/go/bin:$PATH" | |
gvm pkgset use slok --default |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from fabric.api import * | |
@task | |
@runs_once | |
def deploy(): | |
print(env) | |
print(env.get('fabric_bolt_deploy_id', 0)) | |
print(env.get('deployer_email', "unknown")) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
KEY=$(xauth list |grep $(hostname) | awk '{ print $3 }' | head -n 1) | |
DCK_HOST=docker-skype | |
xauth add $DCK_HOST/unix:0 . $KEY | |
docker run -it --rm -v /tmp/.X11-unix:/tmp/.X11-unix \ | |
-v $HOME/.Xauthority:/tmp/.Xauthority \ | |
-v /dev/snd:/dev/snd \ | |
-e DISPLAY=unix$DISPLAY \ | |
-e XAUTHORITY=/tmp/.Xauthority \ | |
-h $DCK_HOST \ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import com.matttproud.quantile as quantile | |
with open('test_data.txt') as f: | |
data = list(map(float, f.readlines())) | |
#a = np.array(list(data)) | |
#quantile = { | |
# '0.5': np.percentile(a, 0.05), | |
# '0.9': np.percentile(a, 0.09), | |
# '0.99': np.percentile(a, 0.99), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
global { | |
scrape_interval: "15s" # By default, scrape targets every 15 seconds. | |
evaluation_interval: "15s" # By default, evaluate rules every 15 seconds. | |
labels: { | |
label: { | |
name: "monitor" | |
value: "test-monitor" | |
} | |
} |