Encrypted Disk Images

  • Start Disk Utility
  • Choose File -> New Image -> Blank Image
  • Pick a maximum Size - take care with this, as your disk image won’t be able to grow larger than the value you set
  • Format should be APFS (Case-sensitive) unless you’re running a spinning disk drive, in which case pick Mac OS Extended (Case-sensitive, Journaled)
  • Encryption should be 256-bit AES unless that’s too slow for you
  • Image Format should be either sparse bundle disk image or sparse disk image.
    • Use sparse disk image if you want to create a single, large, encrypted file
    • Use sparse bundle disk image if you want to create a lot of smaller, encrypted files - useful if you want to sync this image using something like OneDrive/Dropbox/whatever.

– via Apple Support and Eclectic Light Company

Format external drive as APFS

Issue: When trying to reformat a drive in Disk Utility, APFS is missing from the formats list, with only Mac OS Extended, MS-DOS and ExFAT present. Solution: View -> Show All Devices. Then, select the disk (and not the volume) you want to format, pick the GUID Partition Map scheme, and you’ll find that APFS becomes available.

Check DNS caching duration for a domain

Run dig TYPE <domain> in a console, and make note of the number to the left of IN - that’s the cache duration, in seconds.

– via Ciberciti

Flush DNS cache

sudo dscacheutil -flushcache
sudo killall -HUP mDNSResponder

– via Mackeeper Blog



Disable Narrow Tabs in Safari 14

  1. Make sure you have enabled website icons, via Preferences -> Tabs -> Show website icons in tabs
  2. Quit Safari
  3. Allow Full Disk Access for Terminal, via System Preferences -> Security & Privacy -> Privacy -> Full Disk Access
  4. Open Terminal and run defaults write com.apple.Safari IncludeInternalDebugMenu 1
  5. Start Safari
  6. Open the new Debug menu and unselect Debug -> Tab Features -> Narrow Tabs
  7. Enjoy the old, sane tab behavior
  8. (Optional) You can disable the menu afterwards by running defaults write com.apple.Safari IncludeInternalDebugMenu 0 in Terminal.
  9. (Recommended) Remove Full Disk Access for Terminal via System Preferences -> Security & Privacy -> Privacy -> Full Disk Access

– via Reddit and Yuriy Shiryaev

Unarchive a Safari webarchive file

Use textutil.

textutil -convert html <filename>

– via Apple StackExchange

Whitelist a site in any Safari content blocker

Look for the site in Safari -> Preferences -> Websites -> Content Blockers, set content blocking to Off


Display shared Google calendars in Calendar.app

Select the calendars to sync here - https://www.google.com/calendar/syncselect.

– via Stack Overflow

Refresh Exchange calendars not syncing with Calendar.app in Monterey

Temporarily fixes Calendar.app not showing new events from Exchange calendars in MacOS Monterey (including v12.6.1).

launchctl stop com.apple.CalendarAgent
launchctl start com.apple.CalendarAgent

The issue will come back after a while, but you can run the commands again to refresh the calendars. Alternatively, you can schedule them to run every hour or so with a cron job.

# Let's just not use vi shall we?
export VISUAL=/usr/bin/nano 

# Edit crontab
crontab -e

# Add the following line
0 * * * * launchctl stop com.apple.CalendarAgent && launchctl start com.apple.CalendarAgent

– via Apple Community


Alfred cheatsheet


  • Add the file/folder to System Preferences -> Spotlight -> Privacy and rebuild Alfred’s cache
  • Add alfred:ignore to the Spotlight comments of the file/folder to ignore

Little Snitch

Little Snitch Blocklists


ImageMagick Commands

Convert pngs or heics to jpegs.

# Convert png to jpg, with 95% quality, while stripping any metadata
convert -strip -quality 95% <source>.png <destination>.jpg

# Convert HEIC to jpg, with 99% quality
mogrify -quality 99 -format jpg IMG_8672.HEIC
mogrify -quality 99 -format jpg *.HEIC


Install ffmpeg with libvpx-vp9 support (for webm conversion)

Commands such as brew install ffmpeg --with-libvpx don’t work anymore, I’ve found that simply installing libvpx with Homebrew and then reinstalling ffmpeg will work.

brew install libvpx
brew uninstall ffmpeg
brew install ffmpeg

# Check available encoders
ffmpeg -encoders

Some info here too.

Convert gifs to mp4/webm

ffmpeg -i my-animation.gif my-animation.mp4

ffmpeg -i my-animation.gif -c vp9 -b:v 0 -crf 41 my-animation.webm

– via Google Developers


Download videos from YouTube using yt-dlp

yt-dlp <url> -S ext:mp4:m4a

– via this GitHubIssue


Detect and remove externally added extensions

Like this unsolicited/unconfirmed, spyware-like extension that Adobe Acrobat Reader installs without your consent and which you should totally remove and report.

# this is where the external extensions are stored
cd /Users/<user>/Library/Application Support/Google/Chrome/External Extensions

# list the extensions
ls -l

# in my case, there was only efaidnbmnnnibpcajpcglclefindmkaj.json
cat efaidnbmnnnibpcajpcglclefindmkaj.json
> {
>     "external_update_url": "https://clients2.google.com/service/update2/crx"
> }

# kill it with fire, then restart Chrome
rm efaidnbmnnnibpcajpcglclefindmkaj.json

– via Dan’s comment to my LinkedIn post