Table of Contents
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 beAPFS (Case-sensitive)
unless you’re running a spinning disk drive, in which case pickMac OS Extended (Case-sensitive, Journaled)
Encryption
should be256-bit AES
unless that’s too slow for youImage Format
should be eithersparse bundle disk image
orsparse 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.
- Use
– 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
- Make sure you have enabled website icons, via Preferences -> Tabs -> Show website icons in tabs
- Quit Safari
- Allow Full Disk Access for Terminal, via System Preferences -> Security & Privacy -> Privacy -> Full Disk Access
- Open Terminal and run
defaults write com.apple.Safari IncludeInternalDebugMenu 1
- Start Safari
- Open the new Debug menu and unselect Debug -> Tab Features -> Narrow Tabs
- Enjoy the old, sane tab behavior
- (Optional) You can disable the menu afterwards by running
defaults write com.apple.Safari IncludeInternalDebugMenu 0
in Terminal. - (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 username@host.com:/path/to/dir/file local/path
# Download directory recursively
local> scp -r username@host.com:/path/to/dir 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"
EOF
– 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"
EOF
– 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
Exclude files from Alfred search
- 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
Alfred cheatsheet
https://www.alfredapp.com/help/getting-started/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
⌥ + ⌘ + /
- Show popup with recent directories⌘ + ;
- Autocomplete command⇧ + ⌘ + ;
- Show most recent commands
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
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.