Useful OS X ----------- boot message at startup --- nvram boot-args="-v" cisco vpn --------------- restart --- sudo /System/Library/StartupItems/CiscoVPN/CiscoVPN restart uninstall ---- sudo /usr/local/bin/vpn_uninstal Defaults ------- Disable dashboard - defaults write com.apple.dashboard mcx-disabled -boolean YES Reduce render delay - defaults write com.apple.Safari WebKitInitialTimedLayoutDelay 0.25 Increase animation speed of sheets - defaults write NSGlobalDomain NSWindowResizeTime .001 Disable Spotlight - edit /etc/hostconfig to change "SPOTLIGHT=-YES-" to "SPOTLIGHT=-NO-" Rebuild Spotlight Database --- sudo mdutil -i on rm -rf /.Spotlight* sudo mdutil -E Enable Safari Debug Menu - defaults write com.apple.Safari IncludeDebugMenu 1 Disable xterm startup when X11 is started - defaults write org.x.X11_launcher app_to_run /usr/X11/bin/xlsclients or defaults write org.x.X11_launcher app_to_run /usr/bin/true And finally, in XQuartz from macosforge X11 and X11_launcher have been integrated, so you do this defaults write org.x.X11 app_to_run /usr/bin/true To Renable => defaults write org.x.X11_launcher app_to_run /usr/X11/bin/xterm Get rid of X11 quit alert - defaults write com.apple.x11 no_quit_alert true Get rid of the .DS_Store files on share drives (specifically windows shares) - defaults write com.apple.desktopservices DSDontWriteNetworkStores true Show full path to current directory on Finder Title - defaults write com.apple.finder _FXShowPosixPathInTitle -bool YES Mount external drives without user login (normally they only mount when a user logs in) - defaults write /Library/Preferences/SystemConfiguration/autodiskmount AutomountDisksWithoutUserLogin -bool true Time machine supports unsupported drives (lion) -- defaults write com.apple.systempreferences TMShowUnsupportedNetworkVolumes 1 Drag dashboard widgets to desktop - defaults write com.apple.dashboard devmode YES type "killall Dock" Disable "change file extension" warning - defaults write com.apple.finder FXEnableExtensionChangeWarning -bool false create shortcut to start screen saver from cmd line ---------- alias ss='/System/Library/Frameworks/ScreenSaver.framework/Resources/ScreenSaverEngine.app/Contents/MacOS/ScreenSaverEngine' Focus Follows Mouse ------------------- You can do it for Terminal.app by issuing the following command at the command line: defaults write com.apple.Terminal FocusFollowsMouse -string YES For X11 apps you can do this: defaults write com.apple.x11 wm_ffm true Software updates ------------ sudo softwareupdate -i -a Sandvox - changing the default publishing location -------- defaults write com.karelia.Sandvox ApacheDocRoot -path Hardware Errors ---------------- 04/07/2011 20:04:06 kernel USB Notification: The device "EHCI Root Hub Simulation" @ 0x24000000 has caused an overcurrent condition. The hub it is attached to has been disabled how to disable this message ------- sudo launchctl unload -w /System/Library/LaunchDaemons/com.apple.UserNotificationCenter.plist time machine exclude list ------------ sudo mdfind "com_apple_backup_excludeItem = 'com.apple.backupd'" plist that manages standard exclusions /System/Library/CoreServices/backupd.bundle/Contents/Resources/StdExclusions.plist enable debug menu in address book ---------- defaults write com.apple.addressbook ABShowDebugMenu -bool true **important not to sudo this command** Formatting disks ------------- Just format a disk with osx filesystem - diskutil eraseDisk JHFS+ formatting a disk that can be read by wondows --- diskutil partitionDisk /Volumes/ 1 MBRFormat "MS-DOS FAT16" "Label" 1G to partition a disk for mac -- diskutil partitionDisk /Volumes/ 1 GPTFormat "Case-sensitive Journaled HFS+" "Label" 64G Enabling Screen Sharing on a remote mac ------- $ cd /Library/Preferences $ echo -n enabled > com.apple.ScreenSharing.launchd To disable screen sharing: $ cd /Library/Preferences $ rm com.apple.ScreenSharing.launchd To Disable the shutdown resume feature in Lion ================== curl http://goo.gl/Z4EFC -L -s -o ~/fixlogin.sh && chmod +x ~/fixlogin.sh && sudo ~/fixlogin.sh ; rm ~/fixlogin.sh To Enable The Checkbox: sudo defaults delete com.apple.loginwindow LoginHook Fix iCal "New Event" after upgrading to iCloud -------- rm /Users/cwebster/Library/Calendars/Calendar\ Cache rm com.apple.iCal* mounting a webdav volume ------- mount_webdav -i https://contentserver.hosts.plc.cwintra.com/livelinkdav/nodes/31736675/ /Volumes/hsm_reps NOTE: you need to create the mount dir first. the -i puts you in interactive mode so that you are prompted for username and password How to remount an ejected USB storage device -------- kextunload IOUSBMassStorageClass.kext; kextload /System/Library/Extensions/IOUSBMassStorageClass.kext How to disable all Optical devices --------- Move (IODVDStorageFamily.kext bundle) from /System -> Library -> Extensions into a directory you create e.g. csw_disabled remove bloat from mail ----- sqlite3 ~/Library/Mail/V2/MailData/Envelope\ Index vacuum; disable virtual memory --- sudo launchctl unload -w /System/Library/LaunchDaemons/com.apple.dynamic_pager.plist (to enable repeat the command with 'load') Mountain Lion - change App store Alerts (really annoying) to Banners ---------------------- sudo vi /Applications/App\ Store.app/Contents/Info.plist g/alert/s//banner/ Disable Automount of disks whilst logged in ----- sudo launchctl unload /System/Library/LaunchDaemons/com.apple.diskarbitrationd.plist (to restart use "load" instead of "unload") get rid of cisco vpn web security guff in syslog (acwebsecagent) - uninstall it --- sudo /opt/cisco/anyconnect/bin/websecurity_uninstall.sh list installed software updates ---- /usr/sbin/system_profiler SPInstallHistoryDataType show os ver ------- sw_vers Make quick look text copiable ----------- $ defaults write com.apple.finder QLEnableTextSelection -bool TRUE $ killall Finder To revert the changes: $ defaults write com.apple.finder QLEnableTextSelection -bool FALSE $ killall Finder Stop mac going to sleep when lid is shut ----------- sudo nvram boot-args="iog=0x0" This reverses the "Clamshell" mode for Apple's laptop systems, where when you close the display but connect the system to an external monitor and keyboard the system will stay awake. After running this command, when connecting an external monitor, the internal display will be disabled, which can be beneficial in some situations such as those where you are mirroring your desktop but wish to run the external display at a higher resolution than your laptop can run. Using menu shutdown from CLI -------- up vote 37 down vote Shut down without showing a confirmation dialog: osascript -e 'tell app "System Events" to shut down' Shut down after showing a confirmation dialog: osascript -e 'tell app "loginwindow" to «event aevtrsdn»' Restart without showing a confirmation dialog: osascript -e 'tell app "System Events" to restart' Restart after showing a confirmation dialog: osascript -e 'tell app "loginwindow" to «event aevtrrst»' Log out without showing a confirmation dialog: osascript -e 'tell app "System Events" to «event aevtrlgo»' Log out after showing a confirmation dialog: osascript -e 'tell app "System Events" to log out' Go to sleep (pmset): pmset sleepnow Go to sleep (AppleScript): osascript -e 'tell app "System Events" to sleep' Put displays to sleep (10.9 and later): pmset displaysleepnow The four letter codes for the Apple events are listed in AERegistry.h. --- remotely rebooting a filevault locked device --- sudo fdesetup authrestart -------- Disable "Resume" Feature on El Capitan ----------- curl http://goo.gl/Z4EFC -L -s -o ~/fixlogin.sh && md5 -q ~/fixlogin.sh | xargs -I % mv ~/fixlogin.sh ~/%.sh && chmod +x ~/121dca51e66073624da420b6e1be61d9.sh && sudo ~/121dca51e66073624da420b6e1be61d9.sh ; rm ~/121dca51e66073624da420b6e1be61d9.sh to undo - sudo defaults delete com.apple.loginwindow LoginHook Disable SIP (System Integrity Protection) ----------- Click the  menu. Select Restart... Hold down command-R to boot into the Recovery System. Click the Utilities menu and select Terminal. Type csrutil disable and press return. Close the Terminal app. Click the  menu and select Restart.... -------------