mirror of
https://github.com/RGBCube/nu_scripts
synced 2025-08-05 08:37:46 +00:00
refactor: ✨ (#418)
* refactor: ✨ move in one commit Eveything in modules should probably be changed to `exported` defs. The idea is to move everything first to keep proper history. * refactor: 📝 add modules readme (wip) * refactor: ✨ small move * refactor: 📝 changed nestring, updated modules readme * refactor: 📝 to document or not to document * fix: 🐛 themes replaced the template to use `main` and regenerated them from lemnos themes. * Revert "fix: 🐛 themes" This reverts commit 4918d3633c8d2d81950a0ed0cfd9eb84241bc886. * refactor: ✨ introduce sourced - Created a source `root` in which sourcable demos are stored. Some might get converted to modules later on. - Moved some files to bin too. * fix: 🐛 fehbg.nu * fix: 🐛 modules/after.nu * moved some other stuff around --------- Co-authored-by: Darren Schroeder <343840+fdncred@users.noreply.github.com>
This commit is contained in:
parent
382696cd21
commit
c47ccd42b8
128 changed files with 185 additions and 12 deletions
66
sourced/misc/password_generator/ReadMe.md
Normal file
66
sourced/misc/password_generator/ReadMe.md
Normal file
|
@ -0,0 +1,66 @@
|
|||
# Nushell Password Generator "nupass"
|
||||
|
||||
This nushell command randomly retrieves three words from a dictionary file (English with Japanese words added by @rickcogley) less than or equal to a given parameter's length, formats the words randomly with capitalization, then separates the words with some random symbols and numbers to return a password.
|
||||
|
||||
To use:
|
||||
|
||||
1. Get the dictionary file to your system using nushell's `http`:
|
||||
|
||||
```
|
||||
http get https://raw.githubusercontent.com/RickCogley/jpassgen/master/genpass-dict-jp.txt | save genpass-dict-jp
|
||||
```
|
||||
|
||||
...which has also been included in this folder for convenience.
|
||||
|
||||
2. Confirm your `$env.NU_LIB_DIRS` location, and copy the below script `2. nupass.nu` there as `nupass.nu`.
|
||||
3. Set the script as executable like `chmod +x nupass.nu`
|
||||
4. Specify the dictionary file's location in the script:
|
||||
|
||||
```
|
||||
let dictfile = $"/path/to/my/genpass-dict-jp"
|
||||
```
|
||||
|
||||
5. Confirm the symbols are what you want to use, and edit to taste:
|
||||
|
||||
```
|
||||
let symbolchars = "!@#$%^&*()_-+[]"
|
||||
```
|
||||
|
||||
6. Load the script with `use` in your `config.nu`, something like:
|
||||
|
||||
```
|
||||
use nupass.nu
|
||||
```
|
||||
|
||||
(you can specify the path as `use /path/to/nupass.nu` if you're not taking advantage of `$env.NU_LIB_DIRS`)
|
||||
|
||||
Reload nu, then run it to test:
|
||||
|
||||
```
|
||||
nupass -h
|
||||
nupass 5
|
||||
nupass 6 --debug
|
||||
nupass 3 -d
|
||||
```
|
||||
|
||||
### Testing
|
||||
|
||||
If you're making changes to the script while testing, just re-source the script by doing:
|
||||
|
||||
`use nupass.nu`
|
||||
|
||||
... which will reload the latest save.
|
||||
|
||||
### Caveats
|
||||
|
||||
I've been scripting for quite a long time, but not in nu. Input appreciated to make this more nu-esque!
|
||||
|
||||
Obviously you can just use the `random chars` or `random integers` commands but I like to have words I can read in my passwords, and I think those generated by this script have sufficient entropy.
|
||||
|
||||
This command doesn't let you specify a precise length.
|
||||
|
||||
### Acknowledgements
|
||||
|
||||
Thanks everyone on Discord for putting up with and answering my nubie questions @amtoine, @fdncred, @jelle, and for the feedback after try number 1.
|
||||
|
||||
<img width="1041" alt="image" src="https://user-images.githubusercontent.com/512328/231930563-4da63f8c-d9de-4620-901e-a39ed32b049f.png">
|
Loading…
Add table
Add a link
Reference in a new issue