Network Routes on macOS

Today I was troubleshooting a problem where my computer could not talk to a host on my network. It turned out that when the VPN connected, it modified my Mac’s routing table and replaced the default route. I’m recording my debugging commands here for Future Me™: # print ipv4 route table netstat -r -n -f inet # show the route for a destination route get <destination>

2026-08-20

Binaries on Macos

Path Note /usr/local/bin/ System-wide binaries go here! ~/bin/ My user’s binaries go here!

2025-08-22

How to view and remove routes on macOS

Today I needed to remove a bad route on macOS. Normally I just reboot to do that, but I decided to learn how to do it without rebooting. Here’s how I did it. First, view the routes to confirm the route is bad: netstat -rn | grep IP_ADDR Grab the IP you care about from the “Destination” column. Use it to delete the route: sudo route -n delete DEST_IP_ADDR Done!

2025-05-30

Fixing a filename in git on a case insensitive filesystem

My work laptop was provisioned with a case-insensitive filesystem for some strange reason. This makes renaming stuff in a git repo “fun”: $mv README.md readme.md mv: 'README.md' and 'readme.md' are the same file Here’s a workaround for this problem: # give the file a temp name git mv README.md readme_temp.md git com -m "Rename 1 of 2" # then name it what you actually want to call it git mv readme_temp.md readme.md git com -m "Rename 2 of 2" Solved!

2025-05-29

Linux load average

This post documents the high level concepts I need to remember about *nix Load Average. Load average can been seen in the output of uptime and top: From uptime: $ uptime 14:40 up 21 days, 21:48, 5 users, load averages: 2.63 2.75 3.45 From top: root@blog-server-2:~# top -n 1 | head -2 top - 15:28:37 up 10 days, 12:41, 1 user, load average: 0.04, 0.03, 0.00 Tasks: 95 total, 1 running, 94 sleeping, 0 stopped, 0 zombie root@blog-server-2:~# There are 3 decimal numbers shown. They present the load average over three different time scales: ...

2022-09-16

Open a file or folder from the macOS CLI

You can open the a file from the macOS CLI with the command open. To open a file with the default app, use: open $FILENAME To open the current directory, use: open . To open a specific directory, use open $DIRECTORY_NAME To open a URL, use: open $URL Thanks to this post for teaching me this.

2022-08-09

Translating characters with tr

I recently was having to work with Ansible for several days to deploy changes globally across prod. I was storing my playbook limit in a file like so: [18:45] james_simas@widget ~/Downloads $ cat limit.txt host1.domain.com host2.domain.com host3.domain.com At one point, I needed to use supply the list of hostnames in BASH, but rather than having them be newline separated, I needed them to be separated by commas like this: host1.domain.com,host2.domain.com,host3.domain.com I didn’t want to modify my original files (I still needed them) and this seemed like a problem somebody else has problably solved. I Googled a bit and found an answer using tr. ...

2021-01-14

macOS

Allow an app to run sudo xattr -rd com.apple.quarantine /path/to/the.app Disable emoji predictions in macOS Sonoma and higher sudo defaults write /Library/Preferences/FeatureFlags/Domain/UIKit.plist emoji_enhancements -dict-add Enabled -bool NO Source: https://www.reddit.com/r/MacOS/comments/16wzdk9/is_there_a_way_to_turn_off_the_new_emoji/ Dock Configure auto-hide delay: # set to 200ms (default) defaults write com.apple.dock "autohide-delay" -float "0.2" && killall Dock # set to 30ms defaults write com.apple.dock "autohide-delay" -float "0.03" && killall Dock # set to immediate defaults write com.apple.dock "autohide-delay" -float "0" && killall Dock Finding what processes are using a TCP port sudo lsof -nP -iTCP -sTCP:LISTEN Time Machine Configure backup speed: ...

tarsnap

List archives: tarsnap --list-archives | sort List size of all archives: tarsnap --print-stats Create archive: tarsnap -v -c -f ARCHIVE_NAME /path/to/file /path/to/dir Restore archive: tarsnap -v -x -f ARCHIVE_NAME Delete archive: tarsnap -d -f ARCHIVE_NAME Useful doc: https://www.tarsnap.com/simple-usage.html