Skip to content

Instantly share code, notes, and snippets.

View rot26's full-sized avatar
💬
is typing...

Chris rot26

💬
is typing...
  • Colorado, United States
View GitHub Profile
@rot26
rot26 / ssh-key-fingerprint.sh
Created November 6, 2018 19:33
[SSH Fingerprint (md5)] Get the md5 fingerprint of an ssh private key #ssh #keypair
#!/bin/bash
SSH_KEY="~/.ssh/id_rsa"
ssh-keygen -l -E md5 -f "${SSH_KEY}"
@rot26
rot26 / rsync-this.sh
Last active December 18, 2018 18:09
[rsync-this] rsync all files in this directory to a target host #rsync #shell #bash #ssh
#!/usr/bin/env bash
# SheBang defaults to environment's bash
# Set bash debug
if [[ "$@" == *"--debug"* ]] || [ ${BASH_DEBUG} ]; then
export BASH_DEBUG=true
set -ex
fi
# Reference Path of this script
@rot26
rot26 / grep_xlsx_files.sh
Created May 31, 2019 14:33 — forked from modille/grep_xlsx_files.sh
Recursively find and grep through multiple Excel spreadsheets
# convert *.xlsx to *.xlsx.csv using https://github.com/dilshod/xlsx2csv
pip install xlsx2csv
# (shell-fu from http://stackoverflow.com/a/12965604)
find . -iname "*.xlsx" -exec sh -c 'xlsx2csv "$1" > "$1.csv"' x {} \;
# grep .csv files
brew install ripgrep
rg -i -g "*.csv" "waldo"
# ...or plain ole grep
@rot26
rot26 / Makefile
Last active October 22, 2019 03:32
[Makefile help] self-documenting makefile #make #documenting
## help: display this help message
# Any line prefixed with two hashes will be output on `make help`
# The colon `:` is the alignment seperator
.PHONY : help
help : Makefile
@sed -n 's/^##//p' $< | column -t -s:
@rot26
rot26 / xargs-git-status.sh
Created February 17, 2020 22:54
[xargs-git-status] using a list of directories, cd and perform operation #shell #fav #git #xargs
cat directories.txt | xargs -L 1 sh -c 'cd "$0" && pwd && git status'
@rot26
rot26 / git-default-branch
Created February 17, 2020 23:46
[git-default-branch] Determine the default branch ref of the remote #git
git symbolic-ref refs/remotes/origin/HEAD
@rot26
rot26 / keybase.md
Created May 5, 2020 04:59
keybase.md

Keybase proof

I hereby claim:

  • I am rot26 on github.
  • I am rot26 (https://keybase.io/rot26) on keybase.
  • I have a public key ASAacqKPnGSuKGtzwIoJvm3nxtMBpqOJe8J8VON644J0oQo

To claim this, I am signing this object:

@rot26
rot26 / notes.sh
Last active May 14, 2020 03:52
mutli-region refactor
# Checkout
git pull
git ck -b region-forwarder
# Setup Directories
mkdir -p terraform/cwe
mkdir -p terraform/sqs_lambda
@rot26
rot26 / docker-example.sh
Last active May 21, 2020 21:45
[AWS Get Session Token Vars] Get the vars from an aws session token. #aws #cicd
docker run \
-e "AWS_SESSION_TOKEN=${session_token}" \
-e "AWS_ACCESS_KEY_ID=${access_key_id}" \
-e "AWS_SECRET_ACCESS_KEY=${secret_access_key}" \
-e "AWS_DEFAULT_REGION=us-east-1" \
-v $PWD:/usr/src/app -w /usr/src/app \
node:12 npm run cdk -- -v synth