Tag Archives: Mac

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]

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.

Operating the Second DVD Tray on a Mac via the Keyboard

On Macs with two DVD drives, both can be opened and closed from the keyboard.

The primary drive can be opened and closed normally, with the eject key (⏏).

The secondary drive can be opened and closed holding down the Option key, i.e. Option+⏏.

Note:

If your computer cannot display the eject key button symbol correctly (e.g. ), it looks like this:

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.

Snow Leopard Upgrade Gotcha: Black Screen

When upgrading to Snow Leopard, I encountered an apparent bug. I started the upgrade process and walked away for a couple of hours. When I came back, the screen was black and the machine appeared unresponsive.

I assumed that the upgrade failed. Thanks to the backup program SuperDuper, I booted off of the backup, and started to restore the computer from the backup.

In the mean time, I searched in Google for an answer. I learned that the upgrade was successful, but the screen blanker had activated, and would not turn off. I let SuperDuper restore the computer to try again.

How to Avoid the Problem

Before upgrading to Snow Leopard, go to System Preferences, and click on the Energy Saver. Make a note about the position of the Display sleep slider.

To avoid the problem, move the Display sleep slider to Never. If it warns you that this will take up more energy, ignore the warning. This is a temporary action.

Upgrade the operating system per the Snow Leopard instructions. You should not encounter a black screen if you walk away. Go to the System Preferences, click on Energy Saver and restore the Display sleep setting.