Skip to content

Instantly share code, notes, and snippets.

View mateothegreat's full-sized avatar
🤘
it ain't easy.

Matthew Davis mateothegreat

🤘
it ain't easy.
View GitHub Profile
@mateothegreat
mateothegreat / generate_docker_cert.sh
Created November 23, 2017 15:01 — forked from bradrydzewski/generate_docker_cert.sh
Generate trusted CA certificates for running Docker with HTTPS
#!/bin/bash
#
# Generates client and server certificates used to enable HTTPS
# remote authentication to a Docker daemon.
#
# See http://docs.docker.com/articles/https/
#
# To start the Docker Daemon:
#
# sudo docker -d \
@mateothegreat
mateothegreat / keybase.md
Created November 28, 2017 18:12
keybase.md

Keybase proof

I hereby claim:

  • I am mateothegreat on github.
  • I am appsoa (https://keybase.io/appsoa) on keybase.
  • I have a public key whose fingerprint is 7AD6 F183 43CD 0F03 DEEF 0A84 ACAB 1382 CA33 764C

To claim this, I am signing this object:

@mateothegreat
mateothegreat / tmux_ubuntu.sh
Created February 21, 2018 09:18
Install tmux 2.x on Ubuntu
sudo add-apt-repository ppa:pi-rho/dev
sudo apt-get update
sudo apt-get install tmux-next
@mateothegreat
mateothegreat / kube-apiserver.log.sh
Created February 21, 2018 10:29
Kubernetes: Get API Server Logs
kubectl proxy
curl -s http://localhost:8001/logs/kube-apiserver.log > apiserverlogs
curl https://api.github.com/users/[username]/repos | jq .[].clone_url | xargs -n 1 git clone
@mateothegreat
mateothegreat / ultimate-ut-cheat-sheet.md
Created March 14, 2018 06:34 — forked from yoavniran/ultimate-ut-cheat-sheet.md
The Ultimate Unit Testing Cheat-sheet For Mocha, Chai and Sinon

The Ultimate Unit Testing Cheat-sheet

For Mocha, Chai and Sinon

using mocha/chai/sinon for node.js unit-tests? check out my utility: mocha-stirrer to easily reuse test components and mock require dependencies


@mateothegreat
mateothegreat / generate_certs.sh
Last active April 9, 2018 22:32
Secure Docker Daemon with TLS
openssl genrsa -out ca-key.pem 4096
openssl req -x509 -new -nodes -key ca-key.pem -days 10000 -out ca.pem -subj '/CN=docker-CA'
openssl genrsa -out key.pem 4096
openssl req -new -key key.pem -out cert.csr -subj '/CN=docker-client' -config openssl.cnf
openssl x509 -req -in cert.csr -CA ca.pem -CAkey ca-key.pem -CAcreateserial -out cert.pem -days 365 -extensions v3_req -extfile openssl.cnf
@mateothegreat
mateothegreat / haproxy.cfg
Created May 21, 2018 10:25
Rate Limiting with HAproxy
[root@ip-172-31-20-63 centos]# cat /etc/haproxy/haproxy.cfg
defaults
option http-server-close
mode http
timeout http-request 5s
timeout connect 5s
timeout server 10s
timeout client 30s
@mateothegreat
mateothegreat / Jenkinsfile
Created June 5, 2018 05:48
Jenkins pipeline with k8/docker support
pipeline {
agent any
options {
disableConcurrentBuilds()
buildDiscarder(logRotator(numToKeepStr: '1'))
}