mirror of
https://gitea.com/mcereda/oam.git
synced 2026-02-09 05:44:23 +00:00
chore(snippets): add random password generation
This commit is contained in:
2
.vscode/settings.json
vendored
2
.vscode/settings.json
vendored
@@ -214,6 +214,7 @@
|
|||||||
"pebcak",
|
"pebcak",
|
||||||
"pihole",
|
"pihole",
|
||||||
"pinentry",
|
"pinentry",
|
||||||
|
"pipx",
|
||||||
"pkexec",
|
"pkexec",
|
||||||
"polkit",
|
"polkit",
|
||||||
"portsnap",
|
"portsnap",
|
||||||
@@ -267,6 +268,7 @@
|
|||||||
"turris",
|
"turris",
|
||||||
"twrp",
|
"twrp",
|
||||||
"uncordon",
|
"uncordon",
|
||||||
|
"urandom",
|
||||||
"userdata",
|
"userdata",
|
||||||
"userdel",
|
"userdel",
|
||||||
"userland",
|
"userland",
|
||||||
|
|||||||
@@ -1,7 +1,5 @@
|
|||||||
# Generate random passwords
|
# Generate random passwords
|
||||||
|
|
||||||
## Table of contents <!-- omit in toc -->
|
|
||||||
|
|
||||||
1. [TL;DR](#tldr)
|
1. [TL;DR](#tldr)
|
||||||
1. [Sources](#sources)
|
1. [Sources](#sources)
|
||||||
|
|
||||||
@@ -12,12 +10,13 @@
|
|||||||
openssl rand -base64 32
|
openssl rand -base64 32
|
||||||
gpg --gen-random --armor 1 32
|
gpg --gen-random --armor 1 32
|
||||||
|
|
||||||
# Print out 32 random alphanumerical characters.
|
# Print out 32 random alphanumeric characters.
|
||||||
date '+%s' | sha256sum | base64 | head -c '32'
|
date '+%s' | sha256sum | base64 | head -c '32'
|
||||||
cat '/dev/urandom' | LC_ALL='C' tr -dc '[:alnum:]' | fold -w '32' | head -n '1'
|
cat '/dev/urandom' | LC_ALL='C' tr -dc '[:alnum:]' | fold -w '32' | head -n '1'
|
||||||
|
|
||||||
# XKCD-inspired passwords.
|
# XKCD-inspired passwords.
|
||||||
pipx run 'xkcdpass'
|
xkcdpass -d '-' -C 'random' -n 5
|
||||||
|
gopass pwgen -x --xc --xl 'en' --xn --xs '.' 3
|
||||||
```
|
```
|
||||||
|
|
||||||
## Sources
|
## Sources
|
||||||
@@ -26,7 +25,8 @@ pipx run 'xkcdpass'
|
|||||||
- [Generate a random password on Linux]
|
- [Generate a random password on Linux]
|
||||||
|
|
||||||
<!--
|
<!--
|
||||||
References
|
Reference
|
||||||
|
═╬═Time══
|
||||||
-->
|
-->
|
||||||
|
|
||||||
<!-- Others -->
|
<!-- Others -->
|
||||||
|
|||||||
14
snippets/generate-random-passwords.sh
Normal file
14
snippets/generate-random-passwords.sh
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
#!/usr/bin/env sh
|
||||||
|
|
||||||
|
# Print out 32 random characters.
|
||||||
|
openssl rand -base64 32
|
||||||
|
gpg --gen-random --armor 1 32
|
||||||
|
|
||||||
|
# Print out 32 random alphanumeric characters.
|
||||||
|
date '+%s' | sha256sum | base64 | head -c '32'
|
||||||
|
cat '/dev/urandom' | LC_ALL='C' tr -dc '[:alnum:]' | fold -w '32' | head -n '1'
|
||||||
|
|
||||||
|
# XKCD-inspired passwords.
|
||||||
|
xkcdpass
|
||||||
|
pipx run 'xkcdpass' -d '-' -C 'random' -n 5
|
||||||
|
gopass pwgen -x --xc --xl 'en' --xn --xs '.' 3
|
||||||
Reference in New Issue
Block a user