annotate bin/pwgen @ 627:84791ac85abd

Update tmux 2.9+ compatible syntax
author nanaya <me@nanaya.pro>
date Sun, 30 Jun 2019 20:25:30 +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