Wednesday, September 28, 2011

Creating local git repository server

I tried to setup a local git code repository for managing the code and had some issues with gitosis. Finally I came up with a much simpler way to create a git repository and host it on the local server.

One can follow the steps as listed below and can setup a local git server. I used Ubuntu 10.04 for this and also tried on Ubuntu server 10.04 and it works on both.

First thing you need to do is to install git on your system. For that simply run this command:-

user@ubuntu32$ sudo apt-get install git-core

Now git is installed onto your system. Now create a directory in which you will keep your code:-

user@ubuntu32$ mkdir git_repo  
user@ubuntu32$ cd git_repo
user@ubuntu32:`/git_repo$ git init

Now add all the project files into the directory. I copied all the files I want to add to the repository.

user@ubuntu32:`/git_repo$ cp -r /home/user/projectA/* /home/user/git_repo

Now we need to add the files...

user@ubuntu32:`/git_repo$ git add .

Now we need to commit the changes. For that enter this command:-

user@ubuntu32:`/git_repo$ git commit -a -m "My first commit"

Now your files are added to the git repository.

Now to create a hosted repository of this source code, perform the following actions:-
First you need to copy the .git contents which can be checked out at later stages by users for cloning the directory. So enter the following command:-

user@ubuntu32:`/git_repo$ cp -r /home/user/git_repo/.git  /home/user/hostedgitrepos/git_repo.git

Now your universal git repository is git_repo.git and you can clone it from any machine. You just need to have access to that machine and rights to access them.

You can clone it on other machine using the following command:-

aa@fed$ git clone user@<server_machine_name_or_ip>:/home/user/hostedgitrepos/git_repo.git

Now you will see the directory cloned onto your machine.

Similarly one can push the changes to the git repository or can pull the updated source code in the same fashion. 

Thanks for reading..... :)

Tuesday, September 27, 2011

How to attach DVD Drive to a VM using Python(For Xen)

In this post I am going to tell you how to attach a DVD Drive to a newly created VM in Python. I faced a lot of challenges in determining how to attach a DVD Drive. Finally I found out a way.

We need to use the following code:-

Here, VM_ref refers to the uuid of newly created VM to which we want to add the DVD Drive. Every physical DVD Drive has its VDI which is stored in its properties and one can get it and pass it as one of the parameters to create a VBD linking DVD Drive with the VM. 

Sunday, September 25, 2011

Seagate Service Center In Pune

People face a lot of difficulties in finding the seagate center in Pune as no proper information is available. So I am going to update the information with the exact location of the facility.

Seagate hard_disks are serviced by a firm called "Accel Frontline" which provides the services to Seagate.
The seagate replacement office is situated near Corporation(Manpa) near the District court. In front of the Distric court, there is a Gas Agency. On the second floor of that building is the Seagate's repairing office.


Before going to the office there, you need to register to the Accel Frontline's website.

http://myservice.accelwms.in/

After registering at the website, you will get a customer ID which you need to provide when you are returning the defected HDD.

Kindly note that this information is correct as per on 25th September 2011. So its the updated information.

Also, all kinds of HDD repairs, RAM repairs are done at this office only.