LoginSignup
19
17

More than 5 years have passed since last update.

OSXの同僚にSSH接続してうざい嫌がらせをするコマンド

Last updated at Posted at 2015-05-27

よりうざくする方法があったらコメントで教えてください!

使い方

  1. SSHで誰かのMacOSXにログイン
  2. 以下のスクリプトをコピペして実行
  • GUIでログインしているアカウントと同じアカウントでないと動きません
  • 自分のマシンのターミナルで実験することも可能
sh <<SCRIPT
open /
open .
open ~/Desktop
osascript <<EOF
run script hoge
script hoge
    tell application "Finder"
        activate

        --ウィンドウをランダムに移動
        repeat with i from 0 to 100
            set position of Finder window 1 to {random number from -500 to 1000, random number from 0 to 500}
            set position of Finder window 2 to {random number from -500 to 1000, random number from 0 to 500}
            set position of Finder window 3 to {random number from -500 to 1000, random number from 0 to 500}
        end repeat

        --Text-to-speech
        say "Hey!"

        -- 画面をチカチカさせる(事前にシステム環境設定で、キーボード>ショートカット>アクセシビリティ>カラーを反転…のショートカットをONにしておく)
        tell application "System Events"
            repeat with j from 0 to 8
                key code 28 using {control down, option down, command down}
            end repeat
        end tell

        -- 警告音を鳴らす
        beep
        beep
        beep

        --ダイアログ表示
        set sNum to display dialog "ねえねえどんな気持ち???" with icon stop buttons {"消えろ", "うざい", "もう1回"} default button 1 
        if button returned of sNum = "もう1回" then
          run hoge
        end if

    end tell
end script
EOF
SCRIPT

仕組み

osascriptコマンドでうざそうなAppleScriptを実行している。

注意事項

  • 仕事中に仕掛けるとガチで怒られると思う
19
17
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
19
17