Skip to content

Instantly share code, notes, and snippets.

@adamhaney
Created January 16, 2013 16:29
Show Gist options
  • Save adamhaney/4548589 to your computer and use it in GitHub Desktop.
Save adamhaney/4548589 to your computer and use it in GitHub Desktop.
A bash script to remind you to do pushups during work hours on OS X and Linux
#!/bin/bash
# pushup.sh
#
# Cron entry, weekdays on the hour from 8am-7pm
# m h dom mon dow command
# 0 8-19 * * 1-5 bash pushup.sh
# Minimum number of pushups you want to do
MINUPS=10
# Week of the year (1-52)
WEEK="`date +%V`"
if [[ $(uname) == 'Darwin' ]]; then
say "drop and give me `expr $MINUPS + $WEEK % 6`"
elif [[ $(uname) == 'Linux' ]]; then
echo "drop and give me `expr $MINUPS + $WEEK % 6`" | espeak
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment