osx-lion interview questions

Top osx-lion frequently asked interview questions

/etc/hosts getting reset in Lion

In order to do web development on my local machine, I use the /etc/hosts file to define hosts that point back to to which I have Apache serve up via VirtualHosts. This works great, except that now it seems that Lion resets my /etc/hosts file every so often.

Has anyone else experienced this? Is there any way to keep this from happening?

I never had this problem in Snow Leopard.

Source: (StackOverflow)

How to make Mission Control keyboard friendly?

In Snow Leopard, when you Expose, you can navigate to each window by using the keyboard arrow keys. With Lion, this is not possible anymore. Does anyone know how to make the arrow keys work in Mission Control?

Source: (StackOverflow)

How to stop in Lion creating an Archive folder for archiving in Gmail? in Mac OS 10.7 added an Archive button. Unfortunately, when archiving a message in a Gmail account, instead of simply putting the message into All Mail folder, creates a folder called Archive (in Gmail web interface this folder comes up as [Imap]/Archive) and puts the message there. Is there a way to tell Mail to put the archived messages into Gmail's All Mail instead?

Source: (StackOverflow)

How do I make the Spotlight menu hint bubble go away in OS X Lion?

In Mac OS X Lion when you bring up the Spotlight menu and start typing something, a large-ish hint bubble will pop up to give more info about the selected result. That's all well and good except that it occasionally gets stuck and I can't make it go away.

Is there a way to get rid of this window without resorting to logging out?

Alternatively, is there a way to just get rid of those popups altogether?

Screenshot of stuck Spotlight Pop-up

Source: (StackOverflow)

How can I assign the F5 key to be refresh in Chrome on Mac OS X?

I'm used to the F5 key being the Refresh command (as it is in Windows OS for every browser I've ever used there) and not Command-R (which takes two fingers). On Mac OS X Lion, how can I assign the F5 key to be refresh inside Chrome?

Source: (StackOverflow)

Mac OS X (Lion) Chrome: shortcut for "Search With Google"

Under Keyboard Shortcuts : Application Shortcuts I've already tried with either "Search With Google" or "Google Search..." as the Menu Item (both of these for Application set as Google Chrome, of course).

Also, even with Chrome as the default browser, the Search With Google (under Services : Searching; which works) always uses Safari.

In short, how do you set up a keyboard shortcut to avoid right-clicking the selected word and choosing Search Google for 'the selected word' from the right-click menu?

Thank you.

Source: (StackOverflow)

Errors in Homebrew on OS X Lion

I just ran the Homebrew script as described in the installation page. I then ran brew doctor in Terminal, and it returned several errors. I'm not sure how to fix those errors, please help.

brew doctor

Error: Some directories in /usr/local/share/man aren't writable.
This can happen if you "sudo make install" software that isn't managed
by Homebrew. If a brew tries to add locale information to one of these
directories, then the install will fail during the link step.
You should probably `chown` them:

Error: You have Xcode 4.2, which is outdated.
Please install Xcode 4.3.
Error: Unbrewed dylibs were found in /usr/local/lib.
If you didn't put them there on purpose they could cause problems when
building Homebrew formulae, and may need to be deleted.

Unexpected dylibs:
    /usr/local/lib/libcdt.5.dylib    /usr/local/lib/libcgraph.6.dylib    /usr/local/lib/libgraph.5.dylib    /usr/local/lib/libgvc.6.dylib    /usr/local/lib/libgvpr.2.dylib    /usr/local/lib/libpathplan.4.dylib    /usr/local/lib/libxdot.4.dylib
Error: Unbrewed .pc files were found in /usr/local/lib/pkgconfig.
If you didn't put them there on purpose they could cause problems when
building Homebrew formulae, and may need to be deleted.

Unexpected .pc files:
    /usr/local/lib/pkgconfig/libcdt.pc    /usr/local/lib/pkgconfig/libcgraph.pc    /usr/local/lib/pkgconfig/libgraph.pc    /usr/local/lib/pkgconfig/libgvc.pc    /usr/local/lib/pkgconfig/libgvpr.pc    /usr/local/lib/pkgconfig/libpathplan.pc    /usr/local/lib/pkgconfig/libxdot.pc
Error: /usr/bin occurs before /usr/local/bin
This means that system-provided programs will be used instead of those
provided by Homebrew. The following tools exist at both paths:


Consider amending your PATH so that /usr/local/bin
is ahead of /usr/bin in your PATH.

Source: (StackOverflow)

Why does OS X Lion ask for my password whenever I delete a file in my home directory?

I updated to Mac OS Lion and now every time I delete any file it asks me for my password. Any file - be it on the Desktop, in the Downloads folder or in any other place. It asks me for my password every time.

That behaviour is annoying. Is it the new default? Or there is something wrong?


For example: this file, which is located on the desktop.

➜  Desktop  l | grep terminal
-rw-r--r--@   1 Nerian  staff   841913 22 jul 14:16 terminal.png


Seems that quite a lot of people are having the same issue:


I can delete the same file – a screenshot in the desktop – using the terminal and I am not prompted for a password. If I use the GUI then I am prompted.

Also, If I create a new account and make a new screenshot and try to delete everything works just fine. No password required.

When I am prompted for my password and I write it, the file is then deleted yet it doesn't appear in the bin.

Source: (StackOverflow)

PostgreSQL homebrew installation lacks config files

So I successfully installed PostgreSQL 9.1 on MacOSX Lion. Unlike people say, I didn't have to change the PATH and no other version of PostgreSQL was installed on the system ($ psql --version shows psql (PostgreSQL) 9.1.4).

However, when I try to run the server with pg_ctl -D /usr/local/var/postgres -l /usr/local/var/postgres/server.log start it doesn't work. First, it says no dir /usr/local/var/postgres/ exists. Fine, created one. Then it says the permissions are wrong - fine, changed them. Then it requires postgresql.conf file to be in this dir.

Now, I found sample configs in /usr/local/Cellar/postgresql/9.1.4/share/postgresql, but I'm not sure this is what it's supposed to be like. All the manuals I've seen on the web did not mention creating config files out of samples. Shouldn't homebrew be providing this out of the box, so that I simply start the server right away?

Source: (StackOverflow)

How do I uninstall Google Chrome *completely* from my Mac?

I have 2 iMacs and just installed OS X Lion (clean install) on one of them (let's call it iMac A). Did a time machine backup and restored that backup to my other iMac (B) to avoid installing twice. Everything works perfectly except that Google Chrome is extremely slow on iMac B (where the time machine backup was restored to). Opening a new tab is slow, opening a web page is slow etc. Safari on B is fast and works like on A, so it's just on B that Chrome is slow (and Chrome is my preferred browser, so I'd like to get it up to speed).

To solve the problem on B, I've tried uninstalling Chrome by dragging it to the Trashcan and emptying it. Then re-installg Chrome. But all my settings, extensions etc. are still there and it's just as slow as before.

Downloaded AppCleaner and did an uninstall with that, but still, when I re-install Chrome I have all my extensions etc. and it is as slow as before the re-install.

Does anyone know how to completely uninstall my Google Chrome browser so I can do a fresh install of it?

Source: (StackOverflow)

Resume Zsh-Terminal (OS X Lion)

OS X Lion has "Resume" feature, i. e. when you reopen an app it restores all windows and their contents. That works for Terminal as well. But if you use Zsh instead of Bash it doesn't restore opened directory. How can I fix this?

Source: (StackOverflow)

How can I remap the Caps Lock key in Mac OS X Lion?

I would like to remap the Caps Lock key to some other unused key (in a system-wide fashion).

Being a user, I always liked to idea of remapping the Caps Lock key to some other key such as the "Help" key or the "End" key in order to use that piece of keyboard real estate to enter and exit insert mode.

Previously, in Mac OS X Snow Leopard, several options existed to do this, such as the excellent PCKeyboardHack which enabled the user to chose the key code that the caps lock key would send to the OS and operated at the driver level it seems. Or the other tool called DoubleCommand. None of these options work anymore under Mac OS X Lion (Gold Master). I tried to install them none the less and ended up with a kernel panic.

The "Keyboard" preference pane in the system preferences of both versions of Mac OS X has the possibility of remapping the caps lock key built-in as you can see in these pictures. But only to one of the other three modifier keys: namely "Control", "Command" and "Option". This is evidently not sufficient for creating a macro in vim. The Caps Lock key needs to be remapped to some other non-modifier key.

Other answers found in previous questions often contain a suggestion to use the Ukulele tool. This program has never had the ability to remap the Caps Lock key.

Other keyboard modifying software such as Consistent Keyboards has similar functionality but will not solve the problem.

Any help greatly appreciated !

Source: (StackOverflow)

Mac - Convert from Case-Sensitive to Case-Insensitive File System

So I just got my first Mac. After getting everything set up just the way I wanted it I decided to install Steam. When I opened Steam it said something about not supporting case-sensitive file systems...

I did some googling and found that Steam won't be the only application that gives me this trouble. Photoshop (when I eventually install it) doesn't support case-sensitive file systems either. I'm sure there are other applications as well.

There is at least a work around for Steam, but it involves disc images and symbolic links. Not very fun. It works, but it's not very fun (and Steam is supposed to be all about fun, no?). I am not aware of any work arounds for Photoshop.

So here's my question. Can I boot into the disk utility, format the drive to be case-insensitive, and then restore from time machine? Are there any technical limitations that would prevent me from doing this? I haven't named anything like Folder 1 and folder 1 yet, so I am not aware of any collisions that would show up.

Source: (StackOverflow)

Mac Lion: fstab is deprecated. so what replaces it to prevent a partition from mounting?

If fstab is deprecated in Lion (and before, I think?) how does one, properly, prevent a partition from mounting on system boot?

This is loosely related to this question which as of this post has no answer.


So my confusion comes from reading about fstab and being told to edit /etc/fstab.hd. So.../etc/fstab is what I need to create and where I add UUID info to prevent partitions from mounting?

$ cat /etc/fstab.hd 
This file does nothing, contains no useful data, and might go away in
future releases.  Do not depend on this file or its contents.

Source: (StackOverflow)

Start configured VPN from command line (OSX)

I have two VPN configurations on my mac and I would like to be able to start them from the console when I ssh into my machine.

I have found the command networksetup which allows me to configure connections, but as far as I can tell not actually start one.

Using Lion.

Source: (StackOverflow)