Skip to content

Instantly share code, notes, and snippets.

@mbartsch
mbartsch / ArchLinuxIpv6Docker.md
Last active December 30, 2021 20:41
Docker + IPv6 + ip6tables + dhcpcd

This is how I manage docker with ipv6 and dhcp-pd in arch linux

/etc/dhcpcd.conf

  duid
  persistent
  option rapid_commit
  option classless_static_routes
  option ntp_servers
@hellt
hellt / tkng_prereq_ubuntu20.4.sh
Created December 24, 2020 20:49
tkng lab bootstrap script
#!/bin/bash
#####
#
# This bash script installs latest docker-ce, kubectl and helm software on Ubuntu 20.4 Linux AMD64
#
#####
TMP_DIR="$(mktemp -d)"
########################
@archagon
archagon / playlist-to-podcast.py
Created September 28, 2012 07:03
A script that downloads videos from YouTube playlists, extracts their audio, and only downloads missing files each time it's run. Also generates an iTunes-compliant podcast xml file for private hosting purposes. Requires youtube-dl, ffmpeg, and ffprobe.
# YouTube playlist audio retreiver and iTunes-compliant podcast XML generation tool.
# This script will download each video file from the specified YouTube playlist, losslessly extract
# the audio, delete the video, and ultimately produce an iTunes-compliant podcast XML with the
# appropriate metadata, including chapter markers (if provided in the description). If you run the
# script again, only videos that haven't already been converted will be downloaded, allowing you to
# schedule the script to run as often as needed without stressing your internet connection or
# hard drive space. After generating the files and xml, you can easily host them on a local server
# in order to use them with iTunes or your favorite podcast aggregator -- but that's beyond this
# script's jurisdiction.
@oofnikj
oofnikj / awsp.bash
Created July 3, 2020 20:15
awsp: AWS profile switcher
### This file is intended to be sourced from ~/.bashrc ###
# quickly switch between AWS profiles with auto-completion
# uses https://github.com/Nike-Inc/gimme-aws-creds to obtain credentials
# if using static credentials, just comment out lines 13-15
awsp() {
if [[ -n $1 ]] ; then
# validate input
grep -q -w "\[profile ${1}\]" ~/.aws/config || { echo "No such profile $1"; return 1; }
  1. Humans build and fix systems.
  2. Humans get tired and stressed, they feel happy and sad.
  3. Systems don't have feelings yet. They only have SLAs.
  4. Humans need to switch off and on again.
  5. The wellbeing of human operators impacts the reliability of systems.
  6. Alert Fatigue == Human Fatigue
  7. Automate as much as possible, escalate to a human as a last resort.
  8. Document everything. Train everyone. Save time.
  9. Kill the shame game.
  10. Human issues are system issues.
@sethwebster
sethwebster / README.md
Last active April 12, 2023 19:06
Make Docker Cache Gem Installs to speed up Bundle Install

Gem Install Dockerfile Hack

If you're hacking on your Gemfile and using Docker, you know the pain of having the bundle install command run after you've added or removed a gem. Using docker-compose you could mount a volume and stage your gems there, but this adds additional complexity and doesn't always really solve the problem.

Enter this imperfect solution:

What if we installed every gem into it's own Docker layer which would be happily cached for us?

gem-inject-docker does just that. It takes the list of gems used by your app via bundle list and transforms it into a list of RUN gem install <your gem> -v <gem version> statements and injects them into the Dockerfile at a point of your choosing.

@petethepig
petethepig / 0-screenshot.md
Last active August 7, 2023 05:40
Send AWS EC2 maintenance notification to Slack

Screenshot

@lewisd32
lewisd32 / iptableflip.sh
Created April 15, 2015 18:20
Snippet of Unbounce script for restarting HAProxy with zero downtime
echo "Flipping tables! (╯°□°)╯︵ ┻━┻"
num_rules=3
real=3 # exposed to the ELB as port 443
test=4 # used to install test certs for domain verification
health=5 # used by the ELB healthcheck
blue_prefix=855
green_prefix=866
@axdotl
axdotl / keycloak-export-import-k8s.md
Last active October 30, 2023 08:43
Keycloak Export in Kubernetes

Perform Keycloak Export and Import on Kubernetes

  • Setup Keycloak in non-HA mode (replica 1)
  • Disable UserFederation
  • You might have to increase the resource limits to avoid that pod beeing killed by memory or CPU limits

See Keycloak Documentation for more details.

Export