aliases: Add password generator "aliases"
Implemented with Bash functions, saved in ".aliases" dir, cause it all gets sourced the same (and I am lazy)
This commit is contained in:
parent
4aa7d0603d
commit
d2b7b4c0f0
1 changed files with 14 additions and 0 deletions
14
.aliases/passwords.bash
Normal file
14
.aliases/passwords.bash
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
: '
|
||||
* A file with some password-creation/management "aliases"
|
||||
'
|
||||
|
||||
_tmkpasswd() {
|
||||
[ -n "$1" ] && local passlen=$1 || local passlen=20
|
||||
echo $(cat /dev/"$2"random | strings | head -c 512 | grep -oE '[a-zA-Z0-9#@$%!]')\
|
||||
| sed 's/\s//g' | head -c $passlen
|
||||
}
|
||||
|
||||
tmkpasswd() {
|
||||
[ $(command -v wl-copy) ] && _tmkpasswd $@ | wl-copy || \
|
||||
( _tmkpasswd $@ && echo )
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue