Skip to content

Instantly share code, notes, and snippets.

Avatar
💭
Float'n

lars gelfan lgelfan

💭
Float'n
View GitHub Profile
View reset.css
/* Box sizing rules */
*,
*::before,
*::after {
box-sizing: border-box;
}
/* Remove default padding */
ul[class],
ol[class] {
@lgelfan
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
lgelfan / pre-commit
Created Mar 25, 2017 — forked from eddywashere/pre-commit
Git hook that prevents commits to master
View pre-commit
#!/bin/sh
#
# 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
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
View fix-vboxnetwork.sh
####
# 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
View docker-install-ubuntu-xenial.sh
#!/bin/bash
sudo apt-get update
sudo apt-get install apt-transport-https ca-certificates
sudo apt-key adv --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys 58118E89F3A912897C070ADBF76221572C52609D
sudo touch /etc/apt/sources.list.d/docker.list
sudo echo 'deb https://apt.dockerproject.org/repo 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|
config.vm.box = "box-cutter/ubuntu1504-docker"
config.vm.network "forwarded_port", guest: 80, host: 8888
config.vm.network "private_network", ip: "192.168.33.10"
config.vm.provider "virtualbox" do |vb|
vb.memory = "1024"
end
@lgelfan
lgelfan / php7-yii_install.sh
Last active Nov 25, 2015
PHP 7 with Yii 2.0 from Docker container. (PHP/7.0.0RC-apache)
View php7-yii_install.sh
# FROM Mac (or similar):
vagrant init box-cutter/ubuntu1504-docker
# edit Vagrantfile as needed (see associated Vagrant file here: https://gist.github.com/lgelfan/b9d20c61317bf07fcaaa), 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.