Skip to content

Instantly share code, notes, and snippets.

@intjonathan
Created April 22, 2014 21:19
Show Gist options
  • Save intjonathan/11194714 to your computer and use it in GitHub Desktop.
Save intjonathan/11194714 to your computer and use it in GitHub Desktop.
generate mysql passwords quickly
require 'keepass/password'
10.times do
password = KeePass::Password.generate('[Adbp]{20}', :remove_lookalikes => true);
p password
p `mysql -e 'select password("#{password}")\G'`.match(/\*(\w+)/)[1]
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment