Skip to content

Instantly share code, notes, and snippets.

@gblok
gblok / .gitlab.ci.yml
Created February 10, 2019 19:01 — forked from yannhowe/.gitlab.ci.yml
.gitlab.ci.yml for SSH with private key.
# Image neeeds to have ssh-client
image: docker:git
services:
- docker:dind
stages:
- staging
before_script:
- docker login -u gitlab-ci-token -p $CI_BUILD_TOKEN $CI_REGISTRY
@gblok
gblok / restore
Created January 23, 2019 05:00 — forked from jrgifford/restore
pg_restore a local db dump into Docker
# Assumes the database container is named 'db'
DOCKER_DB_NAME="$(docker-compose ps -q db)"
DB_HOSTNAME=db
DB_USER=postgres
LOCAL_DUMP_PATH="path/to/local.dump"
docker-compose up -d db
docker exec -i "${DOCKER_DB_NAME}" pg_restore -C --clean --no-acl --no-owner -U "${DB_USER}" -d "${DB_HOSTNAME}" < "${LOCAL_DUMP_PATH}"
docker-compose stop db
@gblok
gblok / gist:ec48dcdea14d1d0f27e843efa80d90fe
Created January 23, 2019 04:59 — forked from dexalex84/gist:132a4833fae76a202544ddace912ddb2
Creating postgresql container via docker-compose
create folder
1)
mkdir docker-compose-pg
cd docker-compose-pg
2)
vi docker-compose.yml
insert this text:
"
@gblok
gblok / nginx.conf
Created January 19, 2019 20:32 — forked from plentz/nginx.conf
Best nginx configuration for improved security(and performance). Complete blog post here http://tautt.com/best-nginx-configuration-for-security/
# to generate your dhparam.pem file, run in the terminal
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048
@gblok
gblok / DNS prefetching
Created January 19, 2019 18:23
Common Prefetch Links
<!-- Amazon S3 -->
<link rel="dns-prefetch" href="//s3.amazonaws.com">
<!-- Google CDN -->
<link rel="dns-prefetch" href="//ajax.googleapis.com">
<!-- Microsoft CDN -->
<link rel="dns-prefetch" href="//ajax.microsoft.com">
<link rel="dns-prefetch" href="//ajax.aspnetcdn.com">
@gblok
gblok / nginx-and-certbot-config.md
Last active January 15, 2019 07:48 — forked from rkaramandi/nginx-and-certbot-config.md
Running NGINX and CertBot Containers on the Same Host

Running NGINX and CertBot Containers on the Same Host

The Problem

A lot of people run into the problem of running Let's Encrypt's CertBot Tool and an NGINX on the same container host. A big part of this has to do with CertBot needing either port 80 or 443 open for the tool to work as intended. This tends to conflict with NGINX as most people usually use port 80 (HTTP) or 443 (HTTPS) for their reverse proxy. Section 1 outlines how to configure NGINX to get this to work, and Section 2 is the Docker command to run CertBot.

1. NGINX Configuration

I use Docker Compose (docker-compose) for my NGINX server. My docker-compose.yml file looks something like this:

@gblok
gblok / Instructions.md
Created January 13, 2019 11:09 — forked from pgilad/Instructions.md
Generate SSL Certificate for use with Webpack Dev Server (OSX)

Generate private key

$ openssl genrsa -out private.key 4096

Generate a Certificate Signing Request

openssl req -new -sha256 \
@gblok
gblok / gist:fd491ca1e12fb09fde88b027a707bcc0
Created January 7, 2019 14:33 — forked from ivan-loh/gist:ee0d96c3795e59244063
Node.JS ( & pm2 ) Process Memory Limit
# Plain Ol' Node
node --max-old-space-size=1024 app.js # increase to 1gb
node --max-old-space-size=2048 app.js # increase to 2gb
node --max-old-space-size=3072 app.js # increase to 3gb
node --max-old-space-size=4096 app.js # increase to 4gb
node --max-old-space-size=5120 app.js # increase to 5gb
node --max-old-space-size=6144 app.js # increase to 6gb
# For pm2
pm2 start app.js --node-args="--max-old-space-size=1024" # increase to 1gb
@gblok
gblok / CRLF.gitattributes
Created October 20, 2018 12:02 — forked from bsara/CRLF.gitattributes
General .gitattributes File with Windows Line Endings (CRLF)
# Project
* text eol=crlf
# Language Diffs
*.cs diff=csharp
*.css diff=css
@gblok
gblok / docker-compose.yml
Created September 16, 2018 21:45 — forked from hyperius/docker-compose.yml
Local Consul/Vault environment
version: "2"
services:
consul:
image: consul:latest
command: "agent -dev -client=0.0.0.0 -bind='{{ GetPrivateIP }}'"
ports:
- 8500:8500
vault: