Skip to content

Instantly share code, notes, and snippets.

Working from home

Bob Maerten bobmaerten

Working from home
Block or report user

Report or block bobmaerten

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
bobmaerten / .gitattributes
Last active Oct 21, 2019 — forked from jeromedalbert/.gitattributes
Automatically resolve Git merge conflicts in Rails schema.rb by picking the most recent date in the conflict (works with Rails 6 and recent versions of Git). The following files should be in your home ~ directory.
View .gitattributes
db/schema.rb merge=railsschema
bobmaerten / git-prune-tracked-branches
Created Oct 28, 2016
Merged tracked branches pruning to keep .git/config file clean
View git-prune-tracked-branches
#!/usr/bin/env bash
current_branch=$(git rev-parse --abbrev-ref HEAD)
[ $current_branch == "master" ] || git checkout master
git fetch --all -p --tags
git pull
for BRANCH in $(git branch --merged origin/master | grep -v "\* master")
View gist:b69bbeca0cde95b99a7a7b285d977548
day-activity = "!f() { git log --all --committer=<Insert Name here> --pretty=tformat:'%<(80,trunc) %s %Cred%ci%Creset' --abbrev-commit --after='yesterday' | pbcopy; pbpaste; }; f"
bobmaerten / untitled
Created Feb 10, 2016
Docker create and serve default jekyll image
View untitled
$ docker-machine use bobmaerten
$ docker create --name jekyll_site -v /srv/jekyll jekyll/jekyll
$ docker run --rm --label=jekyll --volumes-from jekyll_site -it -p 4000:4000 jekyll/jekyll jekyll new .
$ docker run --rm --label=jekyll --volumes-from jekyll_site -it -p 4000:4000 jekyll/jekyll
View config
input {
file {
type => "apache"
path => [ "/data/*.log" ]
start_position => "beginning"
filter {
grok {

Keybase proof

I hereby claim:

  • I am bobmaerten on github.
  • I am bobmaerten ( on keybase.
  • I have a public key whose fingerprint is D422 3721 3686 DA7E C0E8 DD95 90C3 B7F1 8142 244D

To claim this, I am signing this object:

bobmaerten /
Created May 27, 2015
Run PHP CLI script with Docker
#!/usr/bin/env bash
die() { echo "$@" 1>&2 ; exit 1; }
[ "$#" -ne 1 ] && die "usage: $0 <php script>"
head -n 1 $1 | grep -q "^<?php" || die "error: only runs php scripts"
eval "$(docker-machine env dev)"
docker run -it --rm --name my-running-script -v $(pwd):/usr/src/myapp -w /usr/src/myapp php:5.6-cli php $1
bobmaerten / gist:c454ad03dbf81f72c220
Created Sep 30, 2014
Remember to update your docker images too!
View gist:c454ad03dbf81f72c220
❯ docker run --rm -i -t debian /bin/bash
root@bafbca8fc9af:/# env X='() { (a)=>\' bash -c "echo echo vuln"; [[ "$(cat echo)" == "vuln" ]] && echo "still vulnerable :("^C
root@bafbca8fc9af:/# exit
❯ docker run --rm -i -t debian /bin/bash
root@feff7506db14:/# # test CVE-2014-6271
root@feff7506db14:/# env x='() { :;}; echo vulnerable' bash -c echo
#!/usr/bin/env bash
usage() {
echo "Usage: `basename $0` {start|stop|status|connect}"
exit 1
if [ -z "$1" ]; then
bobmaerten / default
Created Apr 29, 2014
Reverse proxy configuration with Apache/httpd mod_macro
View default
<Macro RedirSSL ${domain}>
<VirtualHost *:80>
ServerName ${domain}
RewriteEngine On
RewriteCond %{SERVER_PORT} !^443$
RewriteRule ^/(.*) https://%{HTTP_HOST}/$1 [NC,R,L]
You can’t perform that action at this time.