alpha
Login
or
Join now
j3s.sh
/
dotfiles
Star
0
Fork
0
Atom
Configure Feed
Issues
Pull Requests
Commits
Tags
Feed URL
Select the types of activity you want to include in your feed.
my dotz
Star
0
Fork
0
Atom
Configure Feed
Issues
Pull Requests
Commits
Tags
Feed URL
Select the types of activity you want to include in your feed.
Overview
Issues
Pulls
Pipelines
Add pwgen
author
Jes Olson
date
4 years ago
(Jan 6, 2022, 5:28 PM -0600)
commit
636f41f3
636f41f36ab7b7eda85256d8a1fbea5e74713ba4
parent
f1884c43
f1884c43e1f111e43251eca3e6f8d5be13e26e3c
+11
1 changed file
Expand all
Collapse all
Unified
Split
bin
pwgen
+11
bin/pwgen
Reviewed
···
1
1
+
#!/bin/sh
2
2
+
#
3
3
+
# generate a password of N length
4
4
+
5
5
+
pass_length="$1"
6
6
+
7
7
+
# Regarding usage of '/dev/urandom' instead of '/dev/random'.
8
8
+
# See: https://www.2uo.de/myths-about-urandom
9
9
+
pass=$(LC_ALL=C tr -dc "_A-Z-a-z-0-9" 2> /dev/null < /dev/urandom |
10
10
+
dd ibs=1 obs=1 count="${pass_length:-50}" 2>/dev/null)
11
11
+
printf "$pass\n"