Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

macos has the "say" binary which is fun to play with for stuff like this


I did something similar for finding which outlet a breaker went to. I connected my MacBook to the outlet, airplay to the TV so it was loud, then had it yell if the power was disconnected:

    while ! pmset -g batt | grep 'discharging'; do; echo waiting; sleep 1; done; say disconnected


a billion years ago I piped say and some various noise files into ffmpeg to make audios that sounded like numbers stations, I don't think it would run anymore but it was a lot of fun :D



Back in windows and powershell days, this was my favorite "security reminder" prank. Everyone who forgot to lock their machine and walked away got this script executed on their machines. TLDR: it schedules a task "Security Reminder" to play "I'm watching you" via voice synth, every 30 mins.

```

$action = New-ScheduledTaskAction -Execute 'Powershell.exe' -Argument '-NoProfile -WindowStyle Hidden -command "& {[System.Reflection.Assembly]::LoadWithPartialName(""System.Speech"") | Out-Null; (New-Object (""System.Speech.Synthesis.SpeechSynthesizer"")).Speak(""I''m watching you"")}"'

$period = New-TimeSpan -Minutes 30;

$trigger = New-ScheduledTaskTrigger -RepetitionInterval (New-TimeSpan -Minutes 30) -RepetitionDuration (New-TimeSpan -Days 1024) -At 9am -Once

Register-ScheduledTask -Action $action -Trigger $trigger -TaskName "Security reminder" -Description "Security Reminder"

```

You can imagine people faces, especially many were sitting in headphones in open space offices. Those were the days...


I often use this when i want some feedback from a script somewhere running on my machine but don’t know where output is going




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: