Skip to content

Instantly share code, notes, and snippets.

@grymoire7
Last active July 20, 2022 19:57
Show Gist options
  • Save grymoire7/bff8f3f65ade44ad4e06d4541db5792e to your computer and use it in GitHub Desktop.
Save grymoire7/bff8f3f65ade44ad4e06d4541db5792e to your computer and use it in GitHub Desktop.

Stupid developer tricks: Get notified when a long running process ends

Prerequisites:

# stuff these into a shell startup file (like .zshrc)
alias imdone='afplay /System/Library/Sounds/Blow.aiff'
# if you want to play a sound at random then use the following line
# alias imdone='afplay "$(find /System/Library/Sounds -type f -name "*.aiff" | shuf -n 1)"'
alias iwatch='while true; do rm ./imdone; watch -g ls ./imdone; imdone; done'

Notifications from the bare metal shell:

cd $PROJECT_DIR/benchprep-v2
rspec;   imdone
sleep 5; imdone

Notifications from a container:

# in the bare metal shell...
cd $PROJECT_DIR/benchprep-v2
iwatch   # ctrl-c ctrl-c to exit

# in a container....
dcc login v2 shell
rspec;   touch ./imdone
sleep 5; touch ./imdone
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment