annotate bin/pwgen @ 509:142db8fd5246

Change tmux status fg to black.
author edogawaconan <me@myconan.net>
date Mon, 17 Mar 2014 15:48:39 +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