OSX – Mountain Lion Time Machine backup failed

Gelegentlich wird in der Kombination Synology / Time Machine und Mountain Lion angezeigt das ein neues Backup angelegt werden muss um die Zuverlässigkeit des backups gewäherleisten zu können.
Dabei hat man zwei Möglichkeiten:
1. Man legt ein komplett neues Backup an und verliert die alten Stände (Dauer je Daten von ca. 50min bis XXX min)
2. Man repariert das Backup (Dauer ca. 5min)
Ich bevorzuge die zweite Option.
Dazu geht man wie folgt vor:
1. Man öffnet das Terminal mit root Berechtigungen:
sudo su –
Als nächstes gibt man dann das root Password ein.
2. Das TimeMachin Backup von der defekten Markierung auf Normal zurücksetzen.
Dazu gibt man im Terminal folgenden Befehl ein:
chflags -R nouchg /Volumes/{Sharename}/{Name des TimeMachine-Backups}.sparsebundle
Sind im Hostname Leerzeichen, müssen diese mit einem versehen werden.
/Volumes/tm/theos MacBook Pro.sparsebundle/
Nachdem der Befehl abgeschlossen ist, kann man den nächsten Befehl eingeben.
Bei mir hat es ca. 30 Sekunden gedauert.
3. Nun wird die Prüfung des Backups gestartet.
Dazu im noch geöffnetem Terminal Fenster folgenden Befehl eingeben:
hdiutil attach -nomount -noverify -noautofsck /Volumes/{Sharename}/{Name des TimeMachine-Backups}.sparsebundle
Das Terminal gibt nun drei Zeilen aus.
Dort ist es am einfachsten Ihr öffnet im Finder den Speicherort der Backups und zieht die Datei auf das Terminal Fenster.
Nun erscheint im Terminal Fenster der richtige Pfad.
Die dritte Zeile ist die wichtige für uns.
/dev/disk1 Apple_partition_scheme
/dev/disk1s1 Apple_partition_map
/dev/”’disk1s2”’ Apple_HFSX
Um anzeigen zulassen was im Hintergrund geschieht könnt Ihr euch das Log im Terminal mit dem folgenden Befehl ansehen:
tail -f /var/log/fsck_hfs.log
QUICKCHECK ONLY; FILESYSTEM DIRTY
/dev/rdisk1s2: fsck_hfs run at Thu Apr 12 16:54:/var/folders/_xxxxxxx
/dev/rdisk1s2: ** /dev/rdisk1s2
/dev/rdisk1s2: Executing fsck_hfs (version diskdev_cmds-540.1~34).
** Checking Journaled HFS Plus volume.
** Detected a case-sensitive volume.
The volume name is Time Machine-Backups
** Checking extents overflow file.
** Checking catalog file.
** Checking multi-linked files.
** Checking catalog hierarchy.
** Checking extended attributes file.
** Checking multi-linked directories.
** Checking volume bitmap.
** Checking volume information.
** The volume Time Machine-Backups appears to be OK.
Sollte die letzte Zeile The Volume could not be repaired enthalten, könnt Ihr mit dem vierten Punkt weiter machen.
Ansonsten springt zu Punkt fünf.
4. Eine erneute Prüfung startet Ihr mit dem Terminal Befehl:
fsck_hfs -drfy /dev/diskxs2
diskxs2 ändert Ihr entsprechend der dritten Zeile in Punkt drei ab.
Dies kann einige Zeit in Anspruch nehmen.
Den Status könnt Ihr euch wieder über folgenden Befehl anzeigen lassen:
tail -f /var/log/fsck_hfs.log
Erscheint nun am Ende The Volume was repaired successfully war die Reparatur erfolgreich.
Sollte dort erneut die Meldung erscheinen das TimeMachine Backup konnte nicht repariert werden, müsst Ihr ein neues Backup anlegen.
5. unmounten des Backups
Dazu gebt Ihr im Terminal folgenden Befehl ein:
hdiutil detach /dev/diskxs2
Hier auch wieder diskxs2 gegen den Wert in Punkt drei auswechseln.
Nun erscheint im Terminal noch das die Disk unmounted und ejected wird:
“disk1” unmounted.
“disk1” ejected.
6. Nun müsst Ihr noch im Sparsebundle einen Wert ändern damit TimeMachine dies wieder als funktionierendes Backup anerkennt.
Dazu öffnet Ihr den Speicherort des Sparsebundles im Finder und klickt mit der rechten Maustaste auf die Datei und wählt Paketinhalt anzeigen.
Die Datei com.apple.TimeMachine.MachineID.plist öffnet Ihr mit einem Texteditor.
Der Inhalt sieht wie folgt aus:
Dort ändert Ihr den Wert
auf
und speichert die Datei.
Nun könnt Ihr wie gewohnt das Backup starten und weiterhin nutzen.
Danke an das Synology Forum und die etlichen Webseiten auf denen Ich dann die Lösung gefunden habe.

OSX – change Dock to 2D


to change the default view of your dock, open terminal and enter the following command:
Enable 2D: defaults write com.apple.dock no-glass -boolean YES && killall Dock
Disable 2D to default Dock: defaults write com.apple.dock no-glass -boolean NO && killall Dock

OSX – 40 Awesome tricks


OS X Lion has now been around long enough for us all to dig in and really find some interesting functionality that is either completely hidden or just enough below the service that many users don’t even know it exists.
We’ve spent hours combing through Lion for secrets and put out a call on Twitter for your favorites. This post brings over forty such hidden tricks and tips for your viewing pleasure. Enjoy!
 

Finder Tricks

 

1. BRING BACK FINDER’S ICON SIZE SLIDER

With Lion came a ton of visual changes to the operating system we know and love. Everything has a sort of borderless appeal to it now with window graphics going right up to the edge and stopping suddenly without a buffer of any sort.
This makes for a really slick looking operating system, but to achieve it Apple had to make some serious functionality sacrifices that I’m not crazy about. For instance, the Finder no longer has the status bar at the bottom. There’s no quick reference for how many items are in a folder or a slider to resize the icons (a nicety that we only just got in Snow Leopard).
Fortunately, this particular problem has a quick fix. These features aren’t gone, they’re just hidden by default. Bringing them back is as easy as hitting ?/ or going to View>Show Status Bar.
screenshot
The long lost Finder Status Bar
 

2. NEW GROUP FROM SELECTION

Let’s say you have a bunch of stuff scattered across your desktop that you want to throw into a single folder. The old way of doing this is to create a new folder, select everything but that folder, then drag all of the selected items into it. In Lion though, you can now simply select all of those items then Right-Click and choose New Folder with Selection.

3. MERGE FOLDERS

Did you know you can have Lion auto-merge the contents of two folders? This one was tricky to figure out. Apple announced it on their site as a new feature in Lion but getting it to work is anything but intuitive.
If you have two identically named folders in separate directories, dragging one in with the other prompts a standard Replace dialog message. However, Option-Dragging the folder to duplicate it into the other directory brings up an additional choice: merge. This will create one folder containing the collected contents of both of the originals.
screenshot
Merging folders

4. ARRANGE APPS BY CATEGORY

The new Finder has dramatically improved the various sorting modes that are available. For instance, organize your files by date and you’ll see some nice subtle dividers that separate the content, making for a much more pleasant viewing experience.
If you’re in your Applications folder, a new option pops up in this menu: Application Category. This will intelligently sort through all your App Store apps and place them in their corresponding categories.
screenshot
Apps arranged by category

5. CLOSE ALL FINDER WINDOWS

Have you ever found yourself with a ton of different Finder windows open and wishing that you could just kill them all and start over? Look no further than a quick ??W, which will instantly close all open Finder windows. Alternatively, you can ?Click the close button.

6. DRAG SOMETHING OUT OF THE SIDEBAR

At least once a week a random click and drag goes wrong in Finder and I end up with something in my sidebar completely by accident. Logic says that to fix this, you’d reverse your previous action and drag the item back out to delete it from the sidebar, but this doesn’t work.
However, you don’t have to resort to the multi-step Control-clicking fiasco, instead try aCommand-drag. This will successfully remove the item in the sidebar.

7. FULLSCREEN SPOTLIGHT SHORTCUT

Let’s say you have a folder full of JPGs and you want to quickly go through them in a fullscreen image viewer. Try hitting ?Space to instantly launch Quick Look in fullscreen. From here, use your back and forth arrows, view a grid or start a slideshow.

Awesome Lion Tricks

 

8. SHOW DOCK IN FULLSCREEN APPS

Another great Lion feature is the fullscreen mode that you now see on many apps. The immediate complaint that many people have upon entering a fullscreen app though is that their dock no longer pops up from the bottom when moused over.
The truth is, yes it does. The action necessary to make it happen changes ever so subtly though. Typically, any motion near the bottom of the screen will pop up a hidden dock. However in fullscreen mode, you must bring your mouse all the way down to the bottom, then keep going. That little extra effort will tell OS X that you aren’t messing around with the app but instead want to see your dock. It’s awkward to get used to but eventually it starts to make sense.

9. ADD A SIGNATURE IN PREVIEW

Signing digital documents can be a pain. You have to print the PDF, sign it, then scan it back in. Who wants to go through that mess? Fortunately, Preview now lets you skip the hassle.
Open a document in preview and slide open the Annotations Toolbar by clicking on the little pencil button near the top. From there, click on the Signature Button (the “S” with a line under it) and choose Create Signature from Built-in iSight. Now just follow the on-screen instructions and sign a white piece of paper then hold it up to the camera. Preview will even save your signatures for future use.
screenshot
Adding signatures in Preview

10. ALTERNATE CHARACTER OPTIONS

This one is something everyone (including me) finds completely by accident when they try to type “nooooooooo!” or a similarly repeating string of vowels in Lion. It turns out if you hold down certain letters on the keyboard, rather than repeating the character, Lion pops up an iOS-like menu that allows you to choose an alternate variation.
screenshot
Alternate Character Options

11. ADDRESS BOOK/ICHAT: IMPORT FACE FROM IPHOTO

If you use Faces, iPhoto’s automatic face-detection feature, then adding photos to contacts in various Lion apps becomes much easier. When editing a contact’s photo, there’s a little button at the bottom that will automatically match the name of your contact to a “face” in iPhoto.
screenshot
iPhoto Faces Button

12. QUICK DUPLICATE OPEN FILE

I had a very difficult time adjusting to the lack of a “Save As” option in many of Lion’s apps, this is of course a result of the new Versions document system. One of the things that made it easier is knowing how to quickly create a duplicate of a document without running to the File menu.
screenshot
Duplicate
To accomplish this trick, click on the filename at the top of a Version-enabled file like those from TextEdit. This drops down a menu of options, one of which allows you to quickly duplicate the file.
Command-Clicking on the same place (the filename at the top of the window) will give you the path to that file. You can click on any folder in the hierarchy to open it in Finder.

13. MOVE DOWNLOAD FROM SAFARI

The new Safari download manager that sits to the right of the search bar has some interesting functionality beyond double-clicking a file in the list to open it. You can also actually move the downloaded file out from your Downloads folder by clicking and dragging it right from the Safari menu into the folder where you want it.
screenshot
Drag the download to move it to your desktop

14. QUICK LOOK PREVIEWS IN SPOTLIGHT

Spotlight received a welcome improvement with the Lion upgrade, now when you hover over an item in the results, a little Quick Look preview automatically pops up. The secret surprise is how well this works. For instance, if there are web pages in the results, you get an actual live web preview. Click on a link and it opens it in your browser. This is great for running a quick search for a site that you recently visited.
screenshot
Live web previews right in Spotlight

15. DRAG FROM SPOTLIGHT

Another slight Spotlight improvement is the ability to drag and drop files right from your search results. Keep in mind that this action will copy a file to a new location, not move it.

16. NONCONTIGUOUS SELECTIONS IN TEXTEDIT

In TextEdit, you can hold down the Option to see the typical selection tool replaced by a crosshair icon. Using this will allow you to make a noncontiguous selection, presumably to make selecting columns easier.
screenshot
Noncontiguous selections

17. MULTIPLE SELECTIONS IN TEXTEDIT

While we’re on the topic of cool ways to select text in TextEdit, try holding down the Commandkey and making a few selections. This allows you to select and copy multiple items at once. Unfortunately, it doesn’t allow you to then replace all of those selections with a single typed string like Sublime Text 2 does.

18. PLAY AN ALBUM FROM YOUR SCREENSAVER

In Lion, the built-in Album Artwork Screensaver has some added functionality. You can now move your mouse around without exiting the screensaver. Hovering over an album will enlarge it and give you the option to play it. It’s a really fun way to see and interact with your music.
screenshot
Click an album to play it

19. DELETE APPS IN LAUNCHPAD

Launchpad introduces a brand new way to delete apps from your Mac. In the Launchpad interface, click and hold an app to launch the iOS-style wiggle mode (or simply hold down Option). This will activate little close icons on the apps that were installed through the Mac App Store. Clicking this won’t only delete the app from launchpad, it’ll throw it in the trash.
screenshot
Jiggle mode

20. VIEW RECENT FILES IN EXPOSE

There’s a cool new way to view your recent items in several apps such as TextEdit and Preview. Activate the app and hit your dedicated Expose Keyboard Shortcut (varies from older to newer keyboards). Not only will all of the open windows zoom out and organize themselves, along the bottom of the screen a strip of thumbnails will pop up containing recently opened items.
screenshot
Recent Files in Expose

21. DIFFERENT LAUNCHPAD BACKDROPS

Here’s one that I’ll bet you’ve never heard about. The default view behind your icons in Launchpad is a blurred out version of your desktop. You can actually change this by hitting ?B. This shortcut will toggle between blurred, normal and grayscale backgrounds.

22. PROPORTIONAL WINDOW RESIZE

In Lion you can now resize a window from any edge, not just the corner. It turns out that this works similarly to resizing objects in many graphics applications. For instance, holding theOption key while dragging an edge will also move the opposite edge. Also, holding Shift will move every edge except the one opposite to the selected edge.

23. DOUBLE TAP TO DEFINE

In Snow Leopard, you could hit ??D while hovering over a word to bring up a little window with its definition. In Lion, you can do the same thing with a three finger double tap.
screenshot
Double tap with three fingers to define

Revert to the Old Ways

 

24. TURN OFF “NATURAL” SCROLLING

This one was instantly the most requested trick when Lion first launched. The powers that be at Apple have decided that the “natural” way for you to scroll is by imagining that you’re actually reaching out and tossing the page like you do on an iOS device. The problem of course is that on a desktop you have years of experience sliding your fingers down to scroll down and up to scroll up. Suddenly being forced to reverse your thinking results in a mental barrier that many people don’t see the benefit in getting over.
I recommend just getting used to it as it seems to be how Apple will do things from here on out, but if you simply can’t accept the change, you can revert back to the old way by uncheckingScroll direction: natural in the Mouse section in System Preferences.
screenshot
Getting your scroll on the old school

25. BRING BACK SCROLL BARS

As I mentioned before, the major visual push in Lion was all about stripping out anything unnecessary from the user interface. Some people like these changes, others can’t stand them. As we saw before though, Apple typically gives you control over these changes.
Scroll bars are a very useful feature, their presence immediately lets you know that the page can be scrolled. When they’re hidden, history has taught us to assume that the page doesn’t scroll. However, in Lion the default state of scroll bars is hidden, they don’t show up until you start scrolling. This can be confusing and frustrating if you’re too used to the old way. You can bring them back easily enough though, simply go into the General category in System Preferencesand select Show Scroll Bars: Always.
screenshot
Getting your scroll on the old school

26. TURN OFF RESTORE WINDOWS

While we’re in the General section of System Preferences take note of the Restore windowssetting near the bottom. Sometimes this can get really frustrating.
For instance, if you have a buggy Safari extension that crashes on a certain page, having the browser continually try to reload that page aggravates the problem. Also, if you have an older Mac that takes long enough to start up an application, turning off the default action to restore the last session and all of its tabs can save a lot of headaches.

27. OLD SCHOOL MAIL LAYOUT

The upgrades to Mail were some of the best that Lion made as far as I’m concerned, but they’re not for everyone. If you miss the old Mail layout, you’re in luck. Open up Mail Preferences and click on the Viewing tab. At the top you’ll see a checkbox labelled Use classic layout, check this and you’re back to Snow Leopard’s Mail layout.

Mission Control

 

28. MAKE YOUR SPACES STAY PUT

Being used to the way that Spaces worked in Snow Leopard, I simply couldn’t get used to how Mission Control was always rearranging my spaces (aka desktops, Lion can’t seem to decide what to call them). I like to have everything stay put with a set position for desktop 1, 2, 3 etc.
It all started making much more sense when I went into Mission Control in System Preferencesand turned off Automatically rearrange spaces based on most recent use. After you do this, you can once again enjoy the sanity of assigning an app to space 1 and having it stay there!

29. MAGNIFY WINDOWS IN MISSION CONTROL

Mission Control is probably my favorite new feature in Lion. I use it constantly and definitely find it to be an extremely useful way to sort through the massive amount of windows that I generally have open.
One hidden feature here that you’ve probably never tried is to hit space bar when hovering over one of the small window previews. This will zoom into the window in a Quick-Look-like fashion so you can take a closer look.
screenshot
Hit space over a Mission Control window

30. FOCUS ON A SINGLE APP

This function is very similar to the on in the last tip, only it focuses on all of the windows in a given app, making them larger and dimming the windows from other apps. To accomplish this, hover over a cluster of windows and scroll up.

31. NEW DESKTOP WITH SELECTION

In Mission Control, if you hover your mouse in the top right, a little “+” tab appears to create a new desktop. If you ever have a window that you want to toss in a new dedicated desktop, simply grab it and drag it to the “+” tab.
screenshot
New Desktop with selection

32. DRAG FILES TO MISSION CONTROL

While you’re dragging a file, launch Mission Control and drop the file on an application to have it opened with that specific app.

Oldies But Goodies

33. INSTANTLY SHOW AN APP IN FINDER

When I’m writing a review of an app, I always need to grab its icon for the post. This means going into the Applications folder and sorting through the million things that I have in there to land on the one I’m looking for, which can be a pain. My old solution was to right-click on the app, go Optionsand click Show in Finder.
However, there’s a much better way to go about this: simply Command-Click on any app in your dock and a Finder window will pop up with that app selected.

34. KILL AND YANK

I’ve mentioned this one before on AppStorm but it’s good enough to repeat. Have you ever had a situation where you needed to cut and paste something, but didn’t want to lose what was already occupying your clipboard? With Kill and Yank, you can!
Select the bit of text just like you always would, but instead of cutting the text, hit ?K to “kill” it. This is essentially like cutting it to an entirely different clipboard that doesn’t affect your default clippings. Once you’re ready to bring it back, “yank” it with ?Y.

35. OPTION-CLICK ICON IN DOCK TO SHOW/HIDE APP

Option-clicking on an app in your dock has some interesting functionality. If the app isn’t currently showing, the frontmost app will hide and the app that you clicked on will be shown. If the app that you click on is already the active application, then it will hide.

36. CHANGE VOLUME WITHOUT THE POP

When you adjust the volume via the keyboard, you get these little popping noises that help you identify just how loud the volume currently is. If you want to be a little more covert about it, you can adjust the volume without these noises by holding down the Shift key while changing the volume.
It use to be the cast that ??Volume Keys would allow for incremental volume changes on a smaller scale than your typical click. Unfortunately, Apple axed this feature in Lion.

37. QUICK ACCESS SYSTEM PREFERENCES

Along the same lines as the previous tip, try holding down Option while hitting your volume or brightness keys to be taken to their corresponding System Preference panel.

38. EXTRA MENU BAR INFO

Holding down Option while clicking on an OS X system menu bar item will often reveal some hidden information and options. For instance, performing this trick on your MacBook’s battery icon will show you the health of your battery. Also try it on the sound, Airport and Time Machine menu bar items.
screenshot
Hold option to see more information

39. MOVE MENU BAR ITEMS

Follow the same steps as the last tip, only this time hold down the Command key instead. This will give you the option to rearrange your menu bar items! Note that this typically does not work with third party menu bar apps.

40. AUTO COMPLETE F5

This one is extremely handy for those of us that can never spell words like “bureau” and “rendezvous” right on the first try. As you’re typing in TextEdit or iChat, hit F5 or Option+Escapeto bring up an autocomplete menu where you can select from various possible completions to the word you’ve started.
screenshot
Autocomplete

41. DELETE LAST WORD OR LINE

When typing in OS X, to quickly delete the last word that you typed, hit Option+Delete. You can also hit Command+Delete to eliminate the entire current line of text.

42. APP SWITCHER TRICKS

You probably already use ?Tab to move to the next application in Application Switcher, but did you know that with the switcher still open you can switch to ?` to move your selection backwards? You can also use the arrow keys and even quit/hide applications all right from the switcher.

43. DISABLE CAPS LOCK

Do you ever really use Caps Lock? Me neither, but I do accidentally turn it on frequently. To prevent this from happening, you can actually disable the action entirely. Go into System Preferences and click on Keyboard. Then click on the Modifier Keys… button near the bottom of this window and change Caps Lock Key to none.

OSX – Routing network traffic over specific connections


To route the network traffic over specific Network connections open the Terminal.
To add a route enter the following command: sudo route add "source ip" "destination gateway"
To delete the route enter the following command : sudo route delete "source ip"

OSX – Flush DNS Cache


To clean your DNS Cache you have to open the Terminal and enter the following command:
sudo killall -HUP mDNSResponder

OSX – See recent search in Safari 6


To see the search history in Safari 6 you only have to open Safari and press Command + L.
After that you’ll have to press the SPACE key.
Now you see your search history.

OSX – default commands


Here are a lot of default commands for several cases:
To use them, open Terminal (in /Applications/Utilities), then paste one of the commands into Terminal and press Return.
# Disable menu bar transparency
defaults write NSGlobalDomain AppleEnableMenuBarTransparency -bool false
# Show remaining battery time; hide percentage
defaults write com.apple.menuextra.battery ShowPercent -string "NO"
defaults write com.apple.menuextra.battery ShowTime -string "YES"

# Always show scrollbars
defaults write NSGlobalDomain AppleShowScrollBars -string "Always"

# Expand save panel by default
defaults write NSGlobalDomain NSNavPanelExpandedStateForSaveMode -bool true
# Expand print panel by default
defaults write NSGlobalDomain PMPrintingExpandedStateForPrint -bool true
# Disable the “Are you sure you want to open this application?” dialog
defaults write com.apple.LaunchServices LSQuarantine -bool false
# Display ASCII control characters using caret notation in standard text views
# Try e.g. `cd /tmp; unidecode “x{0000}” > cc.txt; open -e cc.txt`
defaults write NSGlobalDomain NSTextShowsControlCharacters -bool true
# Disable opening and closing window animations
defaults write NSGlobalDomain NSAutomaticWindowAnimationsEnabled -bool false
# Increase window resize speed for Cocoa applications
defaults write NSGlobalDomain NSWindowResizeTime -float 0.001
# Disable Resume system-wide
defaults write NSGlobalDomain NSQuitAlwaysKeepsWindows -bool false
# Disable the “reopen windows when logging back in” option
# This works, although the checkbox will still appear to be checked,
# and the command needs to be entered again for every restart.
defaults write com.apple.loginwindow TALLogoutSavesState -bool false
defaults write com.apple.loginwindow LoginwindowLaunchesRelaunchApps -bool false

# Fix for the ancient UTF-8 bug in QuickLook (http://mths.be/bbo)
# Commented out, as this is known to cause problems when saving files in Adobe Illustrator CS5 🙁
#echo “0x08000100:0” > ~/.CFUserTextEncoding
# Enable full keyboard access for all controls (e.g. enable Tab in modal dialogs)
defaults write NSGlobalDomain AppleKeyboardUIMode -int 3
# Enable subpixel font rendering on non-Apple LCDs
defaults write NSGlobalDomain AppleFontSmoothing -int 2
# Disable press-and-hold for keys in favor of key repeat
defaults write NSGlobalDomain ApplePressAndHoldEnabled -bool false
# Set a blazingly fast keyboard repeat rate
defaults write NSGlobalDomain KeyRepeat -int 0
# Disable auto-correct
defaults write NSGlobalDomain NSAutomaticSpellingCorrectionEnabled -bool false
# Enable tap to click (Trackpad) for this user and for the login screen
defaults write com.apple.driver.AppleBluetoothMultitouch.trackpad Clicking -bool true
defaults -currentHost write NSGlobalDomain com.apple.mouse.tapBehavior -int 1
defaults write NSGlobalDomain com.apple.mouse.tapBehavior -int 1

# Map bottom right Trackpad corner to right-click
defaults write com.apple.driver.AppleBluetoothMultitouch.trackpad TrackpadCornerSecondaryClick -int 2
defaults write com.apple.driver.AppleBluetoothMultitouch.trackpad TrackpadRightClick -bool true
defaults -currentHost write NSGlobalDomain com.apple.trackpad.trackpadCornerClickBehavior -int 1
defaults -currentHost write NSGlobalDomain com.apple.trackpad.enableSecondaryClick -bool true

# Require password immediately after sleep or screen saver begins
defaults write com.apple.screensaver askForPassword -int 1
defaults write com.apple.screensaver askForPasswordDelay -int 0

# Allow quitting Finder via ? + Q; doing so will also hide desktop icons
defaults write com.apple.finder QuitMenuItem -bool true
# Disable window animations and Get Info animations in Finder
defaults write com.apple.finder DisableAllAnimations -bool true
# Show all filename extensions in Finder
defaults write NSGlobalDomain AppleShowAllExtensions -bool true
# Show status bar in Finder
defaults write com.apple.finder ShowStatusBar -bool true
# Allow text selection in Quick Look
defaults write com.apple.finder QLEnableTextSelection -bool true
# Disable disk image verification
defaults write com.apple.frameworks.diskimages skip-verify -bool true
defaults write com.apple.frameworks.diskimages skip-verify-locked -bool true
defaults write com.apple.frameworks.diskimages skip-verify-remote -bool true

# Automatically open a new Finder window when a volume is mounted
defaults write com.apple.frameworks.diskimages auto-open-ro-root -bool true
defaults write com.apple.frameworks.diskimages auto-open-rw-root -bool true
defaults write com.apple.finder OpenWindowForNewRemovableDisk -bool true

# Display full POSIX path as Finder window title
defaults write com.apple.finder _FXShowPosixPathInTitle -bool true
# Avoid creating .DS_Store files on network volumes
defaults write com.apple.desktopservices DSDontWriteNetworkStores -bool true
# Disable the warning when changing a file extension
defaults write com.apple.finder FXEnableExtensionChangeWarning -bool false
# Show item info below desktop icons
/usr/libexec/PlistBuddy -c "Set :DesktopViewSettings:IconViewSettings:showItemInfo true" ~/Library/Preferences/com.apple.finder.plist
# Enable snap-to-grid for desktop icons
/usr/libexec/PlistBuddy -c "Set :DesktopViewSettings:IconViewSettings:arrangeBy grid" ~/Library/Preferences/com.apple.finder.plist
# Disable the warning before emptying the Trash
defaults write com.apple.finder WarnOnEmptyTrash -bool false
# Empty Trash securely by default
defaults write com.apple.finder EmptyTrashSecurely -bool true
# Enable AirDrop over Ethernet and on unsupported Macs running Lion
defaults write com.apple.NetworkBrowser BrowseAllInterfaces -bool true
# Show the ~/Library folder
chflags nohidden ~/Library
# Hot corners
# Top left screen corner ? Mission Control
defaults write com.apple.dock wvous-tl-corner -int 2
defaults write com.apple.dock wvous-tl-modifier -int 0

# Top right screen corner ? Desktop
defaults write com.apple.dock wvous-tr-corner -int 4
defaults write com.apple.dock wvous-tr-modifier -int 0

# Bottom left screen corner ? Start screen saver
defaults write com.apple.dock wvous-bl-corner -int 5
defaults write com.apple.dock wvous-bl-modifier -int 0

# Enable highlight hover effect for the grid view of a stack (Dock)
defaults write com.apple.dock mouse-over-hilte-stack -bool true
# Enable spring loading for all Dock items
defaults write com.apple.dock enable-spring-load-actions-on-all-items -bool true
# Show indicator lights for open applications in the Dock
defaults write com.apple.dock show-process-indicators -bool true
# Don’t animate opening applications from the Dock
defaults write com.apple.dock launchanim -bool false
# Remove the auto-hiding Dock delay
defaults write com.apple.Dock autohide-delay -float 0
# Enable the 2D Dock
defaults write com.apple.dock no-glass -bool true
# Automatically hide and show the Dock
defaults write com.apple.dock autohide -bool true
# Make Dock icons of hidden applications translucent
defaults write com.apple.dock showhidden -bool true
# Enable iTunes track notifications in the Dock
defaults write com.apple.dock itunes-notifications -bool true
# Add a spacer to the left side of the Dock (where the applications are)
defaults write com.apple.dock persistent-apps -array-add '{tile-data={}; tile-type="spacer-tile";}'
# Add a spacer to the right side of the Dock (where the Trash is)
defaults write com.apple.dock persistent-others -array-add '{tile-data={}; tile-type="spacer-tile";}'

# Disable shadow in screenshots
defaults write com.apple.screencapture disable-shadow -bool true
# Disable Safari’s thumbnail cache for History and Top Sites
defaults write com.apple.Safari DebugSnapshotsUpdatePolicy -int 2
# Enable Safari’s debug menu
defaults write com.apple.Safari IncludeInternalDebugMenu -bool true
# Make Safari’s search banners default to Contains instead of Starts With
defaults write com.apple.Safari FindOnPageMatchesWordStartsOnly -bool false
# Remove useless icons from Safari’s bookmarks bar
defaults write com.apple.Safari ProxiesInBookmarksBar "()"
# Add a context menu item for showing the Web Inspector in web views
defaults write NSGlobalDomain WebKitDeveloperExtras -bool true

# Enable the debug menu in Address Book
defaults write com.apple.addressbook ABShowDebugMenu -bool true
# Enable the debug menu in iCal
defaults write com.apple.iCal IncludeDebugMenu -bool true
# Only use UTF-8 in Terminal.app
defaults write com.apple.terminal StringEncodings -array 4
# Disable the Ping sidebar in iTunes
defaults write com.apple.iTunes disablePingSidebar -bool true
# Disable all the other Ping stuff in iTunes
defaults write com.apple.iTunes disablePing -bool true
# Make ? + F focus the search input in iTunes
defaults write com.apple.iTunes NSUserKeyEquivalents -dict-add "Target Search Field" "@F"
# Disable send and reply animations in Mail.app
defaults write com.apple.Mail DisableReplyAnimations -bool true
defaults write com.apple.Mail DisableSendAnimations -bool true

# Copy email addresses as `foo@example.com` instead of `Foo Bar ` in Mail.app
defaults write com.apple.mail AddressesIncludeNameOnPasteboard -bool false
# Enable Dashboard dev mode (allows keeping widgets on the desktop)
defaults write com.apple.dashboard devmode -bool true
# Reset Launchpad
[ -e ~/Library/Application Support/Dock/*.db ] && rm ~/Library/Application Support/Dock/*.db
# Disable local Time Machine backups
hash tmutil &> /dev/null && sudo tmutil disablelocal
# Remove Dropbox’s green checkmark icons in Finder
file=/Applications/Dropbox.app/Contents/Resources/check.icns
[ -e "$file" ] && mv -f "$file" "$file.bak"
unset file

# Kill affected applications
for app in Safari Finder Dock Mail SystemUIServer; do killall "$app" > /dev/null 2>&1; done
echo "Done
. Note that some of these changes require a logout/restart to take effect.”