catalina
xcrun: error:
clang
shows:
xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
fix it with: xcode-select --install
Tools
- deluge, torrent client.
- qBittorrent, torrent client.
- FileMerge, macos builtin for file comparison
Tips
Make Finder Search in Folder
Open the Finder Preference, switch to the Advanced tab, on the dropdown list named When performing a search
, select Search the Current Folder
.
encrypt tar.gz
# tar -czf - * | openssl enc -e -aes256 -out secured.tar.gz
decrypt
# openssl enc -d -aes256 -in secured.tar.gz | tar xz -C test
How to Encrypt and Decrypt Files and Directories Using Tar and OpenSSL
remap key $
$ hidutil property --set '{"UserKeyMapping":[{"HIDKeyboardModifierMappingSrc":0x700000064,"HIDKeyboardModifierMappingDst":0x700000035}]}'
From MacBook Keyboard Setup: The Mysterious § Key:
My first instinct was to put the command into a .sh file and add it to the Login items in the System Preferences of the Mac. I tried it but for some reason it didn’t start the next time I restarted. So I dug deeper and found out I had to create an Automator script and compile it to a binary (app) which I can then safely add to the Login items. A few minutes later I had the final solution :)
https://github.com/dchakarov/restore-tilde
- MacBook Keyboard Setup: The Mysterious § Key
- hidutil - looking for Usage ID of § key
- Remap Caps Lock to Backspace in macOS Sierra in 1 Second
- Remapping Keys in macOS 10.12 Sierra
- HID Usage Tables 1.12
- hut1_12v2.pdf
- USB human interface device class
- MightyPork/usb_hid_keys.h
- USB ScanCodes
- Karabiner-Elements
Mojave
Light window in dark theme (OS in dark, applications in light)
defaults write -g NSRequiresAquaSystemAppearance -bool Yes
Log out and log in
Screenshot
Shift+CMD+5 to get into the screenshot mode
QuickTime
Rip Audio from Video
Using QuickTime Player: File / Export / Audio Only
Source: Rip audio file from video file in OSX Trim an MP3
Using QuickTime Player: Edit / Trim
Source: Trim an MP3 on your Mac A how-to guide for trimming MP3 audio in macOS Sierra using just the software that comes with your Mac.
Safari
Safari - How to enable local file access
- First you need to enable the develop menu.
- Click on the Develop menu
- Select Disable Local File Restrictions.
Terminal.app
Scroll to Previous Mark
CMD+UP
Dracula dark theme
A dark theme for Terminal.app and 50+ apps
Finder
show hidden files
CMD+SHIFT+.(dot)
Command line
otool
an llvm equivalent to objdumphidutil
to dump iso.- Example:
hdiutil makehybrid -iso -joliet -o Image.iso /input_path
- Ref: Mac OS X: Best Way to Make an ISO from a CD or DVD
- Example:
- burn catalina to disk:
sudo /Applications/Install\ macOS\ Catalina.app/Contents/Resources/createinstallmedia --volume /Volumes/Untitled
TimeMachine
Types of disks you can use with Time Machine on Mac says APFS can not be used for TimeMachine backup.
A big mistake I made, is to convert the HFS+ to APFS using diskutil apfs convert diskxx
, even if it’s not allowed in Disk Utility.
TimeMachine takes a lot of time to finish encrypting.
Screen Sharing
macOS comes with Screen Sharing, for example:
You only need a VNC client to connect to the built-in server. Examples of such client:
- VNC Viewer from RealVNC
- TightVNC
However, the screen sharing seems to be slow. There are some third party servers can be used:
- TeamViewer, free for personal use
- NoMachine, has a free version with limited functionality
refs:
brew
openjdk
$ brew tap AdoptOpenJDK/openjdk
$ brew cask install adoptopenjdk14
tips
Apple Configurator
准备监管模式的时候,一定要选中所有步骤,否则无法从另外一个手机恢复数据。