Sha256: 8ff19993b90ecf7cc52097b138b1fb5b2e27d4ea91f9323fb4dbbb087c690e38

Contents?: true

Size: 390 Bytes

Versions: 181

Compression:

Stored size: 390 Bytes

Contents

#!/usr/bin/env ruby

def newpass(l)
    chars = 'abcdefghjkmnpqrstuvwxyzABCDEFGHJKLMNOPQRSTUVWXYZ0123456789!$%&()=?|@^*'
    password = ''
    l.downto(1) { |i| password << chars[rand(chars.length - 1)] }
    return password
end

puts "Generate random password"

unless ARGV[0]
  puts "Error: Password lenght argument missed"
  exit
else
  puts ARGV[0]
  puts newpass(Integer(ARGV[0]))
end

Version data entries

181 entries across 181 versions & 3 rubygems

Version Path
social_stream-0.11.3 presence/ejabberd/ejabberd_scripts/generate_random_password