Skip to content

Instantly share code, notes, and snippets.

View sielaq's full-sized avatar

Wojciech Sielski sielaq

  • Adevinta | mobile.de
  • Berlin
View GitHub Profile
@sielaq
sielaq / app.go
Last active December 4, 2016 23:08
package main
import "fmt"
import "os"
import "os/exec"
import "os/signal"
import "syscall"
import "io/ioutil"
func f(from string) {
@sielaq
sielaq / trap_signal.c
Created November 6, 2015 18:24
Trap signal - helpful to debug
/*
gcc trap_signal.c -o trap_signal
start:
./trap_signal $(pidof trap_signal)
tail -f /tmp/log.txt
*/
#include <signal.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
@sielaq
sielaq / reproduceit.sh
Last active August 29, 2015 14:15
PoC to reprodcue the issue
#!/bin/bash
[ -z ${CONSUL_IP} ] && { echo "please export CONSUL_IP" && exit 1; }
CONSUL_TEMPLATE_LOG=debug
CONSUL_TEMPLATE_LOG_OUTPUT="/tmp/consul_template.debug"
CONSUL_TEMPLATE_OUTPUT="/tmp/haproxy.cfg"
cat > template.cfg << EOF
{{range services}}{{\$service:=.Name}}{{range .Tags}}{{if or (eq . "webapp") (eq . "haproxy")}}
@sielaq
sielaq / consul-template-haparoxy.debug
Created February 18, 2015 07:13
consul-template debug
2015-02-17 19:41:14,081 CRIT Supervisor running as root (no user in config file)
2015-02-17 19:41:14,111 INFO RPC interface 'supervisor' initialized
2015-02-17 19:41:14,111 CRIT Server 'inet_http_server' running without any HTTP authentication checking
2015-02-17 19:41:14,111 INFO RPC interface 'supervisor' initialized
2015-02-17 19:41:14,111 CRIT Server 'unix_http_server' running without any HTTP authentication checking
2015-02-17 19:41:14,112 INFO supervisord started with pid 1
2015-02-17 19:41:15,114 INFO spawned: 'stdout' with pid 11
2015-02-17 19:41:15,119 INFO spawned: 'haproxy_configurator' with pid 12
2015-02-17 19:41:16,163 INFO success: stdout entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2015-02-17 19:41:16,163 INFO success: haproxy_configurator entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)