macOS System Administration & Optimization#
Modify Known Hosts#
# Add description
nano ~/.ssh/known_hosts# To remove a specific host
ssh-keygen -R 10.1.1.14# Clear the full file
cat /dev/null > ~/.ssh/known_hosts1. Disk Management & Diagnostics#
Identify and Verify Disks#
# List all physical and virtual disks
diskutil list# Verify a specific disk (replace X with disk number)
diskutil verifyDisk /dev/diskXSMART Monitoring (via Homebrew)#
# Install smartmontools
brew install smartmontools# Check health of the primary NVMe drive
smartctl -a /dev/disk02. Homebrew Package Manager#
Official site: brew.sh
Installation#
/bin/bash -c "$(curl -fsSL [https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh](https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh))"Maintenance#
# List running background services
brew services list# Update Homebrew and upgrade all packages
brew update && brew upgrade3. Application Cleanup: Path Finder#
Brute Force Removal#
# Remove Application and Support files
sudo rm -rf /Applications/Path\ Finder.app/
sudo rm -rf ~/Library/Application\ Support/Path\ Finder/
sudo rm -rf ~/Library/Preferences/com.cocoatech.PathFinder.plist
sudo rm -rf ~/Library/Caches/com.cocoatech.PathFinderDeactivate Updates#
defaults write com.cocoatech.PathFinder SUEnableAutomaticChecks NO4. Permissions & Snapshots#
Remove Access Control Lists (ACL)#
# Recursively remove all ACL entries from a folder and its contents
chmod -RN /path/to/folderTime Machine Local Snapshots#
# List all local snapshots
tmutil listlocalsnapshots /# Delete a specific snapshot by date/ID
sudo tmutil deletelocalsnapshots 2025-12-29-030238# Batch delete all com.apple.TimeMachine snapshots
for d in $(tmutil listlocalsnapshots / | grep 'com.apple.TimeMachine' | awk -F. '{print $4}'); do sudo tmutil deletelocalsnapshots $d; done5. Time Machine: SMB Sparsebundle Resizing#
Use this workflow to effectively remove quotas from a network-based Time Machine backup.
# 1. Stop active backups
sudo tmutil stopbackup
# 2. Mount the SMB share manually
mkdir -p ~/SMB_TM
mount_smbfs //timemachine@UNAS-Pro/TimeMachine ~/SMB_TM
# 3. Resize the sparsebundle (e.g., to 10 Terabytes)
hdiutil resize -size 10t "~/SMB_TM/MacStudio (MO).sparsebundle"
# 4. Cleanup and Restart
umount ~/SMB_TM
rmdir ~/SMB_TM
sudo tmutil startbackup6. Networking & File Transfers#
Flush DNS Cache#
sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponderOptimize SMB Speed (Disable Signing)#
echo "[default]" | sudo tee /etc/nsmb.conf && echo "signing_required=no" | sudo tee -a /etc/nsmb.confRemote File Transfers (SCP)#
# Upload specific images to Hugo project
scp -v /Users/marc/Downloads/to_convert/* root@10.1.2.202:/home/marc/hugo/inuvik/static/images/SMB Shortcuts#
# Create a shortcut directory in Home for SMB Volumes
mkdir -p /Users/marc/SMBShares
ln -s /Volumes/Software /Users/marc/SMBShares/Software7. Image Processing (Mogrify)#
Batch resize and optimize images for the web.
# Resize to 1200px width, strip metadata, and target 100kb size
mogrify -verbose \
-path /Users/marc/Downloads/to_convert \
-resize 1200x \
-strip \
-interlace Plane \
-define jpeg:extent=100kb \
/Users/marc/Downloads/to_convert/*.jpg8. How to open the Developer Console#
On your Mac Studio, make sure Obsidian is the active window.
Press Cmd + Option + I (the letter ‘i’).
A side panel will open. Click the “Console” tab at the top of that panel.
9. Force nano to be used for crontab#
EDITOR=nano crontab -eMake Nano the Permanent Crontab Editor on macOS#
Run these two commands in your Mac Terminal to stop macOS from defaulting to Vim:
1. Add the rule to your profile#
echo 'export EDITOR=nano' >> ~/.zshrc
# Apply
source ~/.zshrcVerification#
From now on, you can simply type:
crontab -eIt will open in Nano every time without needing the prefix.
Troubleshooting#
If for some reason you are using an older version of macOS (pre-Catalina) and the above doesn’t work, you might be using Bash. In that case, run:
echo 'export EDITOR=nano' >> ~/.bash_profile && source ~/.bash_profile
10. How to Enable Cron for Automated Syncing#
Locate the Hidden Cron Binary#
- Open System Settings > Privacy & Security > Full Disk Access.
- Click the [ + ] button at the bottom of the list.
- When the Finder window appears, press
Cmd + Shift + Gon your keyboard. - In the box that appears, paste the following path exactly:
/usr/sbin/cron - Hit Enter. The
cronfile will be highlighted. - Click Open.
Enable the Permission#
- Look for cron in the Full Disk Access list.
- Ensure the toggle switch is moved to the ON (Blue) position.
- (Optional) While in this menu, ensure Terminal is also toggled ON.
Step 3: Grant Network Volume Access (For SMB Shares)#
If your scripts or notes are stored on an SMB share (/Volumes/...):
- In the same Privacy & Security menu, click on Files and Folders.
- Find cron in that list.
- Ensure the toggle for Network Volumes is turned ON.