Skip to main content

Opening Post

iCode : Do You Love Coding As Much As We Do ?

for a demo :

visit :

iCode is a GIT hosting facility, with custom administration tool and web interface. Thus iCode is much much ahead of being just a normal git server.

I assume you have a decent knowledge of what GIT and version control is. In case you don't, here's the resource.

Now, moving ahead.

Every Git clone is a full-fledged repository with complete history and full revision tracking capabilities, not dependent on network access or a central server. Branching and merging are fast and easy to do.


Before starting, make sure that:

1. You already have a Ubuntu 9.04 installed on your server.
2. You have a working internet connection.
The following instructions will guide you on how to set up and run a fully managed iCode for projects using git on your server.
We assume a setup of 2 Computers. The SERVER and the MANAGER.


1. sudo apt-get install git-core
2. sudo apt-get install python-setuptools
3. cd ~/src
4. sudo git clone
5. cd mygitosis
6. python install
7. sudo adduser \
--system \
--shell /bin/sh \
--gecos ‘git version control’ \
--group \
--disabled-password \
--home /home/git \


8. ssh-keygen -t rsa
    a. press “enter” two times
    b. this generates a public/private RSA key and saves in /home/<username>/.ssh/
    c. Transfer this key to the /tmp of the SERVER


9. sudo -H -u git gitosis-init < /tmp/
10. sudo chmod 755 /home/git/repositories/gitosis-admin.git/hooks/post-update


11.  cd /var/www
12.  sudo git clone git@YOUR_SERVER_HOSTNAME:gitosis-admin.git

(If the cloning doesn't work, maybe you have PermitRootLogin no in the SSH server, and you need to add gitosis user to it.)

    a. sudo vim /etc/ssh/sshd_config
    b. AllowUsers git

13.  cd gitosis-admin 
14.  Use your favorite editor to modify the contents of the mygitosis configuration file:
15. cd gitosis-admin
16. vim gitosis.conf

Adding a new project to the repository

Here is an example of the gitosis configuration file you clone before. Here it contains the default gitosis entry, and a new project entry:


[group team]
writable = testproject
members =

[group gitosis-admin]
writable = gitosis-admin
members = keyfilename or keyfilename is the name of the public key without .pub extension you copied into gitosis-admin/keydir/ directory.

17. After you've done editing, save the file, and commit it back to the server.

    a. git commit -a -m "Added a new project"
    b. git push

18. Any future projects will be added the same way.

Committing to the first project

To commit the project you just created, initiate a new git project, add files to it, commit it, then push it to your repository with the name you set up in gitosis config file.

19. mkdir testproject
20. cd testproject
21. git init
22. touch a_text_file.txt
23. git add .
24. git commit -a -m "Initial import"
25. git remote add origin
26. git push origin master
The project should be committed!

 Adding users

First, gather their public SSH keys, which I'll call "" and "", and drop them into keydir/ of your local gitosis-admin repository. Second, edit gitosis.conf and add them to the "members" list.

27. cd gitosis-admin
28. cp ~/ keydir/
29. cp ~/ keydir/
30. git add keydir/ keydir/

Note that the key filename must have a ".pub" extension.
gitosis.conf changes:

 [group team]
  writable = testproject
- members =
+ members = kakashi naruto

Commit and push:
31. git commit -a -m "Granted Kakashi and Naruto commit rights to testproject"
32. git push
That's it. Kakashi and Naruto can now clone the testproject repository like so:

33. git clone

Kakashi and Naruto will also have commit rights.

iCode Browser interface

34. sudo apt-get install apache2 libapache2-mod-php5 php-geshi
35. sudo git clone
36. sudo chown -vR www-data:www-data iCode
37. After finishing this operation, use your favorite editor to edit the config file for iCode:
38. cd /var/www/iCode/inc
39. sudo cp config.php localconfig.php
40. sudo chown www-data:www-data localconfig.php
41. sudo vim localconfig.php
42. Here is an example of the iCode localconfig.php with GeSHI and the testproject.git we created:

$conf['projects'] = array(
        'projectname' => array('repo' => '/home/git/repositories/testproject.git/'),
----------------------------------- Leave the remaining configuration settings

    a. Now in your browser, navigate to 
    b. You will see iCode right there. If there are any errors saying “permission denied”, provide adequate    permissions on /home/git/repositories


Popular posts from this blog

The economics of crypto investing

If you believe in the greater fool theory, there is no other market as speculative and volatile as the crypto market today. We are perhaps living in the biggest bubble of our times. I am not bullish on this market in particular. I am bullish on the mania. 90% of the cryptos we see today will crash. They are just tokens with no tangible value generation capability. However, I believe that the mania and euphoria will stay.

Having said that, should one consider investing in this market? Certainly!
The risk/reward is lovely, potential upsides and margins are huge and with 3-5% of your net worth, the bet on the mania is worth it.

How does one choose where to invest?

If you follow the stock markets, you are expected to do thorough Fundamental Analysis before investing. Expect the same for the crypto market. I invest in large caps. I invest in index funds. And I invest over and over again. Markets rise, always. Extrapolating the same strategy - invest in indices - the top 10 tokens by perfo…

Capture and compare stdout in python unit tests

A recent fan of TDD, I set out to write tests for whatever comes my way. And there was one feature where the code would print messages to the console. Now - I had tests written for the API but I could not get my head around ways to capture these messages in my unittests.
After some searching and some stroke of genius, here's how I accomplished capturing stdout.

Learn frontend to get good at backend : lessons for my 20 year old self

Only when you are the consumers of your own products, can you design the best ones! Same philosophies go for API design and programming in general.

This advice may seem counter-intuitive at first, but trust me, the best way to get better at backend programming is to spend some time doing frontend! It will teach you a lot about how your APIs are being used in the "real world". A first-hand experience of API consumption will tell you a lot about your design philosophies!