Skip to content

Instantly share code, notes, and snippets.

View gesellix's full-sized avatar
🐱
🐋

Tobias Gesellchen gesellix

🐱
🐋
View GitHub Profile
@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() {
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
{ "@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"} } }
#
# 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):

Setup Mac OS X Mountain Lion or Mavericks

Edit: I few months ago I got a new laptop and did the same thing on Mavericks.

I just replaced the hard drive of my mbp and decided to do a clean install of Mountain Lion (10.8.5) since I was still using Snow Leopard (10.6.8).

I kinda regret for not using Boxen to automate the

Creating a Happy Git Environment on OS X

Step 1: Install Git

Configure things:

git config --global user.name "Your Name"
git config --global user.email "[email protected]"
git config --global alias.co checkout

git config --global apply.whitespace nowarn

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@gesellix
gesellix / auth.go
Last active August 29, 2015 14:22 — forked from tristanwietsma/auth.go
package main
import (
"encoding/base64"
"net/http"
"strings"
)
type handler func(w http.ResponseWriter, r *http.Request)
//
// Regular Expression for URL validation
//
// Author: Diego Perini
// Updated: 2010/12/05
// License: MIT
//
// Copyright (c) 2010-2013 Diego Perini (http://www.iport.it)
//
// Permission is hereby granted, free of charge, to any person
@gesellix
gesellix / gbr.txt
Last active September 19, 2015 21:03 — forked from viktorklang/gbr.txt
shell alias for showing git branches sorted by last activity date
alias gbr='git for-each-ref --sort="-authordate:iso8601" --format=" %(color:green)%(authordate:iso8601)%09%(color:white)%(refname:short)" refs/heads'