Skip to content

Instantly share code, notes, and snippets.

View dholdaway's full-sized avatar

Darren Holdaway dholdaway

View GitHub Profile
@dholdaway
dholdaway / README.md
Created November 29, 2017 09:50 — forked from jxson/README.md
README.md template

Synopsis

At the top of the file there should be a short introduction and/ or overview that explains what the project is. This description should match descriptions added for package managers (Gemspec, package.json, etc.)

Code Example

Show what the library does as concisely as possible, developers should be able to figure out how your project solves their problem by looking at the code example. Make sure the API you are showing off is obvious, and that your code is short and concise.

Motivation

Keybase proof

I hereby claim:

  • I am dholdaway on github.
  • I am dfad3r (https://keybase.io/dfad3r) on keybase.
  • I have a public key ASB_p0-J-vdXVm64YbV11kYad5yJKYEpcnY6fpTUuxs5VAo

To claim this, I am signing this object:

@dholdaway
dholdaway / instal_caffe_cpu.sh
Created March 23, 2018 15:02 — forked from rizky/instal_caffe_cpu.sh
Setup Caffe CPU Only in MacOS Sierra
#!/bin/sh
# Install brew
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
# Install the experimental NVIDIA Mac drivers
# Download from http://www.nvidia.com/download/driverResults.aspx/103826/en-us
# Install cuDNN v5 for 8.0 RC or use the latest when it's available
# Register and download from https://developer.nvidia.com/rdp/cudnn-download
# or this path: https://developer.nvidia.com/rdp/assets/cudnn-8.0-osx-x64-v5.0-ga-tgz
# extract to the NVIDIA CUDA folder and perform necessary linking
@dholdaway
dholdaway / instal_caffe_cpu.sh
Created March 23, 2018 15:02 — forked from rizky/instal_caffe_cpu.sh
Setup Caffe CPU Only in MacOS Sierra
#!/bin/sh
# Install brew
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
# Install the experimental NVIDIA Mac drivers
# Download from http://www.nvidia.com/download/driverResults.aspx/103826/en-us
# Install cuDNN v5 for 8.0 RC or use the latest when it's available
# Register and download from https://developer.nvidia.com/rdp/cudnn-download
# or this path: https://developer.nvidia.com/rdp/assets/cudnn-8.0-osx-x64-v5.0-ga-tgz
# extract to the NVIDIA CUDA folder and perform necessary linking
@dholdaway
dholdaway / lock_down_public_s3_buckets.md
Created April 7, 2018 00:03 — forked from apolloclark/lock_down_public_s3_buckets.md
Bash one-liner to find public facing AWS S3 buckets, and make them private

Command

aws s3api list-buckets --query 'Buckets[*].[Name]' --output text | xargs -I {} bash -c 'if [[ $(aws s3api get-bucket-acl --bucket {} --query '"'"'Grants[?Grantee.URI==`http://acs.amazonaws.com/groups/global/AllUsers` && Permission==`READ`]'"'"' --output text) ]]; then aws s3api put-bucket-acl --acl "private" --bucket {} ; fi'



1. List all of the user's buckets, and output the name, as text.

@dholdaway
dholdaway / build-tag-push.py
Created August 1, 2018 10:25 — forked from peatiscoding/build-tag-push.py
a script to convert your docker-compose.yml (version 2) with build node to image node; this script required DOCKERHUB_USER environment available.
#!/usr/bin/python
import os
import subprocess
import time
import yaml
import re
user_name = os.environ.get("DOCKERHUB_USER")
@dholdaway
dholdaway / docker-swarm-ports.md
Created August 9, 2018 13:51 — forked from BretFisher/docker-swarm-ports.md
Docker Swarm Port Requirements, both Swarm Mode 1.12+ and Swarm Classic, plus AWS Security Group Style Tables

Docker Swarm Mode Ports

Starting with 1.12 in July 2016, Docker Swarm Mode is a built-in solution with built-in key/value store. Easier to get started, and fewer ports to configure.

Inbound Traffic for Swarm Management

  • TCP port 2377 for cluster management & raft sync communications
  • TCP and UDP port 7946 for "control plane" gossip discovery communication between all nodes
  • UDP port 4789 for "data plane" VXLAN overlay network traffic
  • IP Protocol 50 (ESP) if you plan on using overlay network with the encryption option

AWS Security Group Example

@dholdaway
dholdaway / ssh_securitygroup.tf
Created August 30, 2018 20:50
add my ip address to AWS security group
provider "aws" {
region = "eu-west-1"
}
data "http" "ip" {
url = "http://icanhazip.com"
}
resource "aws_security_group" "ssh" {
name = "ssh"
@dholdaway
dholdaway / install_container_service.sh
Created March 21, 2019 00:40 — forked from carlosedp/install_container_service.sh
Install Container services (Docker/Kubernetes) on Debian/Ubuntu
#!/bin/bash
echo "Container Linux installation script"
echo "This will install:"
echo " - Docker Community Edition"
echo " - Docker Compose"
echo " - Kubernetes: kubeadm, kubelet and kubectl"
echo ""
set -xeo pipefail
@dholdaway
dholdaway / gist:8aacb454e6229defa8d6b7cd1e71d04a
Created March 21, 2019 00:41 — forked from carlosedp/gist:4df3cd58a489a3c4022f97a474439b90
Rock64 Install (Adjust IPs/Hostnames/DNS to your deployment)
# Rock64 Install (Adjust IPs/Hostnames/DNS to your deployment)
Disable NetworkManager and DHCP Client
sudo systemctl stop dhcpcd
sudo systemctl stop NetworkManager
sudo systemctl disable dhcpcd
sudo systemctl disable NetworkManager
sudo systemctl daemon-reload