This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionNext revisionBoth sides next revision | ||
fuss:sh [2018/04/06 23:56] – [Copyright] office | fuss:sh [2019/11/08 16:40] – [Scramble a String] office | ||
---|---|---|---|
Line 751: | Line 751: | ||
The following command will generate an alpha-numeric string from the real random number device that would be suitable to be used as a password: | The following command will generate an alpha-numeric string from the real random number device that would be suitable to be used as a password: | ||
<code bash> | <code bash> | ||
- | grep -m 10 -ao '[[:alnum:]]' < /dev/urandom | xargs | tr -d ' ' | + | egrep -m 10 -ao '[\x20-\x7E]{1}$' </dev/random |
</ | </ | ||
where: | where: | ||
- | * '' | + | * '' |
* '' | * '' | ||
* '' | * '' | ||
- | * '' | + | * '' |
- | * '' | + | * '' |
- | | + | |
+ | On OSX you can prevent the password to be echoed | ||
+ | <code bash> | ||
+ | egrep -m 20 -ao '[\x20-\x7E]{1}$' | ||
+ | </ | ||
+ | which will then place the password in the clipboard. | ||
====== Detach, Background and Re-Attach a Process ====== | ====== Detach, Background and Re-Attach a Process ====== | ||
Line 779: | Line 784: | ||
Later on, to check up on the command' | Later on, to check up on the command' | ||
+ | |||
+ | ====== Scramble a String ====== | ||
+ | |||
+ | <code bash> | ||
+ | echo ' | ||
+ | </ | ||
+ | |||
+ | ====== Generate Random Numbers in Range using awk ====== | ||
+ | |||
+ | <code bash> | ||
+ | awk -v min=X -v max=Y ' | ||
+ | </ | ||
+ | where: | ||
+ | * '' | ||
+ | * '' | ||
+ |