Skip to content

Instantly share code, notes, and snippets.

@chattr
chattr / .bash_functions
Created April 25, 2024 10:54
Useful shell functions
# VSCode diff with ephemeral working directory and files
diffy() (
# shellcheck disable=SC2317
cleanup() {
rm -rf "${HOME}/sandbox"
}
trap cleanup EXIT
trap cleanup TERM
[ ! -d "${HOME}/sandbox" ] && mkdir "${HOME}/sandbox"
@chattr
chattr / auto_configure_aws_cli_sso_roles.sh
Last active May 8, 2024 08:35
Auto-configure AWS CLI ~/.aws/config with SSO roles
#!/usr/bin/env bash
#
# Auto-configure AWS CLI ~/.aws/config with SSO roles
#
# Heavily inspired by https://gist.github.com/lukeplausin/3cfedc29755e184ef526b504c77ffe70 👏
#
# Copy and paste "starter" config before running `aws sso login --sso-session login`:
: <<'COMMENT'
[default]