Skip to content

Instantly share code, notes, and snippets.

@lttlrck
lttlrck / bash.rc
Last active January 3, 2019 20:10
Use peco, jq and bitwarden for SSH login
# gets user name and password from bitwarden
# keeps a list of all conenctions, and presents them in peco so easy filtering
export BW_SESSION="***************************"
sss() {
cat .connections | sort | uniq > .connections_ && mv .connections_ .connections
IFS=$'\n' array=($(cat .connections | peco --print-query))
@lttlrck
lttlrck / bash.sh
Last active January 4, 2019 18:53
quick SSH using peco, remembers past connections, presents a filterable list. relies on SSH keys for auth.
sss() {
cat ~/.connections | sort | uniq > ~/.connections_ && mv ~/.connections_ ~/.connections
IFS=$'\n' array=($(cat ~/.connections | cut -d" " -f1 | peco --print-query))
r1=${array[1]}
r2=${array[2]}
addr=""