Skip to content

Instantly share code, notes, and snippets.

View BretFisher's full-sized avatar
🗃️
All Day Containers!

Bret Fisher BretFisher

🗃️
All Day Containers!
View GitHub Profile
@BretFisher
BretFisher / starship.toml
Created March 25, 2023 02:43
Bret's Starship TOML tweaks
# Replace the "❯" symbol in the prompt with "🥃"
[character]
success_symbol = "[🥃](bold green)"
[[battery.display]]
threshold = 75 # only show me battery status below 75%
[directory]
truncation_length = 5
truncation_symbol = '…/'
@BretFisher
BretFisher / Dockerfile
Last active January 4, 2024 10:11
Multi-stage Dockerfile example of installing dependencies with COPY --from
# any images you use later, add them here first to create aliases
# I like keeping all my versions at the top
FROM node:14.3-slim as node
FROM php:7.2.1-fpm-slim as php
FROM nginx:1.17 as nginx
# The real base image to start from
FROM ubuntu:focal-20210827 as base
# install apt stuff
@BretFisher
BretFisher / cert.sh
Created August 13, 2020 18:45
docker compose with traefik and certs
#!/usr/bin/env bash
set -euo pipefail
IFS=$'\n\t'
DOMAIN_NAME=$1
openssl req \
-newkey rsa:2048 \
-x509 \
-nodes \
@BretFisher
BretFisher / certs.sh
Last active August 13, 2020 18:29
quickly make a local tls cert
#!/usr/bin/env bash
set -euo pipefail
IFS=$'\n\t'
DOMAIN_NAME=$1
openssl req \
-newkey rsa:2048 \
-x509 \
-nodes \
@BretFisher
BretFisher / gruvbox-light.js
Last active May 17, 2020 17:31 — forked from anhari/gist:23ae031e93e2f465258439cb6802acad
gruvbox *light* blink shell theme
black = '#fbf1c7';
red = '#cc241d'; // red
green = '#98971a'; // green
yellow = '#d79921'; // yellow
blue = '#458588'; // blue
magenta = '#b16286'; // pink
cyan = '#689d6a'; // cyan
white = '#7c6f64'; // light gray
lightBlack = '#928374'; // medium gray
lightRed = '#9d0006'; // red
@BretFisher
BretFisher / halloween.md
Created October 31, 2019 20:46
Scary Course Sale for Halloween
@BretFisher
BretFisher / .zshrc
Created July 4, 2018 20:52
my custom oh-my-zsh setup
# this assumes your using oh-my-zsh for maximum zsh-ness
# info and defaults are here:
# https://github.com/robbyrussell/oh-my-zsh/blob/master/templates/zshrc.zsh-template
export LC_ALL="en_US.UTF-8"
export ZSH=/Users/bret/.oh-my-zsh
# custom prompt theme
ZSH_THEME="present" # mine is present, default is robbyrussell, also agnoster, fishy, ys, wild-cherry
COMPLETION_WAITING_DOTS="true"
@BretFisher
BretFisher / docker-alias.sh
Created April 22, 2018 04:06
Docker Alias common stuff, mostly from oh-my-zsh
dcb='docker-compose build'
dcdn='docker-compose down'
dce='docker-compose exec'
dcl='docker-compose logs'
dclf='docker-compose logs -f'
dco=docker-compose
dcps='docker-compose ps'
dcr='docker-compose run'
dcrestart='docker-compose restart'
dcrm='docker-compose rm'
@BretFisher
BretFisher / docker-for-windows.md
Last active February 1, 2024 21:57
Getting a Shell in the Docker for Windows Moby VM

2018 Update: Easiest option is Justin's repo and image

Just run this from your CLI and it'll drop you in a container with full permissions on the Moby VM. Only works for Moby Linux VM (doesn't work for Windows Containers). Note this also works on Docker for Mac.

docker run -it --rm --privileged --pid=host justincormack/nsenter1

more info: https://github.com/justincormack/nsenter1

@BretFisher
BretFisher / swarm-upgrade.md
Last active March 19, 2024 09:37
docker swarm upgrade

Replace your Swarm Manager and Workers with updated versions of docker

  • it's best to replace nodes, don't do apt/yum upgrades.
  • both would work, but VM replacment forces me to think of it as immutable and prevents making pets
  • if you don't want to update join scripts for manager IP's, then do something like Elastic IP's so manager IP's won't change.

Lets assume you have 3 managers and 3 workers on 17.06 and you want to update to 17.12

  • managers: m1, m2, m3