Skip to content

Instantly share code, notes, and snippets.

View fcivaner's full-sized avatar
💭
Arranging information

Fırat Civaner fcivaner

💭
Arranging information
  • Istanbul
View GitHub Profile
#!/usr/bin/env bash
# utility to confirm before executing a shell command.
# based on https://askubuntu.com/a/22257.
me=$(basename "${BASH_SOURCE[0]}")
function usage {
echo "$me: utility to confirm commands before execution."
echo ""
#!/usr/bin/env bash
# utility to edit shell commands before execution.
tmpdir=$(dirname "$(mktemp -u)")/commands/
mkdir -p "$tmpdir"
tmpfile=$(mktemp -p "$tmpdir")
if [[ $VISUAL == "" ]];
then
#!/usr/bin/env bash
# utility to clean command line history of certain records.
me=$(basename "${BASH_SOURCE[0]}")
function usage {
echo "$me: utility to clean command line history of certain records."
echo ""
echo "usage: $me REGEX_PATTERN"
#!/usr/bin/env bash
access_key_id=$(secret-tool lookup Title aws-access-key-id)
secret_access_key=$(secret-tool lookup Title aws-secret-access-key)
printf "{
\"Version\": 1,
\"AccessKeyId\": \"%s\",
\"SecretAccessKey\": \"%s\"
}" "$access_key_id" "$secret_access_key"