Skip to content

Instantly share code, notes, and snippets.

View bobmaerten's full-sized avatar
🏠
Working from home

Bob Maerten bobmaerten

🏠
Working from home
  • Level UP Solutions
  • Valenciennes, France
View GitHub Profile
@bobmaerten
bobmaerten / apache-vhost
Created February 24, 2014 15:31
Redirection :80 -> :443
<VirtualHost *:80>
ServerName plop
RewriteEngine On
RewriteCond %{SERVER_PORT} !^443$
RewriteRule ^/(.*) https://%{HTTP_HOST}/$1 [NC,R,L]
</VirtualHost>
<VirtualHost *:443>
@bobmaerten
bobmaerten / default
Created April 29, 2014 08:00
Reverse proxy configuration with Apache/httpd mod_macro
<Macro RedirSSL ${domain}>
<VirtualHost *:80>
ServerName ${domain}.domain.com
RewriteEngine On
RewriteCond %{SERVER_PORT} !^443$
RewriteRule ^/(.*) https://%{HTTP_HOST}/$1 [NC,R,L]
</VirtualHost>
</Macro>
#-------
@bobmaerten
bobmaerten / mysql-on-demand.sh
Last active August 29, 2015 14:06
Mysql On Demand
#!/usr/bin/env bash
usage() {
echo "Usage: `basename $0` {start|stop|status|connect}"
exit 1
}
if [ -z "$1" ]; then
usage
fi
@bobmaerten
bobmaerten / gist:c454ad03dbf81f72c220
Created September 30, 2014 07:34
Remember to update your docker images too!
❯ 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:/#
root@bafbca8fc9af:/#
root@bafbca8fc9af:/#
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
@bobmaerten
bobmaerten / run_php.sh
Created May 27, 2015 16:26
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
bobmaerten / keybase.md
Created June 3, 2015 18:05
keybase.md

Keybase proof

I hereby claim:

  • I am bobmaerten on github.
  • I am bobmaerten (https://keybase.io/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
bobmaerten / config
Last active August 29, 2015 14:23
Logstash config for use with https://github.com/pblittle/docker-logstash
input {
file {
type => "apache"
path => [ "/data/*.log" ]
start_position => "beginning"
}
}
filter {
grok {
@bobmaerten
bobmaerten / postinstall_ubuntu_11.10.sh
Created October 6, 2011 10:26 — forked from alejandro/ubuntu
Getting ready for a developer machine. Ubuntu 11.10
#!/usr/bin/env bash
echo "Using apt-get to install OS packages so let's update it first ..."
sudo apt-get update -y
echo "Installing OS packages. You will be prompted for your password ..."
sudo apt-get install build-essential bison openssl libreadline6 libreadline6-dev curl git zlib1g zlib1g-dev libssl-dev libyaml-dev libsqlite3-0 libsqlite3-dev sqlite3 libxml2-dev libxslt-dev autoconf libc6-dev vim zsh -y
echo "Installing Utility packages."
sudo apt-get install ubuntu-restricted-extra chromium-browser
@bobmaerten
bobmaerten / page.css
Created November 13, 2011 22:15
Un peu d'animation
.affiche {
position: relative;
height: 260px;
overflow:hidden;
padding: 0;
}
.affiche img {
margin: 0;
padding: 0;
@bobmaerten
bobmaerten / ubuntu_ruby_install.sh
Created March 9, 2012 13:56
Ubuntu Ruby install - rbenv and ruby-build
#!/bin/bash
# pre-requisites
sudo apt-get install curl libssl-dev
# Install rbenv
# https://github.com/sstephenson/rbenv
cd ~
git clone git://github.com/sstephenson/rbenv.git .rbenv