5 ms·
This is useful! Imagine running a long ML training script. Hearing a sound in your speakers when it ends (successfuly or not) is something I considered impleme
by H8crilA 6y ago
This is useful!
Imagine running a long ML training script. Hearing a sound in your speakers when it ends (successfuly or not) is something I considered implementing, non ironically, at my job. Never got around to doing it.
- asah 6y agoAnother super easy option: send a slack message on a private channel (one LOC) which turns into a combo desktop and cellphone notification, which you can disable during sleeping hours, flow into zapier/ifttt etc etc etc
- Resinderate 6y agoDo this sometimes on mac, simply with: long_running_command && say "That's all folks"
- jedberg 6y agoMy favorite cron of all time was: 0 17 * * 1-5 say "You're gonna miss the train go now!!" Which I put on my work computer. Since it came out of the speaker most of the time, not only did I not miss the train, but everyone else knew I had to go and respected that.
- gknoy 6y agoI do the same thing with a shell alias called `SUCCESS`: alias SUCCESS='echo -e '\''\n\nSUCCESS'\'' && bash -c '\''mpv ~/bin/kazoo-fanfare.mp3 &'\'' || echo FAILED' # or play sad trombone sound # (some escaping might not survive ...) It's an always too-loud and too-annoying "Tadaa!" style fanfare that is very clearly NOT my music, and I will very frequently use it in the context of `make test && SUCCESS` to monitor long-running test suites while I do other work.
- computronus 6y agoThe built-in `afplay` shell command works for mp3s and for the stock aiff sounds under /System/Library/Sounds. I use this after my long-running Maven builds to play either a happy sound if the build succeeds or a sad (mocking) sound if it fails, based on the value of $?.
- lozf 6y agoLove the idea of checking the exit code! Seems I have some modifications to do. On Linux there's usually `aplay` but you'll need play (sox) or mpv etc. to play lossy-compressed audio... a bunch of sounds can be found under /usr/share/sounds/ depending on what's installed. `espeak-ng` doesn't have as good voices as `say`, but some `festival` ones come close, although these days I usually use Googles tts, and save the ones I use frequently.
- deleted 6y ago[deleted]
- jcelerier 6y agoThere's a whole research field about doing that actually. Here's the reference book on the topic: https://sonification.de/handbook/ https://sonification.de/handbook/ (PDF is on the right menu)
- mac-chaffee 6y agoIf you're using a cloud-based linux server, most of them have "mail": some_long_command | mail -s "Command finished" email@example.com
- encom 6y agoAhem... https://en.wikipedia.org/wiki/Bell_character https://en.wikipedia.org/wiki/Bell_character
- nicbou 6y agoI have an alias called "ding" that plays a sound. Add "; ding" to a command and you're set.
- ketzo 6y agoWow, I love that. Would you mind posting the full alias?
- nicbou 6y agoprintf '\a' or if you want to display a MacOS notification function alert { osascript -e 'display notification "'"$1"'"' }
- this_machine 6y agoI liked this idea so I packaged 'ding' into something you can install[1]. [1] https://github.com/alexdelorenzo/onhold https://github.com/alexdelorenzo/onhold
- joshvm 6y agoThere is a very simple way to tell if an ML script has failed: the GPU fans turn off. No joke. Even with a water cooled machine, I know something has gone wrong if I come back in an hour and the rig is silent.
- stonewareslord 6y agoOn Mac or Linux, I run "tput bel" to the end of expextedly long-running commands. On Mac, the icon bounces and system makes a beep sound. On linux (i3/urxvt), the window and workspace turns red until I focus it. You can usually also type it after the command has started and it’ll still work
- uryga 6y agoi've always used python -c 'print("\a")' without thinking too much about it, but yours is way nicer!
- vimax 6y agoOr for system monitoring. You could have different function play different sounds so the whole program sounds melodic in normal operation. If the melody is off or you hear discordant notes then you know something's up.
- rattray 6y agoAgreed! I played the star wars opening track on the conclusion of a script I wasn't sure would terminate. Very exciting. But turned out to have been triggered on an unexpected error case :(
- saboot 6y agoMy personal approach is a shell script that calls the slack webhook api, so I get a slack message when my job finishes.
- nl 6y agoI put 'say Data Prep phase 1 complete' in my training scripts. It works pretty well, but can be annoying when it goes off in a Zoom call...