Skip to content

Instantly share code, notes, and snippets.

View lgelfan's full-sized avatar
💭
Float'n

lars gelfan lgelfan

💭
Float'n
View GitHub Profile
/* Box sizing rules */
*,
*::before,
*::after {
box-sizing: border-box;
}
/* Remove default padding */
ul[class],
ol[class] {
@lgelfan
lgelfan / Dockerfile
Last active June 8, 2019 04:14
docker-in-docker docker compose with sshd
##
# 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 March 25, 2017 00:38 — forked from eddywashere/pre-commit
Git hook that prevents commits to master
#!/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 November 16, 2016 06:45 — forked from Stanback/nginx.conf
Example Nginx configuration for adding cross-origin resource sharing (CORS) support to reverse proxied APIs
#
# 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
#!/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
# 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 November 25, 2015 16:13
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: 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.