Table of Contents

Encrypted Disk Images

– via Apple Support and Eclectic Light Company

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

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 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 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

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 one or more files to your local machine via SSH

Use scp.

# Download single file
local> scp local/path 

# Download directory recursively
local> scp -r local/path 

– via Stack Overflow

Create a script that runs over SSH

Basic script

ssh <your-server> << EOF
    echo "Hello world"
    echo "This is where your script should be"

– via Amit Chaudhary

Displaying the ssh command outputs and avoiding the “Pseudo-terminal will not be allocated because stdin is not a terminal." warning

ssh <your-server> -tt << EOF
    echo "Hello world"
    echo "This is where your script should be"

– via Stack Overflow

Bonus: Setting up a ssh key for passwordless auth

ssh-keygen -t rsa -b 2048

ssh-copy-id id@server -i <path_to_your_new_key>

ssh id@server  -i <path_to_your_new_key>

I’m including the path to the new key since I’m using a dedicated, passwordless key for this specific instance. If you’re just setting up the default key (~/.ssh/id_rsa) then you won’t need the -i option.

– via Stack Overflow

Alfred cheatsheet

iTerm: remove the right arrow to the left of the prompt

It’s the Marks feature. Disable it from Preferences -> Profiles -> <your profile> -> Terminal -> Shell integration -> Show mark indicators -> Off

– via Stack Overflow

iTerm useful shortcuts

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

Select the calendars to sync here -

– via Stack Overflow

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.