Skip to content

Instantly share code, notes, and snippets.

@gblok
gblok / empty-example.md
Created January 2, 2020 15:31 — forked from subfuzion/empty-example.md
Protocol Buffer example of importing and using empty

How to import and indicate empty request or reply messages:

import "google/protobuf/empty.proto";

service SomeService {
    rpc SomeOperation (google.protobuf.Empty) returns (google.protobuf.Empty) {}
}
@gblok
gblok / consul-deployment-guide.md
Created December 16, 2019 10:05
Consul Deployment Guide

Consul Deployment Guide

This deployment guide covers the steps required to install and configure a single HashiCorp Consul cluster as defined in the Consul Reference Architecture.

Below are instructions for installing and configuring Consul on Linux hosts running the systemd system and service manager.

Reference Material

This deployment guide is designed to work in combination with the Consul Reference Architecture. Although not a strict requirement to follow the Consul Reference Architecture, please ensure you are familiar with the overall architecture design; for example installing Consul on multiple physical or virtual (with correct anti-affinity) hosts for high-availability.

@gblok
gblok / vault-deployment-guide.md
Created December 16, 2019 10:05
Vault Deployment Guide

Vault Deployment Guide

This deployment guide covers the steps required to install and configure a single HashiCorp Vault cluster as defined in the Vault Reference Architecture.

Below are instructions for installing and configuring Vault on Linux hosts running the systemd system and service manager.

Reference Material

This deployment guide is designed to work in combination with the Vault Reference Architecture and Consul Deployment Guide. Although not a strict requirement to follow the Vault Reference Architecture, please ensure you are familiar with the overall architecture design; for example installing Vault on multiple physical or virtual (with correct anti-affinity) hosts for high-availability and using Consul for the HA and storage backend.

@gblok
gblok / 2018-https-localhost.md
Created October 4, 2019 09:35 — forked from cecilemuller/2019-https-localhost.md
How to create an HTTPS certificate for localhost domains

How to create an HTTPS certificate for localhost domains

This focuses on generating the certificates for loading local virtual hosts hosted on your computer, for development only.

Do not use self-signed certificates in production ! For online certificates, use Let's Encrypt instead (tutorial).

@gblok
gblok / parse_dotenv.bash
Created October 1, 2019 13:20 — forked from judy2k/parse_dotenv.bash
Parse a .env (dotenv) file directly using BASH
# Pass the env-vars to MYCOMMAND
eval $(egrep -v '^#' .env | xargs) MYCOMMAND
# … or ...
# Export the vars in .env into your shell:
export $(egrep -v '^#' .env | xargs)
@gblok
gblok / gist:ebd87b6a7e0d482dc218d96d4086f53c
Created August 11, 2019 12:23
js fn utils compose/pipe curry/uncarry
const compose = (...fns) => x => fns.reduceRight((g, f) => f(g), x)
const pipe = (...fns) => compose.apply(null, fns.reverse())
const composeAsync = (...fns) => x => fns.reduceRight((f, g) => f.then(g), Promise.resolve(x))
const pipeAsync = (...fns) => x => composeAsync.apply(null, fns.reverse())
const curry = (f, ...a) =>
a.length === f.length
? f(...a)
: curry.bind(null, f, ...a)
@gblok
gblok / update-version-package.sh
Created April 14, 2019 07:39 — forked from sbose78/update-version-package.sh
Pre-commit hook to update package.json
#!/bin/bash
set -e
update_version(){
if [[ "$DONT_BUMP_VERSION" -ne "1" ]]
then
echo " Bumping version.. "
else
echo "Version will not be bumped since variable DONT_BUMP_VERSION is set."
exit 0
git config --global core.autocrlf false
git config core.eol lf
git config core.autocrlf input
@gblok
gblok / fix.sh
Last active March 9, 2019 13:10 — forked from TheBeachMaster/fix.sh
Fix Docker WARNING: bridge-nf-call-iptables is disabled on Centos
sudo sysctl net.ipv4.conf.all.forwarding=1
sudo sysctl net.bridge.bridge-nf-call-iptables=1
sudo sysctl net.bridge.bridge-nf-call-ip6tables=1
//or
/sbin/sysctl -w net.ipv4.conf.all.forwarding=1
/sbin/sysctl -w net.bridge.bridge-nf-call-ip6tables=1
/sbin/sysctl -w net.bridge.bridge-nf-call-iptables=1
@gblok
gblok / vagrantfile
Created February 28, 2019 11:32 — forked from paruljain/vagrantfile
Vagrantfile for Alpine Linux with docker
Vagrant.configure("2") do |config|
config.vm.box = "maier/alpine-3.3.1-x86_64"
config.vm.network "public_network", ip: "192.168.1.31", auto_config: true
config.vm.synced_folder ".", "/vagrant", disabled: true
config.vm.provider "virtualbox" do |vb|
vb.name = 'Alpine1'
vb.cpus = 1
vb.memory = 1024
#vb.customize ["modifyvm", :id, "--natdnshostresolver1", "on"]
# Display the VirtualBox GUI when booting the machine