Useful MacOS one-liners

These have been tested and seem to work on MacOS Catalina and later ... I will also keep this list updated with new commands and corrections ..

Disable Safari DNS caching
defaults write com.apple.safari WebKitDNSPrefetchingEnabled -boolean false

ClearDNS
alias cleardns='sudo killall -HUP mDNSResponder; echo "dns cache cleared"'

Clear Spotlight cache (alias)
alias clearspotlight='sudo launchctl unload -w /System/Library/LaunchDaemons/com.apple.metadata.mds.plist; echo "spotlight unload"; echo "waiting 20 secs"; sleep 20; sudo launchctl load -w /System/Library/LaunchDaemons/com.apple.metadata.mds.plist; echo "spotlight reloaded"'

Disable the standard delay in rendering a Web page.
defaults write com.apple.Safari WebKitInitialTimedLayoutDelay 0.25

The keyboard react faster to keystrokes (not equally useful for everyone)
defaults write NSGlobalDomain KeyRepeat -int 0

Enable TLS 1.3
sudo defaults write /Library/Preferences/com.apple.networkd tcp_connect_enable_tls13 1