This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env bash | |
| set -eu -o pipefail | |
| # shellcheck source=/Users/andrewrich/etc/functions.sh | |
| . "$HOME/etc/functions.sh" | |
| readonly R="ROCK" P="PAPER" S="SCISSORS" | |
| about () { | |
| cat <<EOF | |
| $( basename "$0" ) by Andrew Rich <[email protected]> | |
| Based on @cassidoo's interview question from https://buttondown.email/cassidoo/archive/be-careful-with-your-words-once-they-are-said/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env bash | |
| set -eu -o pipefail | |
| about () { | |
| cat <<EOF | |
| $( basename "$0" ) by Andrew Rich <[email protected]> | |
| Based on @cassidoo's interview question from https://tinyletter.com/cassidoo/letters/be-curious-read-widely-try-new-things-what-people-call-intelligence-just-boils-down-to-curiosity-aaron-swartz | |
| Definition and table of logic gates: https://whatis.techtarget.com/definition/logic-gate-AND-OR-XOR-NOT-NAND-NOR-and-XNOR | |
| EOF |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ## path | |
| export PATH="/usr/local/opt/ruby/bin:$PATH" | |
| ## prompt | |
| export PS1='\h:\W \u\$ ' | |
| ## aliases | |
| # /etc/sudoers.d/andrewrich: andrewrich ALL=(ALL) NOPASSWD: /sbin/ifconfig | |
| alias bouncewifi='sudo ifconfig en0 down && sudo ifconfig en0 up && ifconfig en0' | |
| alias brewup='/usr/local/etc/brewupdate.sh' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env bash | |
| ##### | |
| # usage: just run days-countdown.sh to get a countdown until the default date of October 25 | |
| # or specify "from" (e.g. today) and "to" (your target date) in this terrible, terrible format: | |
| # days-countdown.sh "$(gdate)" "$(gdate -d 25-Dec)" | |
| # result is ~/tmp/days-countdown.png | |
| # the png's text color is the hex interpretation of the three-digit days-remaining number ;) | |
| # I use Geektool to position the png on my desktop, and run the script in crontab every hour: | |
| ## 44 * * * * /Users/andrewrich/Documents/scripts/days-countdown.sh >/dev/null 2>&1 | |
| # |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/local/bin/bash | |
| set -eux -o pipefail | |
| ## this runs on both the client and server Mac | |
| ## configure CLIENT and SERVER appropriately | |
| ## brew install terminal-notifier | |
| ## use with e.g. ControlPlane (launch this script when Thunderbolt network connection becomes active) | |
| CLIENT=my-client-mac.local | |
| SERVER=the-server-mac.local |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash -x | |
| ## this runs on the Synergy *server* Mac and assumes the *client* is connected via bridge0 | |
| ## server: 169.254.168.87 ; client: 169.254.168.86 | |
| ## use e.g. ControlPlane to run the script on wake | |
| ## brew install terminal-notifier | |
| ## use ssh-copy-id to enable passwordless ssh from the server to the client | |
| ## add to /etc/sudoers.d/youruser e.g. $YOUR_USER ALL=(ALL) NOPASSWD: /usr/bin/killall,/sbin/ifconfig | |
| ## replace $YOUR_USER with your username on the client | |
| echo "bouncing Synergy..." | terminal-notifier -title controlplane |
NewerOlder