Skip to content

Instantly share code, notes, and snippets.

@fadeojo
fadeojo / cfn.yml
Last active September 10, 2019 14:08
Vault cloud-formation snippet
ElasticLoadBalancer:
Type: AWS::ElasticLoadBalancing::LoadBalancer
Properties:
CrossZone: "true"
Listeners:
- LoadBalancerPort: "443"
InstancePort: "8200"
Protocol: HTTPS
SSLCertificateId:
<your ssl cert arn>
@fadeojo
fadeojo / vault.sysvinit
Created July 24, 2019 13:27
vault sysvinit config
#!/bin/bash
#
# vault Manage the Vault server
#
# chkconfig: 2345 95 95
# description: Hashicorp Vault is a secrets management tool
# processname: vault
# config: /etc/vault.conf
# pidfile: /var/run/vault.pid
@fadeojo
fadeojo / create-vault-config.sh
Last active February 3, 2020 06:34
script to create vault config
#!/bin/sh -e
[ $# -lt 2 ] && echo " usage: $0 <dynamo-table> <kms-key>" && exit 1
dynamo_table=$1 && shift
kms_key=$1 && shift
echo "
ui = true
@fadeojo
fadeojo / vault-ami.json
Last active July 9, 2019 13:50
Vault AMI JSON
{
"variables": {
"aws_region": "",
"source_ami": "",
"aws_ami_name": "amazonlinux-{{timestamp}}-vault",
"vault_version": "1.1.1"
},
"builders": [
{
@fadeojo
fadeojo / difference.js
Created January 15, 2019 15:02 — forked from Yimiprod/difference.js
Deep diff between two object, using lodash
/**
* Deep diff between two object, using lodash
* @param {Object} object Object compared
* @param {Object} base Object to compare with
* @return {Object} Return a new object who represent the diff
*/
function difference(object, base) {
function changes(object, base) {
return _.transform(object, function(result, value, key) {
if (!_.isEqual(value, base[key])) {
const IntlMessageFormat = require('intl-messageformat')
function t(strings, values) {
const string = strings[0].trim()
var msg = new IntlMessageFormat(string, 'en-US')
return msg.format(values)
}
const person = 'Mike'
const age = 28
100%[======================================>] 54,918,285 42.3M/s in 1.2s
2016-03-12 16:23:41 (42.3 MB/s) - `erlang-18.2.1-nonroot.tar.bz2' saved [54918285/54918285]
5.99s$ mkdir -p ~/otp && tar -xf erlang-18.2.1-nonroot.tar.bz2 -C ~/otp/
0.00s$ mkdir -p ~/.kerl
0.01s
0.00s
0.00s$ source $HOME/otp/18.2.1/activate
elixir
Installing Elixir 1.2.2
0.14s$ wget http://s3.hex.pm/builds/elixir/v1.2.2.zip