Browse Source

update bash function (del aws add totp

master
Markus Bergholz 1 year ago
parent
commit
85af09dec6
1 changed files with 4 additions and 18 deletions
  1. +4
    -18
      bash/function.bashrc

+ 4
- 18
bash/function.bashrc View File

@ -55,18 +55,6 @@ function aur() {
fi
}
function awsenv() {
if (("$#" != 1)); then
cmp --silent ~/.aws/credentials ~/.aws/credentials.prod && echo "your're using PROD" || echo "you're using TEST"
elif [ "$1" = "prod" ]; then
cp ~/.aws/credentials.prod ~/.aws/credentials
elif [ "$1" = "test" ]; then
cp ~/.aws/credentials.test ~/.aws/credentials
fi
}
function redis-ping() {
# ping a redis server at any cost
redis-cli -h $1 ping 2>/dev/null || \
@ -75,12 +63,6 @@ function redis-ping() {
}
function j() {
if [ "$#" -eq 1 ]; then
docker exec -ti $(docker ps --filter "Name=$1" --format "{{.Names}}") /bin/sh
fi
}
# delete instead of rm -rf
del() {
# mv to trash
@ -92,3 +74,7 @@ del() {
find ~/.Trash -type d -empty -delete
}
totp() {
TOKEN=$(jq ".$1" -r totp.json)
oathtool -b --totp $TOKEN
}

Loading…
Cancel
Save