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:

export PATH=/Users/git/bin:$PATH

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

$GIT_PATH="";

and change it to

$GIT_PATH="/usr/local/git/bin";

This will prevent error messages such as
$ 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.

from appearing and preventing gitolite from working.

Posted in Mac | Tagged , , , , | 3 Comments

Resetting the iPhone

I had a bit of a worry this morning, as my iPhone suddenly shut down and was unresponsive, as if the battery were completely dead.

I was able to force a reset using the instructions on the Apple web site Frozen or Unresponsive iPhone.

The gist is to hold down both the power button and the home button until the Apple logo appears and disappears. This can take 15–20 seconds or so.

 

Posted in Mac | Tagged , , | Leave a comment

Your Time is Limited

Posted in Ἀρετή | Leave a comment

Into Your Light

Some nice passionate playing. The song is Into Your Light by Leaves’ Eyes performed by Vika Yermolyeva.

Posted in Uncategorized | Leave a comment

Get PyDev Eclipse to Find zmq

If correctly installed, Python on the OS X has no trouble finding the ØMQ Python bindings. However, the Eclipse PyDev by default will not locate the zmq library within the Eclipse IDE. Therefore, if you include the following in your program,

import zmq

the program will run and debug fine, but Eclipse will underline zmq with the message “Unresolved import”.

This is easily remedied in the Eclipse preferences. Open up PyDev ▶ Interpreter – Python and add locate the pyzmq egg directory. On my machine that is under

 /Library/Python/2.6/site-packages/pyzmq-2.1.7-py2.6-macosx-10.6-universal.egg

Eclipse Preference Settings for ØMQ Python Bindings

Posted in Programming | Tagged , , , , , , , | Leave a comment

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.

Posted in Mac | Tagged , , , , , , | Leave a comment

git Over A Non-Standard ssh Port

git speaks ssh over the standard port 22 out of the box, and flawlessly. For example:

git clone git@hostname:repository_name

There are a fair number of installations running ssh on non-standard ports, however, and the above method doesn’t directly support a port, it seem. Linux Torvald answered the the question back in 2005, and suggested editing the local ssh config file. This works beautifully where Un*x is spoken, including Mac OS X.

In the ~/.ssh/config file add an entry such as:

Host host_alias
    User git
    Port port_number
    Hostname hostname

For those poor souls in Windows land, Mauvis Ledford has a tip:

$ git clone ssh://user@host:port/repository

should work also.

Posted in Programming | Tagged , , , , | Leave a comment

Installing git on CentOS

git is available as an EPEL package.

First, activate EPEL via

$ sudo rpm -Uvh http://download.fedora.redhat.com/pub/epel/5/i386/epel-release-5-4.noarch.rpm

NOTE:That exact URL will change with time. I took it from the EPEL FAQ.

Next, install the git package.

$ sudo yum install git
Posted in SysAdmin | Tagged , , , , | Leave a comment

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.

Posted in Mac | Tagged , , , , , , , , , , | Leave a comment

Cleaning Up Jammed Subversion Transactions

There was a very odd server failure while a big Subversion commit was in process. (The ISP hosting the server is kind of flaky.) To clean up the leftover files from the failed transaction, I did this:

$ svnadmin lstxns repository-path
47-1
$ svnadmin rmtxns repository-path 47-1
Transaction '47-1' removed.
Posted in SysAdmin, Uncategorized | Leave a comment