Skip to content
Permalink
Browse files

Added oath-toolkit and otp function

  • Loading branch information...
eko committed Feb 28, 2019
1 parent 1d8c54e commit 7e90b1dff49a88978438914964a1b76dc3baa3df
Showing with 22 additions and 0 deletions.
  1. +1 −0 .brew
  2. BIN .encrypted/.otpkeys
  3. +20 −0 .functions
  4. +1 −0 Makefile
1 .brew
@@ -23,6 +23,7 @@ brew install ffmpeg
brew install fzf
brew install rs/tap/jaggr
brew install rs/tap/jplot
brew install oath-toolkit
brew install prettyping
brew install ncdu
brew install tmux
BIN +620 Bytes .encrypted/.otpkeys
Binary file not shown.
@@ -279,6 +279,26 @@ function loc() {
echo "${fg[white]}Total${reset_color} lines of code: ${fg[yellow]}$total${reset_color}"
}

function otp() {
if [ -z $1 ]; then
echo
echo "Usage:"
echo " otp google"
echo
echo "Configuration: $HOME/.otpkeys"
echo "Format: name=key"
return 1;
fi

OTPKEY=$(sed -n "s/${1}=//p" ~/.otpkeys)
if [ -z $OTPKEY ]; then
echo "$(basename $0): Unknown service name '$1'"
return 1;
fi

oathtool --totp -b $OTPKEY
}

# Uploads a file to transfer.sh and returns the public URL
# Usage: transfer <file>
function transfer() {
@@ -20,6 +20,7 @@ install: ## Installs dotfiles into current environment

install-encrypted: ## Installs encrypted dotfiles into current environment
@$(MAKE) DOTFILE=.ssh/config install_encrypted_file
@$(MAKE) DOTFILE=.otpkeys install_encrypted_file

install_file:
@if [ ! -f ${HOME}/${DOTFILE} ]; then \

0 comments on commit 7e90b1d

Please sign in to comment.
You can’t perform that action at this time.