public
Created

  • Download Gist
mdp.rb
Ruby
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
#!/usr/bin/ruby
# Prints out a memorable password.
#
# Example:
# $ mdp
# Kasubian704
# $ mdp 3
# trefle173
# semilunar557
# derride305
 
(ARGV.first or 1).to_i.times {
puts open('/usr/share/dict/words') { |f|
f.inject { |choice, line| rand < 1/f.lineno.to_f ? line : choice }.to_s.strip
} + (rand * 1000).round.to_s
}

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.