Skip to content

Instantly share code, notes, and snippets.

@cbabos
Forked from iharosi/useful-osx-commands.md
Last active August 29, 2015 14:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cbabos/e59f152d629cd04001a3 to your computer and use it in GitHub Desktop.
Save cbabos/e59f152d629cd04001a3 to your computer and use it in GitHub Desktop.

###Useful OS X commands ####(initially by iharosi's Useful OS X commands)

  1. App Store Debug menu

    Show

    defaults write com.apple.appstore ShowDebugMenu -bool true
    

    Hide

    defaults write com.apple.appstore ShowDebugMenu -bool false
    
  2. Remove extended attributes recursively

    xattr -rc <Folder>
    
  3. Delete Time Machine backups

    sudo /System/Library/Extensions/TMSafetyNet.kext/Helpers/bypass rm -rfv /Volumes/<Disk>/Backups.backupdb/<Folder>/
    
  4. Carbon copy a physical disk to an image (.dmg) file
    source: http://hints.macworld.com/article.php?story=20050302225659382

    dd bs=4096 if=/dev/rXX# of=/[TARGET DIR]/image.dmg conv=noerror,sync
    

    You have to dismount the partition first.
    Use the diskutil list and mount commands to discover the devices.

  5. Convert .png images to .jpg

    sips -s format jpeg ./*.png --out jpg/
    
  6. Resample image

    sips <source image> --resampleHeight <number> --out <directory>
    
  7. Finder Error -10810

    /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/LaunchServices.framework/Versions/A/Support/lsregister -kill -seed -rfv
    
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment