Having fun on April 1st with SSH and Mac OS X
Inspired by the latest MacAddict's April Fools' pranks, here are some very handy commands to remotely control a computer of which you are an administrator. These are most useful in a family environment where you own and administer the others' computers. They also work well over AirPort.
First, you need to ssh to the computer using your admin account. Then, you can type in any or all of the following commands.
[robg adds: Read the rest of the article for the pranks. Please note that some of these are quite nasty! Using your power as Admin to remotely reboot someone's machine, for example, is a simply horrendous thing to do. With that said, however, some of the following would be quite fun to do to someone with a good sense of humor...]
Note: Commands that are shown on two lines have the second line indented by two spaces. Enter the command on one line, removing all but one space between the end of the first displayed line and the start of the second...
Absolutely nasty:
sudo kill [program id learned from top]
sudo halt
sudo reboot
sudo osascript -e 'tell app "[name of an open program]" to quit'
Note: using 'sudo open' over ssh does not give the user super-user privileges for the opened application.
Power:
sudo osascript -e 'tell app "Finder" to sleep'
sudo osascript -e 'tell app "Finder" to shut down'
General:
sudo open /Applications/iChat.app
sudo osascript -e "set volume 0"
sudo osascript -e "beep"
sudo osascript -e 'display dialog "Did you know that you are annoying?" buttons "Yes" with icon note'
sudo osascript -e 'tell app "Finder" to quit'
sudo open [path to an application]
Speech:
sudo osascript -e 'say "[whatever]" using "Zarvox"'
sudo osascript -e 'say "Dum dum dum dum dum dum dum he he he ho ho ho fa lah lah lah lah lah lah fa lah full hoo hoo hoo" using "Cellos"'
osascript -e 'say "oh This is a silly song silly song silly song this is the silliest song ive ever ever heard So why keep you listening listening listening while you are supposed to work to work to work to work its because i hate my job hate my job hate my job its because i hate my job more than anything else No its because youve no life youve no life youve no life and you better go get one after forwarding this crap" using "cellos"'
iTunes Control:
sudo open /Applications/iTunes.app; sudo osascript -e 'say "Play some music. Go on. I dare you." using "Zarvox"'
sudo osascript -e 'tell app "iTunes" to stop' -e 'say "Please stop playing your annoying music" using "Zarvox"'
sudo osascript -e 'tell app "iTunes" to next track' -e 'say "I did not like that song very much" using "Zarvox"'
sudo osascript -e 'tell app "iTunes" to fast forward' -e 'say "This song is boring" using "Zarvox"'
sudo osascript -e 'tell app "iTunes" to quit'
Have fun, but not too much fun!
Source: http://hints.macworld.com




