Mac OS X Cheatsheets - hewigovens/hewigovens.github.com GitHub Wiki
##Make a bootable install of Mavericks on Flash USB Drive
% createinstallmedia --help
% sudo /Applications/Install\ OS\ X\ Mavericks.app/Contents/Resources/createinstallmedia --volume /Volumes/{MOUNTED_USB_DRIVE} --applicationpath /Applications/Install\ OS\ X\ Mavericks.app --nointeraction
##Extract attribute from cli
% xattr -p com.apple.metadata:kMDItemWhereFroms InjectionPluginV3.2.pkg |xxd -r -p > /tmp/1.plist; pplist /tmp/1.plist
Array {
http://injectionforxcode.johnholdsworth.com/InjectionPluginV3.2.pkg
http://injectionforxcode.johnholdsworth.com/
}
##Mount SBM from cli
####applescript
try
mount volume "smb://workgroup;username:password@ipaddress/path/to/mount$"
end try
####shell
#/Volumes/path should be existed
#If your password contains special characters, e.g.: ! @ # .
#you need to escape with HTML decimal code(http://www.obkb.com/dcljr/charstxt.html)
#e.g. !@#. -> %21%40%23%2E
mount_smbfs //'domain;username:password'@ipaddress/path/to/mount/ /Volumes/path
##Disk Utility Debug Menu
defaults write com.apple.DiskUtility DUDebugMenuEnabled 1
##Hide All Desktop Icons in Mac OS X
defaults write com.apple.finder CreateDesktop -bool false
killall Finder
defaults write com.apple.finder CreateDesktop -bool true
##XProtect.plist
/System/Library/CoreServices/CoreTypes.bundle/Contents/Resources/XProtect.meta.plist
##Web URL shortcuts
*.webloc
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>URL</key>
<string>http://www.google.com.hk/</string>
</dict>
</plist>
##Spotlight -> Finder Press CMD+R on a selected item in Spotlight will bring up the selected file in a Finder window.
##Sleep keyboard shortcut Option + Command + Eject
##Quick check cert file $ certtool d *.pem
##Chrome Tips
--allow-file-access-from-files --enable-file-cookies -disable-web-security --enable-logging --v=1
- Chromium Command Line Switches
-
根据pem私钥计算chrome extension id
cat key.pem | openssl rsa -pubout -outform DER | openssl dgst -sha256 | cut -c 1-32 | tr "0-9a-f" "a-p"
##XNU/Darwin
XNU: X is Not Unix
OS X Kernel: Mach + BSD + Other I/O Kit
Darwin: open source OS
##Verbose Boot set:
sudo nvram boot-args="-v"
unset:
sudo mvram boot-args=
man nvram
##Check System Version 至少3种方法:
cat /System/Library/CoreServices/SystemVersion.plist
sw_vers -productVersion
system_profiler SPSoftwareDataType
##User/Login logs
man wtmp
man utmpx
##Reset Status Bar
rm ~/Library/Preferences/com.apple.systemuiserver.plist
killall SystemUIServer
##Lock/Unlock Folders#
set:
sudo chflags -R nouchg ~/Downloads
unset:
sudo chflags -R uchg ~/Downloads
##Finder Display Invisible Files
defaults write com.apple.finder AppleShowAllFiles TRUE
##Remove Download Warning
defaults write com.apple.LaunchServices LSQuarantine -bool false
##Covert iso to dmg
hdiutil convert /folder/folder/file.iso -format UDRW -o /folder/folder/file.dmg
##Delete Certificate from Command Line
sudo security delete-certificate -c "CNNIC ROOT" /System/Library/Keychains/SystemRootCertificates.keychain
##Diff two folders
diff -rq <PATH1> <PATH2>
##See FileSystem events
fs_usage | grep -i Pref