Skip to content

Instantly share code, notes, and snippets.

@alejomongua
Created April 25, 2014 19:41
Show Gist options
  • Save alejomongua/11300756 to your computer and use it in GitHub Desktop.
Save alejomongua/11300756 to your computer and use it in GitHub Desktop.
My own password generator. It depends on xclip and ruby. Works on linux
#!/usr/bin/env ruby
CHAR_MAP = [('a'..'z'), ('A'..'Z'), ('#'..'9')].map { |i| i.to_a }.flatten
pass = (0...10).map { CHAR_MAP[rand(CHAR_MAP.length)] }.join
exec "echo #{pass} | xclip -sel clip && echo 'Copied to clipboard'"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment