commit f3ba3f19c02f231498efa68956216b02cd8e2a93
parent 883a1c96ef91f7ebdbe1ebaf5da16f38e74502d7
Author: Alex Balgavy <a.balgavy@gmail.com>
Date: Sat, 9 Mar 2019 13:27:30 +0100
Added some aliases
This includes an otp alias that uses `oathtool` to generate OTP
passwords (like a Google Authenticator replacements).
Former-commit-id: 0e77e9d2262f15c3d10c52f3d530053cabf13eae
Diffstat:
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/shell/commonprofile b/shell/commonprofile
@@ -107,9 +107,10 @@ alias df="df -h" # Preferred 'df'
alias htop='sudo htop' # Top should launch htop with sudo
alias g='git' # Make git easier to type
alias r='source ranger' # Make Ranger easier to type and keep directory
-alias wheredef='type -a'
+alias wheredef='type -a' # Where is a function defined?
alias lsblk="lsblk -o NAME,LABEL,PARTLABEL,TYPE,FSTYPE,SIZE,MOUNTPOINT,STATE"
alias rmcolors="sed \"s,\x1B\[[0-9;]*[a-zA-Z],,g\"" # Remove ANSI color codes from text
+alias bc="bc -ql" # Preferred 'bc' implementation
# }}}
# Aliases (Mac UI) {{{
@@ -143,8 +144,9 @@ procinfo() { ps aux | grep "$1"; } # Ge
rmempty() { find "${1-.}" -type d -empty -depth -delete; } # Remove empty directories
todos() { if [ -z "$1" ]; then 1="."; fi; grep -rnw "$1" -e "TODO"; } # Find TODO comments
find_in_files() { grep -rnw "$1" -e "$2"; } # Search for text in files
-hr() { for ((i=0; i<$(tput cols); i++)); do echo -n "#"; done; echo; } # Insert a <hr> in the terminal
+hr() { for ((i=0; i<$(tput cols); i++)); do echo -n "#"; done; echo; } # Insert a <hr> in the terminal
vimq() { vim -v -q <($(fc -nl -1)); } # Load results of last command (often ag) in vim quickfix
+otp() { oathtool --totp --digits=6 -s '30s' -b "$1"; } # Generate OTP passwords (google authenticator alternative)
# Pip3 upgrade packages
pip3_upgrade() { pip3 list --outdated | cut -d ' ' -f1 | xargs -n1 pip3 install -U; }