~/.osx updated — sensible hacker defaults for OS X Mountain Lion
github.com
github.com
Edit: I should note that I learned this the hard way starting out, I went backwards by ripping out things that didn't work for me/did not like, but not until after making some horrible mistakes!
TL;DR This repository is meant to be forked, not used as-is.
Have a look at it - there really is some good stuff in there. This file, and then all the cool tweaks to the Cocoa text engine that you can make, make OS X a tough OS/environment to beat.
Or did you mean that you know of a whole bunch of other tweaks that should be on the list? If so, add them and send a pull-request.
Eh, a lot of it is just some guy's arbitrary preferences, with little or nothing to do with "experienced or demanding users". Stuff like hiding the bookmarks bar in Safari or showing track notifications in the Dock is experience neutral.
Other than that, there's a few nice tweaks (like unhiding ~/Library), and the occasional disastrous idea (killing the executable quarantine).
Completely agree - but someone has to keep this compendium somewhere, and why not keep it as a piece of working code, rather than as a web page or something? If you end up having to use a lot of different Macs and have to set up new accounts for yourself on a regular basis, what you'd probably do is fork the project here, eliminate the stuff you hate, and then that's your acceptable-mac-environment-maker script.
occasional disastrous idea (killing the executable quarantine).
Out of curiosity, why is this disastrous? I'm not a fan of the idea, but I can imagine how someone might come to hate com.apple.finder.quarantine badly enough to do this? Maybe this particular tweak should be commented out by default, though.
I think this would make sense if it was a compendium, but this is an arbitrary subset of everything you could possibly set via defaults, with no rhyme nor reason to what is and isn't in the list other than "this particular guy cares about these particular things".
> Out of curiosity, why is this disastrous? I'm not a fan of the idea, but I can imagine how someone might come to hate com.apple.finder.quarantine badly enough to do this?
I can imagine being annoyed at any number of things, but that doesn't mean turning them off is a good idea.
Security is all about layers, and disabling an important layer (and especially a layer you'll rarely trip over once you have all your commonly used apps downloaded) doesn't strike me as a bright idea. It only takes one bug in your browser of choice to con it into launching an arbitrary executable, or one asleep at the wheel moment to trick you into double-clicking a cleverly icon'd malicious app; the quarantine is your mitigation against such events.
The last time someone really thought about scroll direction was when they invented the scroll wheel. The implementors associated it with the motion of the position indicator in the scrollbar rather than the motion of the document. The reason this is wrong is because it's an unnecessary indirection from the document itself. At the time computers could not documents quickly enough to have any kind of physicality, so the scrollbar + indicator were critical UI elements simply for performance reasons (ie. the scrollbar is what could be drawn fast enough to enable responsive dragging, and the window wouldn't redraw til you let go). Once people got used to it, there was no reason to question it until the modernization of touch interfaces where suddenly the inconsistency became apparent.
What was the gain for disorienting the users by introducing a new default? An improvement in acceptance by users who had only used tablets and phones but never PC's? Is that a large set?
The "standard" way of doing it never made sense to me, even with a mouse scroll wheel. I scrolled down and the page would go up--how did that ever makes sense?
defaults write com.apple.LaunchServices LSQuarantine -bool false
This is a terrible idea. If your browser, or anything else, is ever conned into downloading and opening a file, the quarantine is the difference between "what the fuck, why is an executable I've never launched before trying to launch?" and silently getting owned.Now, you could hardcode a list of "safe" apps, or add some kind of "I swear I'm safe" declaration to the app's plist, but that has its own set of problems. A one-time "this seems funky to me, are you actually intending to do this?" is a simple and safe default.
But in that sense an executable file isn't any different from a non-executable file, is it? The default app for the file could do equally dangerous things with a non-executable.
Also, how many applications actually _execute_ (bare machine, vm's don't count) content? My guess is that few if any of the applications a user opens that isn't executed by finder itself is going to execute the file's contents.
That said, even the author notes that this is designed to be forked. It's not a script to run on one's own machine blindly, the idea being to exclude what is not to your taste/while demonstrating features which can't be changed inside the gui. (It's also very helpful if setting up multiple accounts.)
A much more likely threat is a malformed jpg or pdf designed to exploit a decoder, in which case the executable bit is completely irrelevant. Warning the user about the executable bit protects them from nothing, unless Finder is preparing to execute the file itself. It is a warning that is always ignored, and pointless warnings only make the system less secure.
And working with multiple quarantined documents exposes more bugs.
It's not a thoughtfully designed feature. If they ever fix it I would gladly reenable it.
Its 'guess the character encoding' code also might have a 'wait a minute, this is RTF/PDF' feature.
Of course, Apple could trust its own apps, but I think they should not (why increase the attack surface?) and that would lead to complaints "why can't I tell this OS that my text editor can be trusted?".
I also think (but have no data on it) that this "open a .txt file you downloaded" check is very rare for 'normal' users. If they download at all, it is Word documents, PDFs, movies, and applications.
A shell script.
jtm@socrates ~ $ cat ~/Local/bin/unquarantine
#!/bin/sh
for i in com.apple.metadata:kMDItemDownloadedDate \
com.apple.metadata:kMDItemWhereFroms \
com.apple.quarantine; do
xattr -r -d $i "$@"
doneI download almost everything from the net - how else would I install? CD? Floppy? Telling me that it's downloaded from the internet doesn't do anything to identify that it's dangerous and so I ignore the warning.
Under what circumstance would I go "whoa, maybe it's dangerous this time"???
Mac's don't have auto-install .exe files. Yet we get warning for everything from JPEGs to TXT to DMG. Ridiculous.
If there's a vulnerability in the application used to open a JPEG or whatever, you can execute code.
It's less asking "is this dangerous?" and more "did you download and open this?"
1. Download the file. Any website can do this by design.
2. Get LaunchServices to open the file. This requires at least one vulnerability.
3. Bypass quarantine. This requires at least one additional vulnerability.
I don't know why it cares about the executable bit(?) in this case, though.
# Finder: allow text selection in Quick Look
defaults write com.apple.finder QLEnableTextSelection -bool true
Combined with "Use OSX Finder Quicklook (Spacebar) to preview all plain text files"[1] is pretty useful. # Set language and text formats
# Note: if you’re in the US, replace `EUR` with `USD`, `Centimeters` with
# `Inches`, and `true` with `false`.
:) defaults write -g NSScrollAnimationEnabled -bool NO
It disables the stupid "smooth scrolling". on Lion (and everything before that) you could disable it from the 'General' tab of SysPrefs, but now it's gone.What does it do? When you press spacebar in a web browser, or fn-downarrow in a text editor, it "smoothly" bring new content up from the bottom of the screen and pushes current screen up.
I don't know, maybe it works great on recent machines, but my poor old 2009 MBP's graphics card is not really powerful, and this animation is not smooth at all. It distracts me a lot.
I strongly suggest you at least try it. If you don't like it, just replace NO with YES and everything's back to normal.
I've very occasionally run across corrupted disk images, which is what this catches.
And no, it isn't my system, it's Apple's servers; only have the problem with downloads from them.
Does anyone know how to alter / remove the animation from horizontal motion between spaces? Particularly when using the keyboard shortcuts, this whizzing is disorienting and irritating.
I assume it is not possible, given that animation seems to be keenly bound to the trackpad 'peeking' operation and all.
http://pqrs.org/macosx/keyremap4macbook/
It does that, and many more useful things too. I have command on mac, and from a different app, control on my ubuntu machines mapped to caps lock. So wherever I am, I can use the same key combo...
# Trackpad: map bottom right corner to right-click
I recommend one close readthrough, uncommenting or commenting things you do or don't like, and then a full run. I do recommend running the script after a careful edit. It will save you time.
`defaults write com.apple.dock "expose-group-by-app" -bool true`
Can't believe any hackers would use this. Mountain Lion was worth $20 just for the new `false` alone.
Terminating inactive apps doesn't work right. Often you'll try to reopen an app (such as Preview) and it's stuck: finder thinks it's already open but it's not. So you have to force close it and reopen it.
There's a lot of ideas in Lion & MLion that clearly should never have passed if there was a tasteful gatekeeper at the helm, but now everyone's a UX expert and it's a sloppy, half-baked mess of random, unchangeable preferences.
HAHA! What?
How on Earth are these sensible
> # Disable the warning before emptying the Trash
> # Empty Trash securely by default
> # Disable the “Are you sure you want to open this application?” dialog