pip install fastapi uvicorn
sudo apt install espeak- Setup
sound.mp3(a playable mp3 file) andconfig.py. The content ofconfig.pyis:
COMMANDS = {
'whoami': 'YOUR_USERNAME', # the output of `whoami`
'hostname': 'YOUR_HOSTNAME', # the output of `hostname`
}
HOSTS = ['host1', 'host2'] # each "host" is a SSH host (in your ssh config)- Setup
~/.bashrc:
alias remind='python3 /path/to/remind.py'
export PYTHONPATH=$PYTHONPATH:/path/to/parent/directorynote that "/path/to/parent/directory" is equivalent to os.path.dirname(os.path.dirname(os.path.abspath(__file__))) in remind.py.
-
start server (also automatically kill old servers) and ssh tunnels
remind on
-
check status
remind status
-
stop server
remind off
You have to start the server locally before using the following commands.
-
use in cli
remind sleep 5
(result: when the command finishes, you first listen to your music, then someone says "sleep has finished")
remind ls /foo
(result: when the command finishes, you first listen to your music, then someone says "ls has failed")
-
use in a python file
from remind import remind_breakpoint ... # your code remind_point('train epoch 1 finished') ... # your code
(result: when the code runs to this line, you first listen to your music, then someone says "train epoch 1 finished")