Skip to content

Instantly share code, notes, and snippets.

Bret Fisher BretFisher

Block or report user

Report or block BretFisher

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
BretFisher / copy-paste.txt
Last active Feb 28, 2018
install docker engine for swarm3k on Ubuntu 16.04. 2 options for installing
View copy-paste.txt
#option 1: copy and paste this into ssh to install docker engine
# NOTE: update --label=owner=YOURNAME below if you want to easily identify yours
apt-key adv --keyserver hkp:// --recv-keys 58118E89F3A912897C070ADBF76221572C52609D && \
mkdir -p /etc/apt/sources.list.d && \
echo deb ubuntu-xenial main > /etc/apt/sources.list.d/docker.list && \
printf 'net.ipv4.neigh.default.gc_thresh1 = 30000\nnet.ipv4.neigh.default.gc_thresh2 = 32000\nnet.ipv4.neigh.default.gc_thresh3 = 32768' >> /etc/sysctl.conf && \
sysctl -p && \
service lxcfs stop && apt-get remove -y -q lxc-common lxcfs lxd lxd-client && \
apt-get update -q && apt-get install -y -q linux-image-extra-$(uname -r) linux-image-extra-virtual && \
BretFisher /
Last active Aug 26, 2019
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

BretFisher /
Last active May 6, 2019
Install Docker PPA on Ubuntu 16.04
# NOT FOR SHELL SCRIPT, but rather just for quick copy paste
# this is a copy-paste version with defaults of the full shell script which is below this one in gist.
apt-get -y install apt-transport-https ca-certificates curl && \
curl -fsSL | sudo apt-key add - && \
add-apt-repository "deb [arch=amd64] $(lsb_release -cs) stable" && \
service lxcfs stop && apt-get remove -y -q lxc-common lxcfs lxd lxd-client && \
apt-get update -q && \
apt-get install -y -q docker-ce && \
printf '{ "userns-remap" : "default" , "storage-driver" : "overlay2" }' > /etc/docker/daemon.json && \
BretFisher / .travis.yml
Created Feb 15, 2016
Travis-CI Docker Image Build and Push to AWS ECR
View .travis.yml
sudo: required #is required to use docker service in travis
language: php #can be any language, just php for example
- docker # required, but travis uses older version of docker :(
- echo "install nothing!" # put your normal pre-testing installs here
BretFisher / log-delete.ps1
Created Feb 11, 2016
Exchange 2013 Log Cleanup PowerShell Script
View log-delete.ps1
Set-Executionpolicy RemoteSigned
$days=10 #You can change the number of days here
$ExchangeLoggingPath="C:\Program Files\Microsoft\Exchange Server\V15\Logging\"
Function CleanLogfiles($TargetFolder)
if (Test-Path $TargetFolder) {
$Now = Get-Date
BretFisher /
Created Feb 8, 2016
Mac Update/Cleanup Script
# store the current dir
# Update App Store apps
sudo softwareupdate -i -a
# Update Homebrew (Cask) & packages
brew update
BretFisher / execstart.conf
Created Jan 27, 2016
Docker 1.9 UCP 0.6 RHEL Daemon startup
View execstart.conf
Description=Docker Application Container Engine
Documentation= docker.socket
ExecStart=/usr/bin/docker daemon -H fd:// -H unix://var/run/docker.sock --exec-opt native.cgroupdriver=cgroupfs --storage-driver=devicemapper --ip x.x.x.x
View docker-ce-pub-pgp-key
Version: SKS 1.1.5
Comment: Hostname:

Keybase proof

I hereby claim:

  • I am BretFisher on github.
  • I am bretfisher ( on keybase.
  • I have a public key whose fingerprint is 3356 2888 3C9F 74C4 8772 B7EA E698 7430 7C9B 2417

To claim this, I am signing this object:

You can’t perform that action at this time.