annotate bin/pwgen @ 611:96a7b2a3e774

Higher tmux history
author nanaya <me@nanaya.pro>
date Mon, 02 Apr 2018 17:34:07 +0900
parents fea77cdcdb09
children bdc9eddf3743
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
478
8956a404dba6 Added random password generator.
edogawaconan <me@myconan.net>
parents:
diff changeset
1 #!/usr/bin/env ruby
8956a404dba6 Added random password generator.
edogawaconan <me@myconan.net>
parents:
diff changeset
2
8956a404dba6 Added random password generator.
edogawaconan <me@myconan.net>
parents:
diff changeset
3 require 'securerandom'
8956a404dba6 Added random password generator.
edogawaconan <me@myconan.net>
parents:
diff changeset
4
495
fea77cdcdb09 Size-customizable pwgen.
edogawaconan <me@myconan.net>
parents: 478
diff changeset
5 length = ARGV[0].to_i
fea77cdcdb09 Size-customizable pwgen.
edogawaconan <me@myconan.net>
parents: 478
diff changeset
6 length = 12 if length <= 0
478
8956a404dba6 Added random password generator.
edogawaconan <me@myconan.net>
parents:
diff changeset
7 5.times do |n|
495
fea77cdcdb09 Size-customizable pwgen.
edogawaconan <me@myconan.net>
parents: 478
diff changeset
8 puts "#{n}: #{SecureRandom.urlsafe_base64(length).slice(0, length)}"
478
8956a404dba6 Added random password generator.
edogawaconan <me@myconan.net>
parents:
diff changeset
9 end