Bash commands for macOS.
- sshvpn -- vpn/proxy through a remote server
- alarm -- wake up to iTunes and a computer voice
- pomodoro -- notifications to take a break
brew install terminal-notifier \
dtach \
fswatch
Set the PATH
to include the bin
directory.
sshvpn
sets the macOS preferences to use a SOCKS proxy at
127.0.0.1:PORT
(e.g. PORT=8111). Next, sshvpn
establishes a ssh
connection to a remote host with the SOCKS port forwarding option,
tunneling traffic through 127.0.0.1:8111
. sshvpn
disables the
macOS SOCKS proxy when ssh is terminated with Ctrl-c
.
Add host to ~/.ssh/config
:
Host myserver
Hostname <IP_ADDRESS>
IdentityFile ~/.ssh/<ID_FILE>
UseKeychain yes
AddKeysToAgent yes
User <USER>
Port <PORT>
sshvpn myserver 8111
myvpn-service
has the host and port set, and it uses dtach
to put
it into the background.
myvpn-service
sshvpn
should set the network preferences as follows.
alarm
uses iTunes and the macOS voice as an alarm. First, create an
iTunes playlist titled "Alarm" and add songs to it. The "Alarm"
playlist will be used. Configure alarm-cron
.
crontab -e
#min hour mday month wday command
30 7 * * * /path/to/bin/alarm-cron
This is purposely difficult in order to become more aware and awake.
ps aux | grep alarm
# see what the alarm pid is
kill ALARM_PID
pomodoro
displays a macOS notification after X
minutes as a
reminder to take a beak.
- Set alert style to "Alerts" instead of "Banners".
- Uncheck all other options.
pomodoro 20
To run it in the background:
pomodoro-service
# or
pomodoro-service 20