Hacker News new | past | comments | ask | show | jobs | submit login

Sometimes when I wait for slow tasks to complete I do stuff like:

  sleep 900; say "Task X is probably done now"
On Mac this works out of the box, AFAICT Linux has similar commands.

https://ss64.com/mac/say.html

https://manpages.debian.org/bookworm/gnustep-gui-common/say....




I use something similar with an added "nagging" functionality. Surprisingly, it's easier for me to obey this thing, than nagging from an actual human being.

    nagme () {
        [ "$#" -ne 2 ] && printf "usage: $0 [in_minutes] [text]\n" && return 1
        printf "sleeping $1 min before telling you to $2\n"
        sleep "$(echo $1\*60|bc)"
        say "$2" > /dev/null 2>&1
        while :
        do
            sleep 30
            echo -n '.'
            say "I'm nagging you to $2" > /dev/null 2>&1
        done
    }


I used this for my pipeline that deploys a fresly baked raspberry pi image onto an SD card. It would remind me to remove the SD card and put it in the Pi, boot it and have Ansible continue to configure it. Felt awesome.


I do this, but I put it after terminal tasks like builds or test suites like task build; say complete


thank you.

Just created an alias

alias waitfor='f() { sleep $1; say "Task $2 is probably done now"; }; f'


Why an alias creating a function and running it, instead of just defining the waitfor() function?

    function waitfor(){ sleep $1; say "Task $2 is probably done now"; }




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

Search: