Skip to content

Instantly share code, notes, and snippets.

View danehans's full-sized avatar

Daneyon Hansen danehans

View GitHub Profile
@danehans
danehans / README.md
Created April 1, 2016 23:43 — forked from justenwalker/README.md
Ansible Dynamic Inventory script for etcd

etcd dynamic inventory script

Generarates inventory for ansible from etcd using python-etcd library.

The script assumes etcd.ini to be present alongside it. To choose a different path, set the ETCD_INI_PATH environment variable:

export ETCD_INI_PATH=/path/to/etcd.ini
@danehans
danehans / haproxy.yml
Created April 11, 2016 18:48
haproxy kube ha
apiVersion: v1
kind: Pod
metadata:
name: haproxy
spec:
hostNetwork: true
containers:
- name: haproxy
image: docker pull million12/haproxy:1.6.3 # From https://hub.docker.com/r/million12/haproxy/
ports:
@danehans
danehans / build_magnum
Last active April 11, 2016 19:28
kolla_magnum
INFO:kolla.cmd.build:magnum-conductor:Successfully built 5ddf244ee692
INFO:kolla.cmd.build:magnum-conductor:Built
INFO:kolla.cmd.build:magnum-api: ---> beccf213151b
INFO:kolla.cmd.build:magnum-api:Removing intermediate container b0eae78455db
INFO:kolla.cmd.build:magnum-api:Step 4 : RUN chmod 755 /usr/local/bin/kolla_magnum_extend_start
INFO:kolla.cmd.build:magnum-api: ---> Running in 0974e7dbb72f
INFO:kolla.cmd.build:magnum-api: ---> e3977fd6f395
INFO:kolla.cmd.build:magnum-api:Removing intermediate container 0974e7dbb72f
INFO:kolla.cmd.build:magnum-api:Step 5 : USER magnum
INFO:kolla.cmd.build:magnum-api: ---> Running in 283b3f9a125a
TASK: [prechecks | Checking Docker version] ***********************************
ok: [localhost]
...
TASK: [prechecks | Checking if 'MountFlags' in /lib/systemd/system/docker.service is set to 'shared'] ***
skipping: [localhost]
TASK: [prechecks | Checking if '/run' mount flag is set to 'shared'] **********
failed: [localhost] => {"changed": false, "cmd": ["awk", "$5 == \"/run\" {print $7}", "/proc/self/mountinfo"], "delta": "0:00:00.003839", "end": "2016-04-18 17:39:34.331392", "failed": true, "failed_when_result": true, "rc": 0, "start": "2016-04-18 17:39:34.327553", "stdout_lines": ["-"], "warnings": []}
stdout: -
@danehans
danehans / failed_run
Last active April 18, 2016 18:42
kolla_deploy
TASK: [prechecks | Checking if '/run' mount flag is set to 'shared'] **********
failed: [localhost] => {"changed": false, "cmd": ["awk", "$5 == \"/run\" {print $7}", "/proc/self/mountinfo"], "delta": "0:00:00.004519", "end": "2016-04-18 18:14:39.523014", "failed": true, "failed_when_result": true, "rc": 0, "start": "2016-04-18 18:14:39.518495", "stdout_lines": ["-"], "warnings": []}
stdout: -
FATAL: all hosts have already failed -- aborting
PLAY RECAP ********************************************************************
to retry, use: --limit @/root/prechecks.retry
localhost : ok=59 changed=0 unreachable=0 failed=1

Ultimate Go Training

Day 1 -- Primer and Introduction

Some Key Thoughts on Go

WYSIWYG. Convention over configuration. Productivity > Performance Know how much your code costs. No hidden overloads, overhead, etc.

@danehans
danehans / golang-tls.md
Created August 3, 2016 22:21 — forked from denji/golang-tls.md
Simple Golang HTTPS/TLS Examples
Generate private key (.key)
# Key considerations for algorithm "RSA" ≥ 2048-bit
openssl genrsa -out server.key 2048
    
# Key considerations for algorithm "ECDSA" ≥ secp384r1
# List ECDSA the supported curves (openssl ecparam -list_curves)
openssl ecparam -genkey -name secp384r1 -out server.key
@danehans
danehans / Steps
Last active December 16, 2016 13:11
vagrant_vbox_kubeadm
# Install Vagrant on your Mac: https://www.vagrantup.com/
# Here is the version I use
$ vagrant --version
Vagrant 1.8.1
# Virtualbox (vbox) is the default Vagrant provider, so it should be installed with Vagrant.
# I use vbox v5.0.16. If you need to install vbox, follow these directions: https://www.virtualbox.org/
# Copy the Vagrant file in this gist to your laptop.
@danehans
danehans / 20-bond0.netdev
Created December 7, 2016 21:12
coreos-k8s
[NetDev]
Name=bond0
Kind=bond
[Bond]
Mode=802.3ad
TransmitHashPolicy=layer2
MIIMonitorSec=1
LACPTransmitRate=fast
@danehans
danehans / bootcfg.service
Last active January 10, 2017 18:34
coreos-bm setup
$ systemctl cat dnsmasq
# /etc/systemd/system/bootcfg.service
[Unit]
Description=coreos-baremetal project
After=docker.service
Requires=docker.service
[Service]
Restart=always
TimeoutStartSec=0