Skip to content

Instantly share code, notes, and snippets.

View gesellix's full-sized avatar
🐱
🐋

Tobias Gesellchen gesellix

🐱
🐋
View GitHub Profile
@gesellix
gesellix / create-certs.sh
Last active December 18, 2023 12:22
add TLS/self-signed certificates to the Docker for Mac daemon
#!/bin/sh
mkdir -p certs
openssl req -x509 -days 365 -newkey rsa:4096 -nodes -sha256 -out certs/domain.crt -keyout certs/domain.key -subj "/C=DE/ST=Berlin/L=Berlin/O=IT/CN=docker.local"
@gesellix
gesellix / screen-stuff.md
Created May 1, 2016 22:39
screen and Docker for Mac
screen ~/Library/Containers/com.docker.docker/Data/com.docker.driver.amd64-linux/tty



screen -AmdS docker ~/Library/Containers/com.docker.docker/Data/com.docker.driver.amd64-linux/tty
screen -r docker
# enter, then disconnect with Ctrl-a d
screen -S docker -p 0 -X stuff $(printf root\\r\\n)
screen -r docker
@gesellix
gesellix / add-custom-certificate.sh
Created August 6, 2016 20:41 — forked from markthebault/add-custom-certificate.sh
inject custom certificate to docker-for-mac beta (1.12.0-rc4-beta20 build:10404)
#!/bin/bash
if [ "$#" -ne 2 ] || ! [ -d "$1" ]; then
echo "Usage: $0 /Path/To/Certificate CERT_NAME" >&2
exit 1
fi
# This assumes the cert is in the same directory as the script
source="$( cd $1 && pwd )"
# ca-certificate of the VM

macOS 10.12 Sierra Setup

Custom recipe to get macOS 10.12 Sierra running from scratch, setup applications and developer environment. This is very similar (and currently mostly the same) as my 10.11 El Capitan setup recipe and 10.10 Yosemite setup recipe. I am currently tweaking this for 10.12 Sierra and expect to refine this gist over the next few weeks.

I use this gist to keep track of the important software and steps required to have a functioning system after a semi-annual fresh install. I generally reinstall each computer from scratch every 6 months, and I do not perform upgrades between releases.

This keeps the system performing at top speeds, clean of trojans, spyware, and ensures that I maintain good organizational practices for my content and backups. I highly recommend this.

You are encouraged to fork this and modify it to your heart's content to match your o

@gesellix
gesellix / web-servers.md
Created January 3, 2017 22:50 — forked from willurd/web-servers.md
Big list of http static server one-liners

Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.

Discussion on reddit.

Python 2.x

$ python -m SimpleHTTPServer 8000
@gesellix
gesellix / docker-swarm-ports.md
Created April 3, 2017 18:49 — 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, 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 communications
  • TCP and UDP port 7946 for communication among nodes
  • TCP and UDP port 4789 for overlay network traffic

AWS Security Group Example

AWS Tip: You should use Security Groups in AWS's "source" field rather then subnets, so SG's will all dynamically update when new nodes are added.

@gesellix
gesellix / screen-docker-for-mac.sh
Created April 3, 2017 18:54 — forked from BretFisher/docker-for-mac.md
Screen Commands for Docker for Mac (prevent garbled text on reconnect)
# connect to tty on Docker for Mac VM
screen ~/Library/Containers/com.docker.docker/Data/com.docker.driver.amd64-linux/tty
# disconnect that session but leave it open in background
Ctrl-a d
# list that session that's still running in background
screen -ls
# reconnect to that session (don't open a new one, that won't work and 2nd tty will give you garbled screen)
@gesellix
gesellix / .tmux.conf
Created April 3, 2017 18:57 — forked from BretFisher/.tmux.conf
My ugly tmux config, much copied from others and tweaked
# tmux config for ultimate winning
# make tmux display things in 256 colors
#set -g default-terminal "screen-256color"
# use this if italic enabled in term profile
set -g default-terminal "tmux-256color"
# set just true color without custom term
#set -ga terminal-overrides ",xterm-256color:Tc"
# fixes bug: https://github.com/tmux/tmux/issues/435
#set -ga terminal-overrides ',xterm*:sitm=\E[3m'
@gesellix
gesellix / headless.md
Created April 14, 2017 15:54 — forked from addyosmani/headless.md
So, you want to run Chrome headless.

Update

If you're looking at this in 2016 and beyond, I strongly recommend investigating real headless Chrome: https://chromium.googlesource.com/chromium/src/+/lkgr/headless/README.md

Windows and Mac users might find using Justin Ribeiro's Docker setup useful here while full support for these platforms is being worked out.

You can use chrome --headless on Linux as of M57 but note you'll need to build the binaries yourself for now.

The metabug for adding headless mode to Chromium is over here.

@gesellix
gesellix / docker-compose-tick.yml
Created June 27, 2017 20:57 — forked from cdelaitre/docker-compose-tick.yml
Monitor Docker Swarm with TICK InfluxData Stack
version: '3'
services:
# FRONT
chronograf:
# Full tag list: https://hub.docker.com/r/library/chronograf/tags/
image: chronograf
deploy:
replicas: 1
placement:
constraints: