Skip to content

Instantly share code, notes, and snippets.

@tuxfight3r
tuxfight3r / 01.bash_shortcuts_v2.md
Last active July 15, 2024 06:39
Bash keyboard shortcuts

Bash Shortcuts

visual cheetsheet

Moving

command description
ctrl + a Goto BEGINNING of command line
@strebitz
strebitz / aws-sts-functions.sh
Last active February 9, 2021 15:05
Obtain AWS STS session-tokens with BASH for multiple awscli profiles or an IAM role ARN
#!/bin/bash
# Add these functions to your bash_profile or bash_rc
# Dependencies:
# - awscli - AWS command line client
# - jq - Command-line JSON processor
function cfn-validate-template() {
for template in $@
do
@t2psyto
t2psyto / gist:f5453707d2658173715f49293d096fe5
Created July 14, 2017 04:15
powershell oneliner for encode/decode base64 to file
# encode from binary file to base64txt
powershell -C "& {$outpath = (Join-Path (pwd) 'out_base64.txt'); $inpath = (Join-Path (pwd) 'data.jpg'); [IO.File]::WriteAllText($outpath, ([convert]::ToBase64String(([IO.File]::ReadAllBytes($inpath)))))}"
# decode from base64txt to binary file
powershell -C "& {$outpath = (Join-Path (pwd) 'outdata2.jpg'); $inpath = (Join-Path (pwd) 'out_base64.txt'); [IO.File]::WriteAllBytes($outpath, ([convert]::FromBase64String(([IO.File]::ReadAllText($inpath)))))}"
@mohanpedala
mohanpedala / bash_strict_mode.md
Last active July 17, 2024 18:10
set -e, -u, -o, -x pipefail explanation