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.
First, to address gitolite complaining about not being able to find itself, I created a .bash_profile with the following:
Now I could run the gitolite install cleanly. I would recommend doing this first thing after creating the git account to host gitolite.
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
and change it to
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.
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:
$ ssh git@localhost
PTY allocation request failed on channel 0
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:
$ ssh -T git@localhost
$ ssh git@localhost info
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.
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.
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.
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+⏏.
If your computer cannot display the eject key button symbol correctly (e.g. ), it looks like this:
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.
According to the Snow Leopard Upgrade Issues wiki page, you will need to
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.
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.
The World Clock widget on the OS X (Mac) Dashboard presents a list of cities representing the different time zones around the world. This is handy for those of us who have friends or do business across the globe. However, for situations where one needs Coordinated Universal Time (UTC), also known as Greenwich Mean Time (GMT) or “Zulu” Time… there doesn’t appear to be any setting.
Be sure to select the right city. London would appear to be the correct choice seeing how Greenwich is a district of Greater London… but London observes summer time, so the clock will be off by an hour for half of the year.
To show the correct time choose the fair city of Reykjavík, Iceland. Iceland does not observe summer time and is in the same time zone as Greenwich.
There are ways to hack the World Clock configuration file to add an actual UTC selection, but choosing Reykjavík is simple and quick.
MySQL Administrator is not designed to work over a secure connection like ssh. By using ssh tunneling, you can connect to your remote MySQL servers from your workstation.
Download the MySQL Tools package.
Install the MySQL Tools package. On the Mac, just drag to Applications.
To create the tunnel, open a shell (Terminal on the Mac) and run the following:
$ ssh -N -L3306:127.0.0.1:3306 username@remote_hostname
-N instructs ssh to run silently without creating a remote shell.
-L a:b:c instructs ssh to use port “a” on the local machine and map it (from the remote server’s viewpoint to port c on machine b).
Now you have a secure tunnel to the server.
If you run on a Un*x based workstation (i.e. Mac or Linux), when you run either the MySQL Administrator or the MySQL Query Browser, set the “Server Hostname” field to “127.0.0.1”.
If you skip this step you will receive the following error:
I started receiving messages about my version of subversion being out of date. Jettro Coenradie wrote an article on how to upgrade the subversion client on your Mac.
It boils down to this:
# Check for Collabnet Subversion if [ -d /opt/subversion/bin ]; then export PATH=/opt/subversion/bin:$PATH fi