Last active
September 28, 2018 22:13
-
-
Save codfish/6998b08a05c222861804 to your computer and use it in GitHub Desktop.
Rick roll terminal prank
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
# some shortcomings: | |
# - prankee needs to be running rvm, rbenv, or some other | |
# ruby version manager that doesn't require sudo permissions to | |
# install gems. | |
# - can be killed by simply closing current tab/session | |
# | |
# Any bug reports or suggestions on improvements are welcome! | |
# | |
# Execute by running: | |
# curl -sL https://goo.gl/WpRkMx | sh | |
# | |
# if you want it to run continuously, every 3 seconds or so: | |
# ( while true; do sleep 3; curl -sL https://goo.gl/WpRkMx | sh; done ) & disown && clear | |
uninstall_imagemagick= | |
uninstall_catpix= | |
# cleanup | |
cleanup() { | |
if [ uninstall_imagemagick ]; then | |
brew uninstall imagemagick &> /dev/null | |
fi | |
if [ uninstall_catpix ]; then | |
gem uninstall -x catpix &> /dev/null | |
source ~/.bash_profile | |
fi | |
rm DS_Store.jpg | |
} | |
( | |
cd ~/Downloads | |
if ! $(brew list imagemagick &>/dev/null); then | |
uninstall_imagemagick=true | |
brew install imagemagick &>/dev/null | |
fi | |
if ! hash catpix &>/dev/null; then | |
uninstall_catpix=true | |
gem install catpix &>/dev/null | |
source ~/.bash_profile | |
fi | |
# you can choose any rick roll pic from the interwebs and replace the link | |
curl -s "https://i.ytimg.com/vi/alB3TDZMKDQ/maxresdefault.jpg" -o "DS_Store.jpg" &> /dev/null | |
catpix DS_Store.jpg -w 0.75 -c xy -r high | |
cleanup | |
) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment