Never been to CodeSnippets before?

Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world (or not, you can keep them private!)

Ruby (See related posts)

// Generate a Tempfile

require 'tempfile'

ENV['TEMP'] = Dir.pwd
ENV['TMP'] = Dir.pwd
tmpFil = Tempfile.new('enc')
tFile = File.new(tmpFil.path, "w+")
trap("INT") { exit 1 }
10000.times do
        tFile.puts rand(100000)
end
tFile.close
sleep 3

cmdline = "gpg --recipient \"<user@email.com>\" --encrypt-file #{tmpFil.path}"
exec cmdline

You need to create an account or log in to post comments to this site.