Skip to content

Instantly share code, notes, and snippets.

@danielhanold
danielhanold / nginx-no-downtime.yaml
Created May 15, 2024 19:20
No-downtime NGINX Kubernetes deployments
apiVersion: apps/v1
kind: Deployment
metadata:
name: nginx-no-downtime
spec:
replicas: 1
selector:
matchLabels:
app: nginx-no-downtime
strategy:
@danielhanold
danielhanold / svn2git_improved.sh
Created February 24, 2020 15:20
Convert SVN repos to Git and upload to GitHub
#! /bin/bash
# Determine target directory.
TARGET_DIR=$1
# Determine if this is the final processing, i.e. create all Git branches,
# tags, and garbage-collect.
PROCESS_MODE=${2:-FETCH_ONLY}
# Determine default domain for unmapped authors.
#! /bin/bash
# See https://stackoverflow.com/questions/36495669/difference-between-terms-option-argument-and-parameter
# for the difference between:
# 1. Option
# 2. Parameter
# 3. Shell Parameter
# Test script to show how named arguments can be passed directly in a shell script.
# Uses a combination of while, case, and the the number of arguments defined in $#.
@danielhanold
danielhanold / minikube-update-hosts.sh
Last active April 26, 2019 21:18
Bash script to update local hosts file with Minikube ingresses
#!/bin/bash
#
# A script to update your /etc/hosts file from minikube ingest records.
#
# Installation
# ------------
# curl -L https://gist.github.com/danielhanold/e7f753740e397e9e7b8a8729f4ced3f0/raw/minikube-update-hosts.sh > /usr/local/bin/minikube-update-hosts
# chmod +x /usr/local/bin/minikube-update-hosts
INGRESSES=$(kubectl --context=minikube --all-namespaces=true get ingress | grep -v NAMESPACE | awk '{ print $2 }' | awk '{ print $1".local"}' | tr '\r\n' ' ')
{
"title": "Tapping modifier-keys produces a f-key.",
"rules": [
{
"description": "Press left_shift alone produces F6",
"manipulators": [
{
"type": "basic",
"from": {
"key_code": "left_shift",
@danielhanold
danielhanold / dkc-batch.sh
Last active May 26, 2024 11:07
Run multiple docker-compose files at once
#!/bin/bash
# @file
# If an application is comprised of multiple docker-compose.yml files, this file
# allows you to execute docker-compose commands for all files in a batch.
# For this to work, place this file into a directory and place each
# docker-compose environment in a subdirectory.
#
# Example:
# /maindir