Skip to content

Instantly share code, notes, and snippets.

@gholker
gholker / download-aws-logs.sh
Last active March 24, 2025 06:42
Script that uses the aws cli to download cloudwatch logs to a file
#!/usr/bin/env bash
set -euo pipefail
IFS=$'\n\t'
LOG_GROUP_NAME=""
LOG_STREAM_NAME=""
REGION=""
OUTPUT_FILE="$(date +"%Y%m%d").log"
@mohanpedala
mohanpedala / bash_strict_mode.md
Last active April 24, 2025 20:06
set -e, -u, -o, -x pipefail explanation
@xiongchiamiov
xiongchiamiov / why.sh
Last active March 14, 2023 04:19
Use this when Amazon gives you an "Encoded authorization failure message" and you need to turn it into something readable. If you only get a request id... you're out of luck.
function decode-authorization-failure-message {
if [ $# -ne 1 ] || [ "$1" = -h ] || [ "$1" = --help ]; then
cat <<'EOT'
Usage: decode-authorization-failure-message <message>
Use this when Amazon gives you an "Encoded authorization failure message" and
you need to turn it into something readable.
EOT
return 1
fi
@rbf
rbf / README.md
Last active November 15, 2024 10:07
Script to recursively generate PDF files from markdown files in the current directory and its subfolders using "pandoc".

%process-md % https://gist.github.com/rbf/6064734

Description

process-md is a bash tool to recursively generate files from markdown files in other formats using pandoc, which is assumed installed. By default (i.e. calling command tool with no arguments) it processes all markdown files in the current directory and places the resulting PDF files in a ./target directory.