Skip to content

Instantly share code, notes, and snippets.

@boxofrad
Last active December 31, 2015 08:29
Show Gist options
  • Save boxofrad/7960840 to your computer and use it in GitHub Desktop.
Save boxofrad/7960840 to your computer and use it in GitHub Desktop.
require 'io/console'
Signal.trap(:SIGINT) { exit }
puts "CTRL-C to quit...\n"
print 'Password: '
password = STDIN.noecho(&:gets)
puts
loop do
print "Number: "
index = gets.strip.to_i - 1
if (char = password[index])
IO.popen('pbcopy', 'w') { |f| f << char }
puts "Copied to your clipboard!"
else
puts "Your password aint that long"
end
end
@boxofrad
Copy link
Author

I always get this wrong and end up locking myself out of online banking!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment