Install Gitorious on CentOS 5

Recently I had to install Gitorious on a CentOS machine. Instructions on how to do this are in a document inside the gitorious code base, but since I needed something repeatable and reliable, I’ve turned to my tool of choice – Puppet.

So I’ve created a Puppet recipe which installs Gitorious behind a Phusion Passenger/Apache setup. You can get it on GitHub, here. The steps you must follow to use this recipe are:

  1. Install the base OS. I’ve tested it on a bare-bones machine, installed via the CentOS-NetInstall iso disk. I then just picked the Base packages and started the install.
  2. Add the Epel repository in order to get rubygems working. There are other ways of doing this (from source, other 3rd party repos) but this is the way I did it.
  3. Install rubygems: yum -y install rubygems git
  4. Install puppet from gem repos: gem install --no-ri --no-rdoc facter puppet
  5. Clone the repo into /etc/puppet:
    sudo -i
    git clone git:// /etc/puppet
  6. Go into modules/gitorious/manifests/init.pp and change the value of $mail_server to match the SMTP server you want.
  7. Run the standalone puppet tool to apply the recipe on the local machine puppet /etc/puppet/manifests/site.pp

That’s it. Just point your browser to http://yourserver/ and you should be greeted by the Gitorious page.
Be aware though, that if you do not set a fully qualified domain name (e.g. server.domain) you won’t be able to login or perform other actions that require a valid session in Firefox.


Get duplicate line shortcut working in Ubuntu

Problem: The default keyboard shortcut for duplicating lines (ALT + CTRL + Up/Down) does not work
Configuration: Ubuntu Jaunty, Eclipse 3.5

This is caused by the system using the same shortcuts to move to a virtual workspace above and below. Go to System > Preferences > Keyboard Shortcuts and assign a different key combo for the following two actions:
Switch to workspace up
Switch to workspace down
Duplicate lines works again.

Open files in gvim in new tabs

Aim: when hitting F4 in GnomeCommander, the file will open in a new tab of the existing gvim instance:
Options1: visual:

  1. Open Gnome Commander => Settings => Options => Programs
  2. In the Edit text field put this:
    gvim -p --remote-tab-silent %s
  3. Save and restart Gnome Commander – not always needed, but helps

Option 2: editing the settings file:

  1. The file to edit is ~/.gnome2/gnome-commander
  2. Find the line :editor=blablabla and change it to :
    editor=gvim -p --remote-tab-silent %s
  3. Save and restart gnome-commander

Fix iTunes + Windows 7 + iPhone

Update: Using the latest iTunes 64bit with Windows 7 64bit, I had no more problems. Can’t vouch for 32 bit versions, though.

After a first successful sync of my iPhone with iTunes on Windows 7, I rebooted my PC. Consequently, any attempt to start iTunes with my iPhone plugged in results in an error dialog:

“iTuness cannot connect to this iPhone because the required software is not installed. ….”
The message also suggests a fix – removing and re-installing iTunes using the iTunes setup package.

Real solution:

Obviously the method the error dialog suggests does not work. Instead, the following steps do:
1. Go to Control Panel > Programs > Uninstall a program
2. One by one remove the Apple Mobile Device, Bonjour and iTunes programs
3. Reboot the machine
4. Use the iTunes setup package to install again
5. Reboot your PC
6. Sync (finally)

Setting up subversion on Windows

svn logoToday I had something to test that required a svn repository. Since my home repository wasn’t answering my calls (well, pings actually) I decided to do a quick install of the svn server on my Windows XP box. From what I remembered it should have been simple enough.

After restarting all the process at one point, because I hadn’t paid attention to the warning about Apache 2.2, I found my Apache 2.0 refused to load the dav_svn module and couldn’t figure out why. A quick search on Google revealed the cause, but it still was annoying. Continue reading