0

Convert a project to GIT from a CVS repository in Ubuntu Hardy 8.04

For some time I was trying to get in touch with git but haven’t got any project to really use it. That is, one I could convert from CVS or SVN and don’t have the other group members hit me.

Having a needed patch to the LambdaMOO server make it a really interesting candidate.

We are going to extract all the versions of the server from Sourceforge to create a local git repository and then browse around it.

Installation of the needed packages

Let’s go right away to the packages we will need. Start by the base for git.

$ sudo apt-get install git-core

Then the cvs related package. There is a git tutorial that tells you to also install CVSps.

sudo apt-get install cvs cvsps

I though this was enough but mindo from MOOsaico warned me I would need just another one

sudo apt-get install git-cvs

Now we have all the ingredients to cook what we want.

Importing from the CVS repository

Let’s fetch the repository from sourceforge. We will use the following command template

git cvsimport -C  

making a directory “destination” with the repository from the CVS “module”.

When asked for a password just press enter.

$ cvs -d:pserver:[email protected]:/cvsroot/lambdamoo login
$ git cvsimport -d:pserver:[email protected]:/cvsroot/lambdamoo -C server-git server
Initialized empty Git repository in /home/paf/src/lambdamoo/server-git/.git/
Counting objects: 1395, done.
Compressing objects: 100% (1393/1393), done.
Writing objects: 100% (1395/1395), done.
Total 1395 (delta 1077), reused 0 (delta 0)

This make take several minutes. Just wait.

cd server-git
gitk

Enjoy now the graphically ((Instead of gitk you may prefer giggle: sudo apt-get install giggle)) view of the revisions.

Adding a branch

Creating a branch is really difficult in git: you will have to use the … branch command :-)

To make a branch named iconv type

$ git branch iconv
$ git branch
AUTOCONF_TWO
CONSTANTS
FLOATSUSPEND
INLINEPC
PARC
UNSAFE_OPTS
WAIF
WROGUE
iconv
* master
origin

And you can also see all the existent branches.

But to do some work you must change your context to your branch

$ git checkout iconv
Switched to branch "iconv"

Then edit, add, remove files. ((Don’t forget to use the add command and check the git tutorial to learn more.))

Don’t forget to save your changes in the repository and afterwards if you want switch back to the master branch.

$ git commit -a
$ git checkout master

To play a bit more check melo’s Git starters post.

0

Request Tracker in Ubuntu using MySQL

Being a proud user of Request Tracker 0.99 I thought it was time to try a modern version. I installed it in a Ubuntu 6.06 LTS with MySQL as the support rdbs. This synthetise two installation procedures ((http://wiki.bestpractical.com/view/UbuntuInstallGuide & http://brucetimberlake.com/linux/rtinstall.html)) around there that were not so focused.

Installing the packages

sudo apt-get install mysql-server
sudo apt-get install request-tracker3.4

You may change for 3.6 if you’re using Ubuntu 7.04. Those two commands installed all I needed. However if you think that something is missing you can type it all.

sudo apt-get install request-tracker3.4 rt3.4-apache rt3.4-clients apache-doc postfix mysql-client mysql-common libdbd-mysql-perl

Editing the RT configuration files

Go to the RT directory and start updating RT_SiteConfig.pm with the info from your site and/or system.

cd /etc/request-tracker3.4
vi RT_SiteConfig.pm

Change the defaults as you need along this lines.

Set($rtname, 'rt.domain.tld);
Set($DatabaseType, 'mysql');

Set($DatabaseUser , 'rtuser');
Set($DatabasePassword , 'wibble');
Set($DatabaseName , 'rtdb');

Set($WebBaseURL , "http://rt.domain.tld");

Set($DatabaseHost,'localhost');
Set($DatabaseRTHost,'localhost');

Edit RT_Config.pm and RT_SiteModules.pm as you need. Don’t forget that these files must finish with 1;

Update RT lib directory

We must now store these customized files along the other RT libs.

sudo cp RT_Config.pm /usr/share/request-tracker3.4/lib/RT/Config.pm
sudo cp RT_SiteConfig.pm /usr/share/request-tracker3.4/lib/RT/SiteConfig.pm
sudo cp RT_SiteModules.pm /usr/share/request-tracker3.4/lib/RT/SiteModules.pm

Database creation

sudo /usr/sbin/rt-setup-database-3.4 --action init \
        --dba rtuser --prompt-for-dba-password

Use the same password you defined in SiteConfig.pm

Apache configuration

Just create a new file for a virtual host. Change 10.0.0.1 for your IP address and costumize ServerName and ServerAdmin

sudo vi /etc/apache/conf.d/rt.conf
NameVirtualHost 10.0.0.1
<virtualhost 10.0.0.1:80>
    ServerName rt.domain.tld
    ServerAdmin [email protected]
    DocumentRoot /usr/share/request-tracker3.4/html
    AddDefaultCharset UTF-8
    PerlModule Apache::DBI
    ErrorLog /var/log/apache/rt-error_log
    CustomLog /var/log/apache/rt-access_log common
    Include /etc/request-tracker3.4/apache-modperl.conf
    <location>
        SetHandler perl-script
    </location>
</virtualhost>

Don’t forget to reload the apache server to read the new configuration

sudo /etc/init.d/apache reload

We made it!

Let’s connect and start creating users, groups, queues and moving tickets away. Point your browser to http://rt.domaind.tld (the address you’ve defined) and login using user root with password password. Change it right now!

0

QEmu over a bridge in Ubuntu Linux

Being a linux user, I use QEmu to save me with those windows applications that I must use on the corporation environment. It all went well until I installed a windows tool that needed icmp to work. As you know, the basic and simple network setup of QEmu just support tcp and udp.

To have enough freedom I wanted to have my QEmu “machine” with a unique ip address as my notebook do. I pretend to simulate having two different systems over my subnet.

Let’s configure my Linux Ubuntu 7.04 Feisty to run this environment.

Let’s use a bridge instead of eth0 to have two different interfaces.
Edit your /etc/network/interfaces to look like this

auto lo
iface lo inet loopback

auto br0
iface br0 inet static
  address 10.0.0.17
  netmask 255.255.255.240
  gateway 10.0.0.30
  bridge-ports eth0

We add eth0 to the bridge group br0 and configure the allocated ip address to my linux notebook.

QEmu must be launched adding the options “-net nic -net tap” so it uses the tap device. You must “sudo” qemu so it can use the device – or configure it so it’s accessible from user mode. I don’t spend time with that and always use “sudo” – it’s just my machine.
Edit the interface script /etc/qemu-ifup to add it to br0.

#!/bin/bash
echo "Running /etc/qemu-ifup"
echo "...Bringing up $1 for bridged mode"
sudo /sbin/ifconfig $1 0.0.0.0 promisc up
echo "...Adding $1 to br0"
sudo /usr/sbin/brctl addif br0 $1

After having my windows running I configured its network ethernet device:

ip address: 10.0.0.18
netmask: 255.255.255.240
gateway: 10.0.0.30

The name server caches were configured too.

Et voilá, you have two operating systems on two different machines
using each own ip address and completely exposed to your network.