From 7df5e5e9041c11c18d5bd54983a9c21a3864fadb Mon Sep 17 00:00:00 2001 From: Hsieh Chin Fan Date: Wed, 30 Oct 2024 15:36:05 +0800 Subject: Update --- alias | 2 +- misc/otp | 12 ++++++++++++ profile.sh | 2 +- 3 files changed, 14 insertions(+), 2 deletions(-) create mode 100755 misc/otp diff --git a/alias b/alias index 7b1825f..05e979f 100644 --- a/alias +++ b/alias @@ -519,7 +519,7 @@ alias pe='pass edit' alias pgn='pass generate --in-place --clip' alias pgc='pass generate --clip' words() { - cat /usr/share/dict/usa | egrep "^[a-z]{4,8}$" | shuf | head -40 | xargs -n${1:-2} + cat /usr/share/dict/usa | grep -E "^[a-z]{4,8}$" | shuf | head -40 | xargs -n${1:-2} } # Nginx diff --git a/misc/otp b/misc/otp new file mode 100755 index 0000000..ccdc1f3 --- /dev/null +++ b/misc/otp @@ -0,0 +1,12 @@ +#! /usr/bin/bash + +echo -n "OTP: " +read -r otp + +if grep "^$otp$" /home/pham/.otp; then + TEMP=`mktemp` + sed "/^$otp$/ d" /home/pham/.otp >$TEMP + cat $TEMP > /home/pham/.otp + rm $TEMP + su pham +fi diff --git a/profile.sh b/profile.sh index b426e95..e689376 100755 --- a/profile.sh +++ b/profile.sh @@ -76,6 +76,6 @@ fi # Working DIR # [[ `pwd` == $HOME ]] && test -d ~/Downloads && cd ~/Downloads cd ~/git/dumbymap 2>/dev/null || cd ~/Downloads -source ~/.profile +source ~/.profile 2>/dev/null true -- cgit v1.2.3-70-g09d2