Skip to content

Instantly share code, notes, and snippets.

View gesellix's full-sized avatar
🐱
🐋

Tobias Gesellchen gesellix

🐱
🐋
View GitHub Profile
#
# Proof of concept for a HAProxy maintenance mode
#
#
# Relevant docs:
# http://cbonte.github.io/haproxy-dconv/configuration-1.5.html#4-errorfile
# http://cbonte.github.io/haproxy-dconv/configuration-1.5.html#add%20acl
# Control the maintenance page during runtime using the stats socket
#
# To put the whole site in maintenance mode (for all IPs):
{ "@timestamp": "2015-02-02T04:25:26+0000", "@fields": { "status": 200, "request": "/author/", "bytes": 43, "more": { "host" : "localhost"} } }
{ "@timestamp": "2015-02-02T04:25:27+0000", "@fields": { "status": 404, "request": "/title/", "bytes": 84, "more": { "host" : "localhost"} } }
{ "@timestamp": "2015-02-02T04:25:28+0000", "@fields": { "status": 302, "request": "/publisher/", "bytes": 45, "more": { "host" : "localhost"} } }
{ "@timestamp": "2015-02-02T04:25:29+0000", "@fields": { "status": 202, "request": "/keywords/", "bytes": 700, "more": { "host" : "localhost"} } }
import java.io.IOException;
import java.io.InputStream;
import java.net.URL;
import java.net.HttpURLConnection;
// This is a very basic implementation of the Docker API v. 1.12 for attaching to a containers StdOut and StdErr stream using HTTP
// It is not perfect (see official Docker API documentation for details and how to handle the bytestream) but up to this date its
// the most compleate, working example for this to get an idea what's going on there. Happy about any improvement ideas.
public class Readin
@gesellix
gesellix / changelog.sh
Last active August 29, 2015 14:09 — forked from alexec/changelog.sh
#! /bin/sh
# Creates a markdown formatted change log based the git history
set -eu
OWNER=${1:-'docker-java'}
REPO=${2:-'docker-java'}
USER=$(cat ~/.git_user)
PASS=$(cat ~/.git_password)
function pullDesc() {