Skip to content

Instantly share code, notes, and snippets.


lars gelfan lgelfan

View GitHub Profile
View reset.css
/* Box sizing rules */
*::after {
box-sizing: border-box;
/* Remove default padding */
ol[class] {
lgelfan / Dockerfile
Last active Jun 8, 2019
docker-in-docker docker compose with sshd
View Dockerfile
# Docker client with docker-compose && sshd
# use on a Docker host to allow you to ssh and access Docker and Compose remotely
# e.g., as part of CI/CD on a private network.
# ** Not for production use on publicly-exposed server **
# mount for docker host socket:
# -v /var/run/docker.sock:/var/run/docker.sock:ro
# mount for docker-compose access (optional):
lgelfan / pre-commit
Created Mar 25, 2017 — forked from eddywashere/pre-commit
Git hook that prevents commits to master
View pre-commit
# Git hook that prevents commits to master
# use --no-verify to bypass this hook
# ex: git commit -m "init commit" --no-verify
branch=`git symbolic-ref HEAD`
if [ "$branch" = "refs/heads/master" ]; then
echo "Direct commits to the branch master are not allowed"
exit 1
lgelfan / nginx.conf
Created Nov 16, 2016 — forked from Stanback/nginx.conf
Example Nginx configuration for adding cross-origin resource sharing (CORS) support to reverse proxied APIs
View nginx.conf
# CORS header support
# One way to use this is by placing it into a file called "cors_support"
# under your Nginx configuration directory and placing the following
# statement inside your **location** block(s):
# include cors_support;
# As of Nginx 1.7.5, add_header supports an "always" parameter which
# fix virtual box network after using VPN, adjust as needed
# view output of ifconfig to see values
#sudo route -nv add -net 192.168.59 -interface vboxnet1
#sudo route -nv add -net 192.168.50 -interface vboxnet2
sudo route -nv add -net 192.168.33 -interface vboxnet3
sudo apt-get update
sudo apt-get install apt-transport-https ca-certificates
sudo apt-key adv --keyserver hkp:// --recv-keys 58118E89F3A912897C070ADBF76221572C52609D
sudo touch /etc/apt/sources.list.d/docker.list
sudo echo 'deb ubuntu-xenial main' | sudo tee --append /etc/apt/sources.list.d/docker.list > /dev/null
sudo apt-get update
View Vagrantfile_ubuntu1504-docker
# minor updates, see Vagrant file after init for default settings and comments:
# vagrant init box-cutter/ubuntu1504-docker; vagrant up --provider virtualbox
Vagrant.configure(2) do |config| = "box-cutter/ubuntu1504-docker" "forwarded_port", guest: 80, host: 8888 "private_network", ip: ""
config.vm.provider "virtualbox" do |vb|
vb.memory = "1024"
lgelfan /
Last active Nov 25, 2015
PHP 7 with Yii 2.0 from Docker container. (PHP/7.0.0RC-apache)
# FROM Mac (or similar):
vagrant init box-cutter/ubuntu1504-docker
# edit Vagrantfile as needed (see associated Vagrant file here:, then:
vagrant up --provider virtualbox
vagrant ssh
# FROM DOCKER HOST: (Linux / Vagrant / boot2docker / etc)
docker run -it --rm --name php7 -v "$PWD":/var/www/html -p 80:80 php:7-apache
# change ports / volume info above as needed. don't use "--rm" if you want to keep the contianer when stopped.