Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Attention getting: password generation golf
View unanswered posts
View posts from last 24 hours

Goto page Previous  1, 2  
Reply to topic    Gentoo Forums Forum Index Portage & Programming
View previous topic :: View next topic  
Author Message
user
Apprentice
Apprentice


Joined: 08 Feb 2004
Posts: 202

PostPosted: Wed Apr 16, 2014 7:08 pm    Post subject: Reply with quote

Please more password generation solutions. :)

Code:
# pwgen -s 12 6
mri4bl5d4gGy fKU8SAgY4uFW boiXhF11p3q2 6jR9jQ3wkRg1 4PFioVZtMSJT 9OAwpzjg8Vit
Back to top
View user's profile Send private message
TomWij
Retired Dev
Retired Dev


Joined: 04 Jul 2012
Posts: 1553

PostPosted: Wed Apr 16, 2014 9:45 pm    Post subject: Reply with quote

XavierMiller wrote:
Code:
SomethingBetter2Remember?Probably!

https://xkcd.com/936/


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
View user's profile Send private message
wuzzerd
Guru
Guru


Joined: 05 Jan 2005
Posts: 467
Location: New Mexico

PostPosted: Wed Apr 16, 2014 11:06 pm    Post subject: Reply with quote

@TomWij

That gave me the rather cryptic: "pinpoint jujuism initialize subreligion" which almost makes sense.
Back to top
View user's profile Send private message
khayyam
Watchman
Watchman


Joined: 07 Jun 2012
Posts: 6227
Location: Room 101

PostPosted: Thu Apr 17, 2014 1:10 am    Post subject: Reply with quote

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
View user's profile Send private message
wuzzerd
Guru
Guru


Joined: 05 Jan 2005
Posts: 467
Location: New Mexico

PostPosted: Thu Apr 17, 2014 2:19 am    Post subject: Reply with quote

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
View user's profile Send private message
khayyam
Watchman
Watchman


Joined: 07 Jun 2012
Posts: 6227
Location: Room 101

PostPosted: Thu Apr 17, 2014 3:06 am    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Portage & Programming All times are GMT
Goto page Previous  1, 2
Page 2 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum