Tag Archives: os x

Fixing Mountain Lion Runaway parentalcontrolsd

We upgraded a machine to Mountain Lion (10.8.2), but found that parentalcontrolsd was running constantly with high CPU usage. The steps to correct the problem were found on the Apple Support Forums.

  1. Disable parental controls on all users.
  2. Delete the folder /Library/Application Support/Apple/ParentalControls
    Please note that this command is a little dangerous.[code lang=”sh” light=”true”]$ sudo rm -rf "/Library/Application Support/Apple/ParentalControls"[/code]
  3. Restart Mac.
  4. Enable parental controls again.

Installing gitolite on a Mac

I’ve come to love gitolite for hosting private git repositories. It’s very easy to administer and trouble-free.

On one project, I needed to share a very large git repository between two virtual machines. I didn’t want the overhead of using a private git repository out on the Internet, just something local, like my workstation that runs OS X.

I used the System Preferences to create an account named git, and followed the gitolite install instructions.

I ran into a couple of problems that were easily resolved.

Path for Installer

First, to address gitolite complaining about not being able to find itself, I created a .bash_profile with the following:

[bash light=”true”]
export PATH=/Users/git/bin:$PATH
[/bash]

Now I could run the gitolite install cleanly. I would recommend doing this first thing after creating the git account to host gitolite.

Help gitolite Find git

I installed git from the link on the front page of the git web site. This installs git in /usr/local/git/bin, which gitolite doesn’t like out of the box. The fix is easy. When gitolite installs, it brings up the config file (~/.gitolite.rc) in an editor for you to tweak.

Find the line

[bash light=”true”]
$GIT_PATH=””;
[/bash]

and change it to

[bash light=”true”]
$GIT_PATH=”/usr/local/git/bin”;
[/bash]

This will prevent error messages such as

[bash light=”true”]
$ ssh git@localhost
PTY allocation request failed on channel 0
Can’t exec “git”: No such file or directory at /Users/git/bin/gitolite.pm line 562.
Use of uninitialized value $git_version in substitution (s///) at /Users/git/bin/gitolite.pm line 563.
hello Yourkey, this is gitolite v2.2-4-the gitolite config gives you the following access:
Use of uninitialized value $git_version in concatenation (.) or string at /Users/git/bin/gitolite.pm line 564.
R W gitolite-admin
@R_ @W_ testing
Connection to localhost closed.
[/bash]

from appearing and preventing gitolite from working.

Update 1 September 2013

These instructions seem to still work with gitolite 3, with additional commentary:

If you ssh into your OS X machine, you might see the message:

[bash light=”true”]
$ ssh git@localhost
PTY allocation request failed on channel 0
[/bash]

gitolite is still working. There is simply a collision between ssh versions. You an get a list of the repositories you’re allowed to access by one of these two commands:

[bash light=”true”]
$ ssh -T git@localhost
$ ssh git@localhost info
[/bash]

OS X, Apache, Tomcat, and mod_jk

I spent some time with a colleague from South Africa yesterday. He’s a long-time Windows user that writes in Java. He has a new MacBook Pro, and we scratched our head why Apache+mod_jk+Tomcat was blowing up on him.

JAVA_HOME

The first thing we had to get right was the JAVA_HOME variable. If it’s not set right when compiling mod_jk, you’re out of luck. On OS X there is a program that spits out the right value. We put the following in his ~/.profile. Please note the back ticks (accents graves) to run the java_home program.

export JAVA_HOME=`/usr/libexec/java_home`

mod_jk

With $JAVA_HOME set correctly, compiling mod_jk was straightforward. Download the mod_mod_jk tarball, unpack it, and change directories to the native subdirectory. The following should work cleanly.

$ ./configure --with-apxs=/usr/sbin/apxs
$ make clean ; make
$ sudo make install

Apache Configuration File

Be aware that OS X Lion has some lines (commented out) for support for mod_jk. Be sure to uncomment those lines. Previous versions of OS X don’t have these lines, so you’ll just add the load module directive and Jk* commands in the usual places.

That’s it, really. Once JAVA_HOME and the Apache configuration file were straightened out, things worked.

How to Reveal Hidden Files and Folders in a Mac OS X File Dialog

I downloaded a development tool to give it a trial run today. It reported that git support was disabled because it wasn’t on the path. I thought this odd since it works in Terminal. It turns out that the UI uses a different PATH than Terminal. That’s a topic for a different article.

The path to git is /usr/local/git/bin/git, but this cannot be selected in a file open dialog since /usr (along with other system directories) is hidden. 99.9% of the time this is no problem. Anybody who needs to dig into those directories will drop to the command line instinctively. However, this tool offered no place to type in a path. Only the file open dialog was available.

It turns out that there is an undocumented (or poorly documented) key combination to show and hide hidden folders and files. Press Command-Shift-Period (⌘⇧.) to toggle hidden files and folders on and off.

OS X Preview’s Hidden Powers

I use Preview’s ability to manage pages in PDF files after scanning pages into the computer (points number two and three). Ofttimes the back side of the page gets scanned in (I frequently use green engineering paper twenty years after college) and I want to remove those from the PDF. I also will merge pages from PDF. Drag. Drop. Save. Done.

I ran across a Macworld article called Preview’s Hidden Powers that lists of the capabilities of the built-in Preview tool in OS X. It lists a couple of other uses that you might find useful.

 

Making a Mac Tab to Drop-Down List Controls

Developers, and power users in general, tend to like using the keyboard for moving around because it’s ofttimes faster to push a key or two than pick up the dominant hand, grab the mouse, click, then move the hand back to the keyboard.

The default behaviour on OS X is to skip drop-down (“list box”) controls when using the tab key to move around, which is at odds with using the keyboard for navigation. But, this can be changed in System Preferences.

Screen shot showing where in the keyboard preferences to make the change.

Getting NeoOffice to Work on Snow Leopard

If your computer is running Snow Leopard, you may find that NeoOffice does not launch. If you click on the NeoOffice icon, it will look like the program is starting, then nothing happens. If you have the NeoOffice icon in the Dock, it will bounce a few times, then stop.

The folks at NeoOffice have posted a page on their wiki that lists Snow Leopard problems along with some solutions.

How to Fix the Problem

According to the Snow Leopard Upgrade Issues wiki page, you will need to

  1. first ensure that you’re running the latest release of either version 2.2 or 3.0, then
  2. install the patch.