Skip to content

Instantly share code, notes, and snippets.

@ryuheechul
Last active December 26, 2016 08:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ryuheechul/ae44a0c0a0774d5cae512093e4792ff8 to your computer and use it in GitHub Desktop.
Save ryuheechul/ae44a0c0a0774d5cae512093e4792ff8 to your computer and use it in GitHub Desktop.
base64 encode for env values
#!/usr/bin/env ruby
filename = ARGV.first
file = File.new(filename, "r")
while (line = file.gets)
k, v = line.split('=', 2)
ev = `echo "#{v}" | base64`.gsub("\n",'')
puts " #{k}: #{ev}"
end
file.close
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment