View previous topic :: View next topic |
Author |
Message |
user Apprentice
Joined: 08 Feb 2004 Posts: 202
|
Posted: Wed Apr 16, 2014 7:08 pm Post subject: |
|
|
Please more password generation solutions.
Code: | # pwgen -s 12 6
mri4bl5d4gGy fKU8SAgY4uFW boiXhF11p3q2 6jR9jQ3wkRg1 4PFioVZtMSJT 9OAwpzjg8Vit |
|
|
Back to top |
|
|
TomWij Retired Dev
Joined: 04 Jul 2012 Posts: 1553
|
Posted: Wed Apr 16, 2014 9:45 pm Post subject: |
|
|
Code: | $ alias word='sed `perl -e "print int rand(99999)"`"q;d" <(zcat /usr/share/dict/web2.gz)'
$ alias password='echo $(word) $(word) $(word) $(word)'
$ password;password;password;password
elod insulance irreparableness emprise
amelia anil comparascope bladderseed
copemate drumble cacozeal ineffectiveness
discomposedly calkin faultful brisk |
|
|
Back to top |
|
|
wuzzerd Guru
Joined: 05 Jan 2005 Posts: 467 Location: New Mexico
|
Posted: Wed Apr 16, 2014 11:06 pm Post subject: |
|
|
@TomWij
That gave me the rather cryptic: "pinpoint jujuism initialize subreligion" which almost makes sense. |
|
Back to top |
|
|
khayyam Watchman
Joined: 07 Jun 2012 Posts: 6227 Location: Room 101
|
Posted: Thu Apr 17, 2014 1:10 am Post subject: |
|
|
similarly ...
Code: | #!/bin/bash
file="/usr/share/dict/cracklib-small"
lines=$(awk 'END{print NR}' $file)
for ((i=1;i<=5;i++)) ; do
awk -v ORS="" -v num=$((RANDOM % $lines + 1)) 'NR==num' $file
done |
... output ...
Code: | % echo $(dicto.sh)
mumblesaxinggratuityinaudibleabstractor |
@wuzzerd ... yeah, the above @char array could be shortened, but I was expecting John to make all kinds of suggestions so I played fast and loose :)
best ... khay |
|
Back to top |
|
|
wuzzerd Guru
Joined: 05 Jan 2005 Posts: 467 Location: New Mexico
|
Posted: Thu Apr 17, 2014 2:19 am Post subject: |
|
|
khayyam wrote: |
@wuzzerd ... yeah, the above @char array could be shortened, but I was expecting John to make all kinds of suggestions so I played fast and loose
|
heh... egoless programming??
more perl
Code: | #!/usr/bin/perl
use Tie::File ;
tie @dict, 'Tie::File' , "/usr/share/dict/cracklib-small" , mode => O_RDONLY ;
for (1..4) {
print $dict[rand($#dict)] ;
}
# scantlycabinssubtractblackbirds
|
|
|
Back to top |
|
|
khayyam Watchman
Joined: 07 Jun 2012 Posts: 6227 Location: Room 101
|
Posted: Thu Apr 17, 2014 3:06 am Post subject: |
|
|
wuzzerd wrote: | heh... egoless programming?? |
wuzzard ... no, egoless debugging :) ... John said of my (intentionally) overly complex awk that it "would be easier in perl wink", which is really an old joke resurfacing ... so I provided some perl doing the same, but left it to him/others to polish, as it was already an improvement on the awk ... heh. Also ... this is crazy golf, not the perl golf apocalypse :)
Code: | # od -a -A n /dev/urandom | awk -v OFS="" 'NR==1{gsub(/[^a-zA-Z0-9_-]/,""); print substr($0,1,16); exit}'
Qdc2DeotVSbssivt |
best ... khay |
|
Back to top |
|
|
|