Posts RSS Comments RSS 111 Posts and 90 Comments till now

Archive for January, 2009

Installing gitosis on Mac OS X

Garry Dolley’s guide to gitosis installation is excellent and to the point. For those who don’t know, gitosis is a nifty tool that helps you host git repositories via one shared SSH account. gitosis manages access control for you, so you no longer need to rely on the capricious UNIX permission/group settings which is the major headache for hosting your own git repository using ssh://.

Garry’s guide is written mainly for Linux users. For Mac OS X developers, there are a few minor things to take care of, and a few others to skip. For example, /usr/local/bin is not the default path on OS X. On the other hand, you don’t need to install Python. Creating user account is a bit different too.

So here’s a short step-by-step instruction on how to setup gitosis on Mac OS X:

  1. I assume you already have git installed. If you don’t get the latest git for Mac OS X. The quickest way is to get the binary package prepared by Tim Charper and gcheshire. Get it here. Consider getting gitx too.
  2. Find a working directory you like on the target server, then check out gitosis:

    git clone git://eagain.net/gitosis.git

  3. Install it (you need to sudo):

    sudo python setup.py install

  4. Now, create a new user from System Preferences > Accounts. Add a standard user will do. There’s no need to make it an admin account. Let’s call it “git”.
  5. Login with the just created user account. Create .bashrc, fill in the line below:

    PATH=/usr/local/bin:/usr/local/git/bin:$PATH

    This is because on Mac OS X, /usr/local/bin is not in the system’s default exported path setting. We need path access to the directories above.

  6. Now, assuming you’ll be the first user and the admin, you want to use your own public SSH key to access the shared account (that’s the whole point–more on this later). Get your id_rsa.pub onto the target server, or generate using ssh-keygen -t rsa on your local machine. If you don’t know what I’m talking about, read some tutorial on SSH authentication. A quick guide like this is a good start. Be sure you already know that before you move on–this is the crucial part of using gitosis.
  7. After you get your id_rsa.pub onto the target server, login to the server with an account with sudo access (which you don’t with the standard user account we just created above). Then do:
    sudo -H -u git gitosis-init < [path of your id_rsa.pub]

  8. Now login with the standard user account “git”. In your home directory there is already a repositories/ directory, in which you’ll find gitosis-admin.git
  9. Make sure the post-update hook is executable. Do this:

    chmod 755 ~/repositories/gitosis-admin.git/hooks/post-update

From this point on, read Garry’s guide to understand how to manage the admin repository. This is where gitosis is brilliant–you also use git to fetch and update the admin settings! Once you have finish creating your first gitosis-managed repository, the rest is easy. In fact, in our cases, we simply just moved all our bare repositories to under the standard user account’s repositories/ directory. We updated the gitosis config and we got it up and running well.

Meta Ficton Op. 1

‘”Yoibito Kurushii was a hard-working programmer who loved his job and his girlfriend. One day when he came home, his jaw dropped. Every piece of furniture, every book from the shelf, everything that could be said of their shared life for the past few years, was removed. The house was so tidily cleaned that he began to wonder if he was experiencing a scene in fiction. Was his girlfriend abducted by some secret service aliens? Or space pirates? Or was his girlfriend in fact an alien herself?

Just as different scenarios went on in the different cores of his head, he noticed a piece of letter-sized paper on the floor, all uppercase letters, in Arial (yes, in Arial):

‘THE OTHER DAY I WAS NAKED AND YOU WERE STILL DOING YOUR @#$%! CODING ?!’

I was laughing out loud and told the person sitting next to me. “Hey, it’s such a nice story! I should blog it. In fact I’m blogging it right now!”

She shouted at me:

“I AM NAKED NOW AND YOU ARE TELLING ME YOU’RE @#$%! BLOGGING ?!”

I was rolling on the floor laughing and told the person …