Skip to content

Instantly share code, notes, and snippets.

@wangyung
Last active September 14, 2020 15:41
Show Gist options
  • Save wangyung/d544c85796c82e7f8800de04b439976e to your computer and use it in GitHub Desktop.
Save wangyung/d544c85796c82e7f8800de04b439976e to your computer and use it in GitHub Desktop.
some mac os tips #mac #tips
#1. Show hidden files in Finder
defaults write com.apple.finder AppleShowAllFiles -bool true
killall Finder
#2. Show full path in Finder
defaults write com.apple.finder _FXShowPosixPathInTitle -bool true
#3. Cancel the auto backup in iTunes
defaults write com.apple.iTunes DeviceBackupsDisabled -bool true
#4. Disable creation of .DS_Store files on Samba server
defaults write com.apple.desktopservices DSDontWriteNetworkStores -bool true
#5. Create ram disk on Mac - use 1GB for example (512byte as an unit)
diskutil erasevolume HFS+ "ramdisk" `hdiutil attach -nomount ram://2097152`
#6. Change the DPI setting of X11
# modify /usr/X11/bin/startx
defaultserverargs="-dpi 96"
#7. Fix that there is no backup function in iTunes
defaults write com.apple.iTunes DeviceBackupsDisabled -bool false
#8. Convert read-only dmg to read-write format
hdiutil convert ro.dmg -format UDRW -o rw.dmg
#9. List all members of a group
dscacheutil -q group -a name %GROUP_NAME%
#10. Add members to a group
dscl . -append /Groups/admin GroupMembership luser
#11. Disable local time machine
sudo tmutil disablelocal
#12. Turn on/off Gatekeeper from cli
sudo spctl --master-enable or --master-disable
#Check status
spctl --status
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment