Skip to content

Instantly share code, notes, and snippets.

@gblok
gblok / USING-VAULT.md
Created September 16, 2018 18:38 — forked from voxxit/USING-VAULT.md
Consul + Vault + MySQL = <3
git clone https://gist.github.com/dd6f95398c1bdc9f1038.git vault
cd vault
docker-compose up -d
export VAULT_ADDR=http://192.168.99.100:8200

Initializing a vault:

vault init
# this is a bag of functions sourced by another script
if [[ $BASH_VERSINFO -lt "4" ]]; then
echo "!! Your system Bash is out of date: $BASH_VERSION"
echo "!! Please upgrade to Bash 4 or greater."
exit 2
fi
if [[ $EUID -ne 0 ]]; then
echo "!! This script must be run as root"
@gblok
gblok / nomad-install.sh
Created September 9, 2018 12:40 — forked from ryanpadilha/nomad-install.sh
HashiCorp Nomad installation on Linux x64
#!/bin/bash
#
# Installation of Hashicorp Nomad for deploy process
#
# Download this file:
# curl -sSL https://gist.githubusercontent.com/ryanpadilha/351a4a4f17afdc8eb0d963897b98122a/raw/ -o nomad-install.sh
#
echo "Initializing script for devops - Nomad Hashicorp"
@gblok
gblok / convert id_rsa to pem
Created August 31, 2018 18:38 — forked from mingfang/convert id_rsa to pem
Convert id_rsa to pem file
openssl rsa -in ~/.ssh/id_rsa -outform pem > id_rsa.pem
chmod 700 id_rsa.pem
@gblok
gblok / deployUser.md
Created August 31, 2018 11:27 — forked from learncodeacademy/deployUser.md
Adding a deploy user in Linux

(wherever it says url.com, use your server's domain or IP)

Login to new server as root, then add a deploy user

sudo useradd --create-home -s /bin/bash deploy
sudo adduser deploy sudo
sudo passwd deploy

And Update the new password

@gblok
gblok / .gitlab-ci.yml
Created August 31, 2018 10:29
GitLab CI example for Node.JS (pm2)
image: node:7.7.0
cache:
key: "$CI_PROJECT_ID"
paths:
- node_modules/
before_script:
- npm set progress=false
import Gun from 'gun/gun'
localStorage.clear()
const guid = () => [2,1,1,1,3].map(n => Array.from(Array(n), () => Math.floor((1 + Math.random()) * 0x10000).toString(16).substring(1)).join('')).join('-')
const gun = new Gun
const notes = gun.get('notes')
notes.map().on((id, name) => console.log('ls', id, name))