Skip to content

Instantly share code, notes, and snippets.

@artkirienko
Created October 23, 2015 08:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save artkirienko/caa2187e212301f06e5e to your computer and use it in GitHub Desktop.
Save artkirienko/caa2187e212301f06e5e to your computer and use it in GitHub Desktop.
admins_pass.rake
namespace :admins_pass do
task :generate => :environment do
ids = []
ids += (8..39).to_a
ids += [50, 48, 40, 42, 43, 44, 45, 46]
f = File.new("pas_admins", 'w')
ids.each do |id|
psw = ([*('A'..'Z'),*('0'..'9')]-%w(0 1 I O)).sample(8).join
u = User.where(email: "admin#{id}@admin.ru").first
unless u.nil?
u.password = psw
u.password_confirmation = psw
u.save
f.write("office id: #{id} email: #{u.email} password: #{psw}\n\n")
end
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment