Skip to content

Instantly share code, notes, and snippets.

View garettmd's full-sized avatar
🌩️
Cloudy with a chance of automation 🤖

Garett Dunn garettmd

🌩️
Cloudy with a chance of automation 🤖
View GitHub Profile
@garettmd
garettmd / web-servers.md
Created May 13, 2021 14:29 — 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
@garettmd
garettmd / script-template.sh
Created December 15, 2020 18:27 — forked from m-radzikowski/script-template.sh
Minimal safe Bash script template - see the article with full description: https://betterdev.blog/minimal-safe-bash-script-template/
#!/usr/bin/env bash
set -Eeuo pipefail
trap cleanup SIGINT SIGTERM ERR EXIT
script_dir=$(cd "$(dirname "${BASH_SOURCE[0]}")" &>/dev/null && pwd -P)
usage() {
cat <<EOF
Usage: $(basename "${BASH_SOURCE[0]}") [-h] [-v] [-f] -p param_value arg1 [arg2...]
@garettmd
garettmd / extract_tf_vars.py
Last active September 19, 2019 19:45
Extract variable definitions from your Terraform configuration. Especially useful when writing modules.
#!/usr/bin/env python
from __future__ import print_function, with_statement
import os
import re
def main(args):
curdir = os.getcwd()
// create a bookmark and use this code as the URL, you can now toggle the css on/off
// thanks+credit: https://dev.to/gajus/my-favorite-css-hack-32g3
javascript: (function() {
var styleEl = document.getElementById('css-layout-hack');
if (styleEl) {
styleEl.remove();
return;
}
styleEl = document.createElement('style');
styleEl.id = 'css-layout-hack';
@garettmd
garettmd / crash.log
Created July 31, 2019 19:43
azurerm_lb crash log
This file has been truncated, but you can view the full file.
2019/07/31 15:39:27 [INFO] Terraform version: 0.12.5
2019/07/31 15:39:27 [INFO] Go runtime version: go1.12.4
2019/07/31 15:39:27 [INFO] CLI args: []string{"/usr/local/bin/terraform", "apply"}
2019/07/31 15:39:27 [DEBUG] Attempting to open CLI config file: /Users/garettdunn/.terraformrc
2019/07/31 15:39:27 [DEBUG] File doesn't exist, but doesn't need to. Ignoring.
2019/07/31 15:39:27 [INFO] CLI command args: []string{"apply"}
2019/07/31 15:39:27 [TRACE] Meta.Backend: no config given or present on disk, so returning nil config
2019/07/31 15:39:27 [TRACE] Meta.Backend: backend has not previously been initialized in this working directory
2019/07/31 15:39:27 [DEBUG] New state was assigned lineage "266ab41f-7602-5b20-78b0-9ea039804bf9"
2019/07/31 15:39:27 [TRACE] Meta.Backend: using default local state only (no backend configuration, and no existing initialized backend)
This file has been truncated, but you can view the full file.
2019/07/31 15:39:27 [INFO] Terraform version: 0.12.5
2019/07/31 15:39:27 [INFO] Go runtime version: go1.12.4
2019/07/31 15:39:27 [INFO] CLI args: []string{"/usr/local/bin/terraform", "apply"}
2019/07/31 15:39:27 [DEBUG] Attempting to open CLI config file: /Users/garettdunn/.terraformrc
2019/07/31 15:39:27 [DEBUG] File doesn't exist, but doesn't need to. Ignoring.
2019/07/31 15:39:27 [INFO] CLI command args: []string{"apply"}
2019/07/31 15:39:27 [DEBUG] New state was assigned lineage "266ab41f-7602-5b20-78b0-9ea039804bf9"
2019/07/31 15:39:27 [DEBUG] checking for provider in "."
2019/07/31 15:39:27 [DEBUG] checking for provider in "/usr/local/bin"
2019/07/31 15:39:27 [DEBUG] checking for provider in ".terraform/plugins/darwin_amd64"
@garettmd
garettmd / clean_merged
Last active February 1, 2019 15:37
Clean up merged git branches in a project directory (use show_clean function first to see what will be removed)
function clean_merged() {
if [[ -z $1 ]]
then
BRANCH=master
else
BRANCH="$1"
fi
git branch --merged "${BRANCH}" | grep -Ev "${BRANCH}|master" | xargs -n 1 git branch -d
}
@garettmd
garettmd / show_merged
Created February 1, 2019 15:36
Show merged git branches in a project directory
function show_merged() {
if [[ -z $1 ]]
then
BRANCH=master
else
BRANCH="$1"
fi
git branch --merged "${BRANCH}" | grep -Ev "${BRANCH}|master"
}
@garettmd
garettmd / html-languages.txt
Created October 9, 2018 14:50 — forked from JamieMason/html-languages.txt
HTML lang attribute / ISO language code reference / Culture names
CULTURE SPEC.CULTURE ENGLISH NAME
--------------------------------------------------------------
Invariant Language (Invariant Country)
af af-ZA Afrikaans
af-ZA af-ZA Afrikaans (South Africa)
ar ar-SA Arabic
ar-AE ar-AE Arabic (U.A.E.)
ar-BH ar-BH Arabic (Bahrain)
ar-DZ ar-DZ Arabic (Algeria)
ar-EG ar-EG Arabic (Egypt)
### Keybase proof
I hereby claim:
* I am garettmd on github.
* I am garettmd (https://keybase.io/garettmd) on keybase.
* I have a public key ASARwgfAFhLVxCZqQYshTfVhrJDJaULuPqDDBoPLEYZJjgo
To claim this, I am signing this object: