Skip to content

Instantly share code, notes, and snippets.

@Raefael
Raefael / Remove duplicate "Open With" entries in Mac OS X
Last active December 17, 2015 13:38
Remove duplicate "Open With" entries in Mac OS X
/System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/LaunchServices.framework/Versions/A/Support/lsregister -kill -r -domain local -domain system -domain user
@Raefael
Raefael / Repair a locked iPhoto Library
Created May 13, 2013 11:30
repair a locked iPhoto Library
# If the Library is on a Time Capsule
disconnect all users from the TC
disconnect the TC
# generall options
Option 1
Back Up and try rebuild the library: hold down the command and option (or alt) keys while launching iPhoto. Use the resulting dialogue to rebuild. Choose to Rebuild iPhoto Library Database from automatic backup.
 
If that fails:
# shows you the actuall settings
# you'll see the autopoweroff set to '1' and autopoweroffdelay set to 14400
#
pmset -g | grep autopoweroff
# turn outopower off
sudo pmset -a autopoweroff 0
# turn outopower on
sudo pmset -a autopoweroff 14400
# hide file or folder
chflags -hidden "path to file or folder"
# show file or folder
chflags -nohidden "path to file or folder"
# show all hidden files or folders
defaults write com.apple.finder AppleShowAllFiles TRUE
killall Finder
@Raefael
Raefael / OS X - colorized .bash_profile
Last active December 15, 2015 08:29
OS X - colorized .bash_profile
##
# Simple colorized bash on Mountain Lion
##
# tell ls to be colourful
export CLICOLOR=1
export LSCOLORS=GxFxCxDxBxegedabagaced
# tell grep to highlight matches
export GREP_OPTIONS='--color=auto'
# alias
@Raefael
Raefael / OS X - install AirportUtility
Last active October 13, 2015 23:28
Install AirPort Utility 5.6.1 on Mountain Lion via Terminal
##
# Installing Airport Utility 5.6 via the terminal on Mountain Lion
##
mkdir ~/Downloads/tmp
cd ~/Downloads/tmp
curl -OL http://support.apple.com/downloads/DL1482/en_US/AirPortUtility56.dmg
hdiutil attach AirPortUtility56.dmg
xar -x -f /Volumes/AirPortUtility/AirPortUtility56.pkg Payload
gzcat AirPortUtility56Lion.pkg/Payload | tar -xf -