Skip to content

Instantly share code, notes, and snippets.

@eightseventhreethree
Last active August 14, 2017 15:38
Show Gist options
  • Save eightseventhreethree/31a4430028d4de882c3dce7a1db3b930 to your computer and use it in GitHub Desktop.
Save eightseventhreethree/31a4430028d4de882c3dce7a1db3b930 to your computer and use it in GitHub Desktop.
Creates ascii art, the url is the first argument of the script only work on Ubuntu.
#!/usr/bin/env bash
sudo apt-get install ruby ruby-dev
sudo apt-get install imagemagick libmagickwand-dev
sudo gem install asciiart
url_of_file=$1
ruby_script_var="$(cat <<EOF
#!/usr/bin/env ruby
require 'asciiart'
art_file = AsciiArt.new("${url_of_file}")
puts art_file.to_ascii_art(width: 50, color: true)
EOF
)"
touch /tmp/foo.rb
echo "${ruby_script_var}" > /tmp/foo.rb
ruby /tmp/foo.rb
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment