Hacker News new | past | comments | ask | show | jobs | submit login

This "cool hacker settings for your Mac" script turns off your laptop's power saving features (sleep, display dimming, hibernation even though sleep was off(?)), removes at least three kinds of backups for data loss (MobileTimeMachine, Resume, hibernation file), and changes AppKit settings in a way your customers will never be using (by turning off Automatic Termination, which is pretty harmless).

Please don't run scripts like this, unless you promise not to post about how your untested configuration is so unstable and has such bad battery life after an OS X update.




Just like PC's, Macs have entered the world of, what I call, "car guys." Car guys are always fiddling with things for a tiny performance or perceived security boosts without really thinking things through. In the Windows world you'll hear them tell you how you must disable the UAC, must install registry 'cleaners', must use $av_vendor_x because $av_vendor_y sucks, fiddle with some obscure registry change, use drivers or utilities from sites laden with malware, etc, etc. As a sysadmin, these guys drive me crazy. Often, they're the dominant voice in PC or gaming forums and their advice is not only terrible, but actually makes things worse for the end user looking to solve an issue.

At least in the Windows world we have ugly GUIs and other roadblocks to making these changes easy. With OSX's scripting, you could have one single script make all these changes. Its interesting to think how terrible some random person's advice on the internet can be to your machine if you decide to type in what they say. Worse, I'm seeing a lot of FOSS/Linux stuff that more or less asks you to wget a random file on a random server into your shell and run it as root. Umm, no thanks.

The above wouldn't be so bad if they all came with well written undo scripts, but I think the "car guys" aren't even considering scenarios where their half-cooked advice would be wrong. If they did, they probably wouldn't be putting this stuff out there like this.


This is a great analogy. In high school and college, I believe I was a Windows and then Linux "car guy". One of the things I liked when I (mostly) switched to OSX from Linux was that I no longer had to spend any time fiddling with stuff. I used to find it fun, now it just feels like there's way too many interesting things to be learning about and doing to spend any time tweaking crap on my computer!


I feel there's two levels of the constant fiddler, one where their fiddling is fruitful, one where the fiddling is not. The difference, I feel, basically comes down to how much you document, test, and automate what you do.

If treated like science instead of voodoo, messing with your computer becomes one of those "interesting things to be learning."


That's how I used to feel, and then (documentation and automation or not) it totally lost its interest for me! Creating software is just so much more interesting than configuring somebody else's. YMMV.


Would writing your xmonad.hs count as configuring someone elses software, or creating your own?


Programming is very interesting and enjoyable, but it's also quite hard. The road from idea to implementation is often long and filled with obstacles. It's well worth it to spend some time "fiddling" to remove some of them. In truth, I personally am not very interested in tinkering with config files - it's boring and frustrating at times - but I still do it. I feel it's my duty as a professional as well as a pride as a craftsman to keep my tools sharp.

People who refuse to do this scare me a little. They got something somebody else told them works and they learned to live with it even if it has flaws. Now I have to wonder: how many refactors weren't done, how much technical debt piled up just because they did the same when writing code?


Interesting perspective! I think the analogy to refactoring is also apt. Keeping tools sharp is good, but (quickly, in my opinion) hits a point of diminishing returns. Refactoring is even better but also eventually hits that point (much less quickly).


> but (quickly, in my opinion) hits a point of diminishing returns.

That's certainly true - it depends on the tools you use and problems you use them to solve, but sooner or later you'll see your "sharpening" stop giving you any advantage. That's the moment you should just stop :) And maybe try other tools: but that's always a non-trivial time investment and should be done only after making sure there actually is something to be gained from the switch.

This is true in most other areas as well. For example, I'm collecting knives as a hobby. I had to learn how to care for them and sharpen them. It's incredible how sharp you can make a knife given proper tools - whetstones ans stropping - you can get an edge which is sharper than any scalpel or razor. It's also a complete waste of time to do so: it takes hours to make a knife that sharp and it takes one or two cuts to dull it. Granted, my "dulled" edge is probably still sharper than anything you ever saw ;) but in the end I get the same edge I'd get without those extra hours spent on polishing it. It then stays that way for quite a long time. It took me years to learn how much sharpening is "good enough". Now, for my primary pocket folding knife, I spend 15-30 minutes sharpening it per week and get an edge I can trust.

It's the same in programming. Both sharpening knives and tinkering with programming tools can be pleasant by itself. It takes practice to recognize that "good enough" is actually really ok and that anything more than that is a waste of time. Still, I can't imagine not sharpening my knives at all. Or giving them to someone else for sharpening. The very idea seems crazy to me.


Your story about the knives is interesting, because it sounds like all you really need is one (or maybe even zero - I'm not sure what you're doing with them) "good enough" knife, but you enjoy having a bunch and tinkering with them. That's great, and sounds pretty fun. My point in this thread has just been that at some point I realized all I really need is a simple development setup, and that I don't particularly enjoy tinkering with it.


That's why I use Ubuntu's default Unity on desktop and OSX Macbook these days. For me it just works.

Ubuntu has even more powerful window managing key bindings by default (on OSX I need Spectacle).

For all other things I just don't care.


try Amethyst on OS X : )


Still not a real window manager :(


How so? Lack of focus-follows-mouse?


Anyone who was ever 1k short of EMS to get TIE Fighter booting became a 'car guy' :)


Took me a moment to realize what you were talking about then visions of my game boot disks came flooding back. They're probably still in my parents' computer desk.


Yeah, people still recommend automatic task killers for Android and it has never been useful, just harmful on speed and battery life.


Huawei even builds this nonsense into the OS! The Mate 2 (which is neat because I get 30+hours battery) has this stupid easy-to-hit button on the app switch page that terminates everything. Despite my usage never going below a GB free, it gleefully proclaims "XXX MB freed!" Well shit, I can go buy a 1GB SODIMM and leave it on my desk and always have 1GB free.


"Automatic"? Or do you mean an application that makes killing tasks fewer taps?

Because the latter isn't that bad ... I have apps misbehave about twice a week; chrome, skype, yelp, google voice - they all need an occasional fresh start - a convenient way to do that I don't understand the objections against.



Gentoo is for people who want their bash fixes in minutes/hours not weeks.


Agreed. I make fun of Gentoo because I use it (well, more like Funtoo).


I recall that this sort of stuff was very prevalent on the Mac before OS X.


It's always been prevelant everywhere.

The biggest one in Mac OS X history I remember is haxies:

http://en.wikipedia.org/wiki/Haxie

"Haxies are a source of controversy among Macintosh software developers. Because haxies make changes to Mac OS X that Apple did not intend, they complicate the operating environment for other developers' applications, and are frequently the cause of system instability and unexpected crashes.[1] Applications by Bare Bones software display a dialog after crashing (or are force quit by the user) if haxies are detected on the system. The Omni Group routinely asks users to remove Application Enhancer modules before contacting customer support for help with their applications.

According to a post by an Apple employee on an Apple mailing list, Apple ignores all crash reports submitted by users if they show that APE is installed."

http://daringfireball.net/2007/10/blue_in_the_face

"Reports abound regarding users suffering from a “blue screen” after upgrading to Leopard: they upgrade, reboot, and get stuck at a blank blue screen.

But, as far as I can tell, there is no mystery involved. There is one and only one known cause for this problem: old versions of Unsanity’s Application Enhancer, a.k.a. APE. Versions 2.0.2 and 2.0.3 of APE are apparently inert but harmless on Leopard. But at least some, if not all, versions of APE preceding version 2.0.2 are incompatible, and will render the system unbootable if left in place during an upgrade."


I think one of the things that the author forgot to mention is that you don't have to install these as `sudo` basically, homebrew does that already but with other things there no really need for it. As of the FOSS/Linux stuff you are seeing, these aren't random files, these are mac apps see: https://github.com/caskroom/homebrew-cask


That's a common problem with all of these OS X setup helpers. I recall one floating around with a big batch of defaults settings, many of which I would never use.

That said, these projects are useful for showing off strategies for others to adopt. I treat them much like someone's heavily customized emacs or vim setups: a good reference for ideas, but only ever to be cherry picked into my own setup, and only after I understand the piece I'm picking.


It turns off hybrid sleep (where memory is written to disk when sleeping so it could eventually resume even if the battery died), as well as automatic sleep (when the lid is open). These are things I turn off 100% of the time on all of my machines.

I'm a bit dubious about the display dimming thing - I'll probably leave that on in my fork of this script.

As for Automatic Termination, I need to read more about that before I turn it _on_, not before I turn it off. :)


I agree, I seriously don't understand why anyone would ever want to run this script. Getting 8+ hours of battery life is the entire reason I use a Macbook.


Yeah, well done on OP for introducing it with a warning:

> This script should not be run without prior examination. It's quite opinionated and intended to be modified.


That's a little hyperbolic. Sure, that script stops your Mac from automatically going to sleep, but it's not like it changes the CPU usage or power usage (and it will still sleep when you close the lid).

Most of the settings in that script appear to be disabling automatic or "smart" things that average users don't want to think about and power users want done a specific way (e.g. backups, screenshots). Basically if you read that script and don't understand what it's doing then you shouldn't be running it.


Actually, I was going to check if those commands changed the lid-closed behavior and edit the post, but guess they don't.

Still, it does turn off display dimming and automatic termination - those can both affect the leaving laptop on a table unplugged case, one much more than the other.


You're missing the rather well placed claim that people should not run the script blindly but indeed read the comments of the script, and only use the parts that they want to. This is an Administrators' script - most admins worth their salt read the scripts they're about to run, especially if bold claims are being made about their efficacy.

There are lots of great things to learn in the settings being tweaked in this script ..


Completely agree, you should definitely closely inspect any script you run, before running it. These settings have been working well for me, but I may tweak them in the future.


and why bother 99.9% of the time your not going to be using OS10 in production

Just use esxi and run a hypervisor running boot mac os and what ever your production environed if you must have the mc os shiny


I agree with you 100%. I bought a new mac book pro 2 weeks ago and it took me about 2 hours to get up and running.

Because OS X is linux based (BSD but the difference is not relevant here), a lot already exists to make these kind of things work out of the box.

Personally, I need two things to have my setup working:

  - Homebrew (OS X only but it's a given to anyone used to ruby)

  - dotfiles
My dotfiles are on github and git can be installed via homebrew. I am using vim so my setup depend on both homebrew (git) & dotfiles (settings/plugins).

I have no idea why I would need anything more than that to get started. But this is personal, your company needs may be different. But don't think you need some kind of automation, linux has powerful tools. Use them.


> Because OS X is linux based

Wait... what?

> (BSD but the difference is not relevant here)

Still, "Linux-based" is a funny way of saying "Unix-like". Is HP-UX also "Linux-based (System V but the difference is not relevant here)"? ;)


Oh dear... Its not even BSD-based... Its Mach based(http://en.wikipedia.org/wiki/Mach_(kernel)) with a BSD userland. (Read BSD-API). So its "BSD-based" in the same way as Windows is Posix-based (as it too can have a Posix userland API).

Linux != UNIX. BSD != OSX


The kernel is actually a hybrid of Mach and FreeBSD. See http://en.wikipedia.org/wiki/XNU for details.


The word you are looking for is "unix".


I always got the feeling that installing Homebrew and running the associated apps that run under X but not natively under Quartz was a broken way to get apps on Mac OSX (unless it runs under Quartz now...?)

It feels like the "dirtying" of the native system in the same way that installing cygwin and a mingw and GNUWin32 on Windows does, just in order to get it more like Windows. Rather, I'd use the native utilities on the system and native compilers.

Is it just me who feels this way? Does any Linux user feel compelled to install Linux and then run software ONLY under Wine?




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: