-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpwdgen
More file actions
executable file
·44 lines (38 loc) · 1.66 KB
/
pwdgen
File metadata and controls
executable file
·44 lines (38 loc) · 1.66 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#!/usr/bin/env bash
#
# ############################################################################
# Project: scripts (none)
# File...: pwdgen
# Created: Tuesday, 2020/02/18-20:44:58
# Author.: @fbnmtz, (fabiano.matoz@gmail.com)
# ~·~·~·~·~·~·~·~·~·~·~·~·~~·~·~·~·~·~·~·~·~·~·~·~·~~·~·~·~·~·~~·~·~·~·~·~·~·~
# Last Modified: Monday, 2024/12/09 - 17:40:54
# Modified By..: @fbnmtz, (fabiano.matoz@gmail.com)
# ~·~·~·~·~·~·~·~·~·~·~·~·~~·~·~·~·~·~·~·~·~·~·~·~·~~·~·~·~·~·~~·~·~·~·~·~·~·~
# Version: 1.0.0.35
# ~·~·~·~·~·~·~·~·~·~·~·~·~~·~·~·~·~·~·~·~·~·~·~·~·~~·~·~·~·~·~~·~·~·~·~·~·~·~
# Description:
# >
# you can use openssl, gpg, apg, /dev/urandom
# gpg --gen-random --armor 1 6
# < /dev/urandom tr -dc A-Za-z0-9 | head -c14; echo
# cat /dev/urandom | tr -dc 'a-zA-Z0-9[$-:-?{-~!^_`\[\]]' | fold -w $x | head -n 1
# cat /dev/urandom | tr -dc 'a-zA-Z0-9*@$.' | fold -w $size | head -n 1
# < /dev/urandom tr -dc 'a-zA-Z0-9*@$.' | fold -w 14; echo
# ############################################################################
# HISTORY:
#
# ~·~·~·~·~·~·~·~·~·~·~·~·~~·~·~·~·~·~·~·~·~·~·~·~·~~·~·~·~·~·~
# shellcheck disable=SC1090,SC2154
# ~·~·~·~·~·~·~·~·~·~·~·~·~~·~·~·~·~·~·~·~·~·~·~·~·~~·~·~·~·~·~
source "$xSHELL_INIT"
use args
xrequirements xclip-cmd openssl
xarg --id -s,--size --var size+r --desc "size of new password"
xrun --xversionrc --xcolors "$@"
DEFAULT_SIZE=6
gerenare_password(){
openssl rand --base64 $1
}
[ -z "$size" ] && size=${DEFAULT_SIZE}
gerenare_password $size | xclip-cmd