Source

mindref-etc / profile.d / genpasswd.sh

Full commit
1
2
3
4
5
6
7
8
9
# Strong password generator
#
# Run it: genpasswd 8 Here is output: Kh5FwyTi
#
genpasswd() {
    local l=$1
    [ "$l" == "" ] && l=20
    tr -dc A-Za-z0-9_ < /dev/urandom | head -c ${l} | xargs
}