Generate tempfile


/ Published in: Ruby
Save to your folder(s)



Copy this code and paste it in your HTML
  1. require 'tempfile'
  2.  
  3. ENV['TEMP'] = Dir.pwd
  4. ENV['TMP'] = Dir.pwd
  5. tmpFil = Tempfile.new('enc')
  6. tFile = File.new(tmpFil.path, "w+")
  7. trap("INT") { exit 1 }
  8. 10000.times do
  9. tFile.puts rand(100000)
  10. end
  11. tFile.close
  12. sleep 3
  13.  
  14. cmdline = "gpg --recipient \"<[email protected]>\" --encrypt-file #{tmpFil.path}"
  15. exec cmdline

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.