Mac

Later Ctrl + ↑

Fix sudo on a Mac

Sometimes the sudo command stops working for reasons beyond human understanding. When you try to sudo anything, it says: “no valid sudoers sources found”.

It happened to me twice. The first time it happened to a MacBook. I tried to make some changes to the sudoers file, but it didn’t help, and I gave up. After adding an SSD drive to my Mac Pro and moving the system to it, it happened again. Mac Pro is my main working machine, so I had to fix it this time.

Turned out the problem was with the permissions on the root directory. Presumably I’ve somehow broken them while moving my system.

I found a working solution on MacRumors forum. Here’s what you do:

  1. Restart your Mac is a single-user mode (press and hold ⌘+S during boot until you see command prompt).
  2. /sbin/fsck -fy
    check the filesystem integrity (not sure it’s necessary, but I did it anyway).
  3. /sbin/mount -wu /
    mount the root filesystem.
  4. /bin/chmod 1775 /
    fix the permissions.
  5. /bin/sync
    commit the changes to filesystem.
  6. exit

After booting to the normal Mac environment, you may also need to repair permissions with the Disk Utility.

 4040   2012   Mac   solution

Some details in Mountain Lion

  1. Launchpad no longer displays all the Adobe’s crap “apps” (the likes of “Uninstall Adobe Flash Extension Manager Help Center Updater”). Somehow it learned to distinguish between real apps and this useless stuff.
  2. Apple for some reason decided that Launchpad should have not eight, but seven icons in a row, which broke all my logical page arrangements. Oh well. Had to reorganize it. I hope in ML it will at least remember the positions well and don’t shuffle them unexpectedly. By the way, search in Launchpad is great.
  3. When you delete a file in Finder, it no longer moves selection to parent directory. Huge win (via Aleksander Karpinsky).
  4. Many have already pointer out that the battery icon in the main menu no longer has an option to display time remaining, only the percentage. But what’s more important, when you ask it to display percentage, it now displays it to the left of the icon (iOS style) and doesn’t enclose it in the stupid, useless and noisy parentheses. I wonder what made them use those parentheses in the first place. Anyway, I don’t want to see the percentage anyway.
  5. In Calendars, when some of the day’s events are out of view (i. e. you are viewing a schedule from noon to midnight, but you have an event in 9 am), they are still shown as small “tails” on the edges, so while you don’t see what event or events are there, you least know that there is something.
  6. In Mail, if you put a folder (e. g. “Projects”) in the bookmarks bar, it no longer behaves like a pull-down menu. Instead, it takes the name of the form “Projects — The TTP Project” using the name of the subfolder you last opened and opens that folder immediately. To see the whole list of subfolders, you need to click the little triangle on the right.
  7. When you right click a mail and select “Move To”, Mail no longer displays the whole mailbox hierarchy for you to pick a folder. Instead, it shows just the top-level folders, any of which you can hover to reveal a submenu of its subfolders and so on. This made the “Move To” command almost impossible to use, because the menu structure is just too fragile to use confidently. This turned out not to be true. In reality Mail displays each folder as a menu of its own if it is collapsed in the mailbox sidebar and as a list of subfolders if it is not. And it does the same in Lion. The reason for my experience is that in Lion I had all my hierarchy expanded and in ML it was not.
  8. You can now drag a file from somewhere to an app icon in Launchpad to open with. Start dragging, then press your Launchpad hotkey (it’s ⌘Esc for me) and drop a file on an any icon that would accept it. Cool.

What else?

 27   2012   Mac

Button text in Mountain Lion

John Siracusa in the review:

Creating a new document and then immediately closing without saving now shows a dialog box whose far-left button is labeled “Delete” rather than the milder “Don’t Save”. The same button in the dialog that appears after selecting the “Duplicate…” command and then immediately closing the duplicate window is now labeled “Delete Copy” instead of “Don’t Save”.

Nice touch.

 13   2012   Mac   user interface

Two stupid windows on a Mac

There are two stupid windows on a Mac that annoy the hell out of me.

This one appears on my main machine in a couple of minutes after I close the lid of my notebook:

It tells me that the remote volumes are no longer available, which I well know and don’t give a shit about. What am I supposed to do with this information? If I were using the volumes in any way, like copying a file, I would have noticed the problem long ago (as the file would stop copying, obviously).

Additionally, it has two buttons that do exactly the same thing: nothing. No matter what I press, the volumes are no longer available and I can’t do anything about it. What do you mean “Disconnect All”, it’s been disconnected several minutes ago, and we both know it. This window should be killed.

This second one appears one in ten times when I change something in iCal:

Now what is that? Not only are they dumping some cryptic server messages onto me, they are also presenting me with a choice. What am I supposed to do here? I don’t want to go offline, because why would I, and I don’t want to “Revert to Server” because I have no idea what it means.

“Revert to Server” is the default one, so it feels like it’s safe to choose it, but I’ve learned that it actually undoes my latest change. There’s no excuse for that: I’ve made my change for reason. Why would you even offer me the choice to undo it, let alone make it the default one? And “Go Offline” actually saves my edit and syncs it to iCloud (when it’s in a better mood later). Someone in iCal department should read Raskin and learn that user’s input is priceless, and it should always be saved by default.

Just change the button names to “Save and sync when possible” and “Forget what I’ve just done”, and it would be ridiculously obvious that this window, too, is useless and should be removed.

 55   2012   bugs   Mac   user interface

Quickly convert any text to plain text

Some apps don’t have “Paste unformatted” or “Paste and match style” command. So you want to convert your text to plain text before pasting. What’s the quickest way to do it on a Mac? Here’s what I do:

  1. Control+Space (Spotlight, it may be ⌘Space on your machine).
  2. ⌘V.
  3. ⌘A.
  4. ⌘C.
  5. Control+Space again.

Now whatever you had in your clipboard is converted to plain text.

 6   2012   lifehack   Mac

Moving OS X Lion windows by dragging the borders

Did you know that you could not just resize, but also move a window by dragging its border in Lion?

When you drag left or right border horizontally, you resize the window. But if you try to drag it vertically, the whole window will move. Same thing with top and bottom borders: try dragging them horizontally to move the whole window. Nice touch.

By the way, if you’ve missed it, when resizing Lion windows you can use Alt and Shift the way you do in Photoshop (to resize from center and to preserve proportions respectively).

 9   2012   Mac   user interface

Retina Macs before summer?

I believe retina Macs will be announced before summer. Here’s why: in summer, OS X Mountain Lion will get released, but substantial work on HiDPI support has just been done for 10.7.3. Why the rush? Summer is too late, I guess. I won’t be surprised to see the new Macs announced in March along the new iPad. It’s all about displays, so it would make sense.

 33   2012   Mac

When “optional” means “unreliable”

Some time ago there was a discussion about iPhone’s ring/silent switch and the way it does not mute some of sounds. Namely, it doesn’t mute timers and alarms, music and video. So only the sounds you don’t control and don’t explicitly ask for (i. e. calls, texts, emails, other notifications) are muted. Turns out, some people don’t like this behavior and would prefer the switch to just mute everything. I’m with Guy English here: I don’t want anyone but the alarm clock to wake me up.

But some say, well, if it’s a matter of personal preference, why couldn’t this have been optional? Obviously, there’s already way too much stuff in Settings app and adding even more options is a bad idea. And Apple is famous for not liking options. But there’s a reason, I’ve found, why adding this option would be a particularly bad one.

On a MacBook there’s no way to choose what it does when you close the lid, it just goes to sleep. On Windows notebook this is a matter of user preference. Some prefer their machines to continue working after being closed, and it makes sense if you want to, say, download an HD movie overnight. Why not add this setting on a Mac?

As a Mac user I would not welcome this setting. Having no choice means closing the lid is a reliable way to sleep my notebook. I just close it, I don’t have to double check before putting it into a bag. It won’t drain my battery or overheat just because I forgot to change the stupid setting. It will go to sleep (there are some smart exceptions which are irrelevant in this discussion). On Windows you are never sure. You can’t rely on a notebook to do the right thing. You have to double check every time.

If there were a way to choose whether ring/silent switch mutes all sounds or just calls and notifications, I’d never be sure my alarm would wake me up. I would have to double check this setting every time. And one day I will oversleep and miss an important meeting. Who would be to blame?

So sometimes “optional” means “unreliable”. I wonder if readers could provide more examples of this.

 39   2012   Apple   design   iPhone   Mac

When people get a Mac

There are many explanations to the fact that some prefer Mac to Windows. They suffer religious fanaticism. They worship Steve Jobs. They want to impress others with an expensive gadget. After all, no one argues the power of Apple’s marketing.

But the idea that Macs are of higher quality and reliability seems unfounded. Obviously this can’t be true. Those who choose Macs are fooled. Marketers make naïve people buy expensive things with fictional advantages. The members of the Mac sect aren’t intelligent enough to understand that Mac is just a dummy in a sweet box.

In the last couple of years five or six of my anti-Apple friends who loved to make fun of Macs, switched. Quickly their homes became full with Apple gadgets. And now they help their relatives and friends switch too. It’s pain to see how people become dumb and unreasonable. It’s pain to see how they lose their ability to confront the Apple Church evangelism. It’s pain to see them outsmarted and robbed by selfish “entrepreneurs” from Cupertino.

Once we were discussing Macs and fanboys with Evgeny Stepanischev, and he said: “When I used Windows I thought you were a fan, but I no longer think so”. Not long ago John Gruber gave a definition of fanboy: “Someone who began using Apple products before you did”. These are striking examples of previously normal people losing control of their action and mind. How to make these people regain reason and common sense? How to escape the terrible crisis?

 8   2011   Gruber   life   Mac