Skip to content

Instantly share code, notes, and snippets.

View ypereirareis's full-sized avatar
:octocat:
Hello ! Have you seen Batman ?

Yannick Pereira-Reis ypereirareis

:octocat:
Hello ! Have you seen Batman ?
View GitHub Profile
@ypereirareis
ypereirareis / .gitconfig
Created March 3, 2015 11:07
Funny git stash forOSX
[alias]
stashstash = "!f() { STASH=$(git stash); echo \"\\033[0;31mKouroukoukou roukoukou stash stash\\033[0m\"; echo \"$STASH\"; open \"http://www.youtube.com/watch?v=LpE1bJp8-4w&feature=youtu.be&t=47s\" > /dev/null 2>&1 & }; f"
satsh = !git stashstash
@ypereirareis
ypereirareis / docker_wait_hosts.sh
Last active August 19, 2016 05:06
Script to wait for a host to become available locally
wait_single_host() {
local host=$1
shift
local port=$1
shift
echo "==> Check host ${host}:${port}"
while ! nc ${host} ${port} > /dev/null 2>&1 < /dev/null; do echo " --> Waiting for ${host}:${port}" && sleep 1; done;
}
@ypereirareis
ypereirareis / Dockerfile
Last active February 15, 2016 13:39
Docker image size optimization INIT
FROM ubuntu:14.04
MAINTAINER Yannick PEREIRA-REIS <[email protected]>
@ypereirareis
ypereirareis / Dockerfile
Last active February 15, 2016 14:37
Docker image size optimization FULL
FROM ubuntu:14.04
MAINTAINER Yannick PEREIRA-REIS <[email protected]>
ENV DEBIAN_FRONTEND noninteractive
RUN apt-get update && apt-get install -y --force-yes \
build-essential \
git \
curl \
php5 \
@ypereirareis
ypereirareis / nginx_redirect_1.sh
Last active December 1, 2016 09:13
Nginx configuration to redirect everything (www or not, http or https) to https://www.example.com
server {
server_name www.example.com;
listen 80 ;
access_log /var/log/nginx/access.log vhost;
return 301 https://$host$request_uri;
}
@ypereirareis
ypereirareis / .env
Last active October 28, 2019 14:18
Split env file into multiple files
REGISTRY_PATH=registry.domain.tld
TAG_PHP=7.2
TAG_NGINX=1.17.5
HTTP_PORT=2000
REPLICA_COUNT_PHP=3
REPLICA_COUNT_NGINX=3
DATABASE_NETWORK=mysql-005
NGINX_MEM_LIMIT=215M
PHP_MEM_LIMIT=2G
MEMORY_LIMIT=2G
@ypereirareis
ypereirareis / docker-compose.yml
Created October 28, 2019 15:07
Split env file solutions
version: '3.5'
services:
# Php service configuration
php:
image: ${REGISTRY_PATH}/php:${TAG_PHP}
networks:
- default
- database
environment:
MEMORY_LIMIT: "${MEMORY_LIMIT}"
@ypereirareis
ypereirareis / .env
Created October 28, 2019 16:41
split env solution 2
REGISTRY_PATH=registry.domain.tld
TAG_PHP=7.2
TAG_NGINX=1.17.5
HTTP_PORT=2000
REPLICA_COUNT_PHP=3
REPLICA_COUNT_NGINX=3
DATABASE_NETWORK=mysql-005
NGINX_MEM_LIMIT=215M
PHP_MEM_LIMIT=2G