Skip to content

Instantly share code, notes, and snippets.

@halferty
Created June 7, 2017 20:18
Show Gist options
  • Save halferty/7eab6e9683da5bfc291ab135edcb2899 to your computer and use it in GitHub Desktop.
Save halferty/7eab6e9683da5bfc291ab135edcb2899 to your computer and use it in GitHub Desktop.
Base-64 encode a file
#!/usr/bin/env ruby
require "base64"
file_name = ARGV[0]
data = File.read file_name
puts Base64.encode64 data
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment