Git Redmine Suite – Advanced issues manager with git and redmine

Hi, after almost 3 months of hard development, I’m proud to announce Git Redmine Suite.

This suite of tools, is dedicated for task management with redmine and your git repositories.

It has been well tested with “gitorious” and “gitolite”. Of course it work with every git system tools.

Here the key of the tools :

For developers :

  • List the pending tasks of every project you are working on
  • Start a task
  • Complete a task a reassign it to the reviewer
  • Fill the spending time
  • Check the status of the task it has completed

A developer will not need to take a look in redmine anymore, everything will be update for him, and keep redmine up-to-date. Less time in the tracking system, less time lost.

For the reviewer :

  • List the pending review of the current repositories
  • Start a review of a task
  • Reject the review with comments
  • Accept a review and merge it to devel
  • Automatically fill the Changelog file
  • Reassign to the releaser the accepted tasks

The reviewer will receive an email with the task to review, and the repository when the task has been developed. It can easily start and accept or reject a review. No more need to fill manually the changelog, and ask or change anything in redmine.

For the releaser :

  • List the pending task to released that has been reviewed for the current repositories
  • Start the release of all tasks reviewed
  • Automatically fill the changelog with the new revision, the dist.ini or VERSION file
  • Accept the release, and merge it to master
  • Tag the new version automatically
  • Reassign to the integrator the release for testing or deploying

Hotfix :

The hotfix are handle in a separate branch. Multiple hotfix can be apply at multiple time.

Well, I have create a complete wiki for the setting up, and installation. I have also join screencast, and I will add more soon.

Here the project link : Git Redmine Suite Project Wiki

Enjoy, and don’t hesitated to post comment and suggestion thought the project issue tracking.

Celogeek !

Posted in Tasks Management | Leave a comment

new RVM with capistrano

To use the latest RVM with capistrano, you need to setup the shell as bash :

So in your receipe, add this : capistrano/recipes/Capfile

Celogeek

Posted in Ruby | Leave a comment

SafeNet Token 8.2 SP1 on Mac OS X Mountain Lion (resolved)

The token SafeNet on Mac OS X Mountain Lion doesn’t work very well. Well, I have the drivers 8.2 SP1, and when I plug my token, it just hang until I kill pcscd.

So I have try to kill pcscd (hard kill with -9 option), then start it in debug. But it keep spawning again.

After diging a little, I have found a way that seems to work, thanks to this site :

http://ludovicrousseau.blogspot.fr/2011/07/pcscd-debug-output-on-mac-os-x.html

I have disable the smardcard operation that may cause the issue with the daemon “securityd”.

So,

I edit this file : /System/Library/LaunchDaemons/com.apple.securityd.plist

And apply the change :

After a restart, it still doesn’t work very well. So I decide to update the “SmartCard Services”.

I go here : http://smartcardservices.macosforge.org/trac/wiki/installers

Take the drivers, install it.

So I plug my token (unplug and plug again if it doesn’t detect it).

Then I open SafeNet tools. It appear after a few seconds. I check by clicking Information. It work.

I try my VPN. work too.

It seems to be stable now. Sometime my vpn tell me to insert the token (may be a timeout for pcscd). So I just unplug and plug and click ok, and it go again.

Enjoy !

Celogeek

Posted in MacOSX | Leave a comment

Vim – Pathogen – Link vim and git plugin repos

I was looking hard a way to have up-to-date plugin, and also an easy way to install and found them.

After a while, I have found “pathogen“.

This module will change your life.

Let’s start a reset of your vim config. First move everything into a backup dir.

Then setup a “pathogen” vim rc directory :

Now we create a minimal vimrc file :

And link it :

That’s it. Now everything placed into ~/.vim/bundle will be automatically load by vim !.

Let’s move to a git repos, for easy maintening.

Now the magic start. Let’s add a plugins :

Let see if it’s work. Add a shortcut :

Edit a file, and type : “,t”.
“,” is the leader I have set previously.
The command Tlist should be fire, and you should see the tag list appear.

All vim-script is clone to github. So don’t worry, just go to github and try to find the module you want. You should always be able to clone it.

Here a list of plugins I like :

Enjoy !

Posted in Vim | Leave a comment

ESXI / OpenVPN / One router / Multiple Public IPs Addresses

After a lot of pain and lookup for configuration, I have finally succeed to an very complex network setup that lead to an easy administration result.

I have one server on ESXI, and I host it at “Online.net”. For one server, I have 1 router available to allow my virtual machine to go out.

I have multiple public IP addresses, and generally one public ip is dedicated to one virtual machine.

But the configuration I want, is :

  • One virtual machine, the “router”
  • One virtual network card on the “router” per public ip address
  • One virtual network card on the “router” for the internal network where all my servers will be connected
  • OpenVPN with a tun network to access to my internal network
  • A wide subnetwork (10.90.0.0/16), dispatch into multiple class C (10.90.10/24, 10.90.20/24) network, each one go thought different public IP
  • A dhcp / dns server (dnsmasq) to attribute automatically the right IP to each server

The goal is for any server that need to be server by a specific public address, they receive a fixed internet address on a specific subnetwork. So they will go out and receive connection from a specific public address.

For any other kind of server (private one), they can obtain automatically a internal address and go out with the main public address (the one with the VPN access).

I cannot setup easily the route process, because I only have one IP to goes out for the router, and I will need to share that IP with multiple public address.

And you cannot receive a request from an IP address, and answer by another IP (martians package). If the route by default is you main access, then it will try automatically to go thought this connection when he want to go on the internet. And if the incoming request was from another IP address, it fail.

What we need to setup :

  • One main routage for the main access (the one with the VPN)
  • One table per public IP address
  • One rule for the each public ip address
  • One rule for the subnetwork dedicated to this public ip address
  • One rule for the VPN address

Here the schema of my network :

OnlineNetwork

Now let see the configuration :

We need a Virtual Machine with 1 network card with automatic hardware address (eth0), one network card with the main public ip address (eth1 with a fixed hardware address), one network card with a secondary public ip address (eth2 with fixed hardware address). Of course you can add all your public ip addresses the same way.

Here my file /etc/network/interfaces :

The main card add in the “main” route the default gateway. I also add a “ip rule” to use the “main” route table when a request go to the VPN. It avoid trying to reach the vpn by one of the public ip address.

The secondary public IP has several “route” rules :

  • First we say if we use the eth2 ethernet, we will reach the “Online” router thought the eth2 card. It will receive the correct hardware address and accept the connection. We set this in a “devel” table, not the “main” one.
  • Then we configure any network packet that come from the DEVEL subnetwork or come from the public ip address to use the “devel” table in higher priority. It will result of internet transfert thought the eth2 ethernet card, and not the default one “eth1″.

We also need a “devel” table. It’s better to use a name instead a number. It simpler to understand and it’s also easier to have the list of available table and the meaning like this.

Here my /etc/iproute2/rt_tables files :

You can now reboot your server. The network card will be configured properly. We need next, to configure the firewall.

I use “shorewall” for that purpose. Inside /etc/shorewall directory :

The “interfaces” file :

My local network and my vpn obtain ip by dhcp. The main network “net” and the devel network “devel”, has a “routeback” rule, to send back anydata that come from this card to the same way.

My “masq” file :

The “vpn” has a masquerade with the local network. The subnetwork “10.90.10.0/24″ use the “main” network as a masquerade, and the subnetwork “10.90.20.0/24″ use the “devel” network as a masquerade.

My “policy” file :

It allow all the local network to reach any network. You can also forbad the communication between each subnetwork. The vpn has only access to the firewall and the local network. I don’t share the internet connection to the VPN. The firewall can reach any network.
Any other communication is drop by default.

My “zones” file :

I simply declare all the network zone in the “zones” file.

You will have to setup the “rules” file based on your need.
The important rule for the vpn :

After that setting, you can connect to the vpn only by “OpenVPN”. Add a rule for SSH to simplify the starting configuration.

To set this configuration at “boot”, in the “shorewall.conf” change this :

And in /etc/default/shorewall :

Then reboot, and your firewall will be configured properly.

Let’s add “dnsmasq” has a dns and dhcp server.

In my “/etc/hosts” file, I setup some static ip on the secondary network :

In my “/etc/dnsmasq.conf” I add the dhcp setting :

Any short name will automatically add the “in.celogeek.fr” subdomain and resolv thanks to the local host file and the dhcp information.
A machine will send his name, and it will be save in the dhcp server and it will be possible to resolv his name afterward.

For the statics “ip”, we need to get their hardware address, and give them a name in dnsmasq :

my “/etc/dnsmasq.d/devel-hosts” :

You can restard again. Then when you start your server, it will obtain a dynamic ip that is assign to the main ethernet network, and a static ip in another subnetwork and go thought the “devel” network card.

Now let’s configure the “OpenVPN” service. I strongly encourage the use of the “easy-rsa” to generate the key of the server and the key for the client.

Here the special part for the network in your “OpenVPN” config file :

When you connect to the VPN, the subdomain “in.celogeek.fr” will be resolve thought the VPN. So if I do a “ping access” or “ping postfix”, it will change to “ping postfix.in.celogeek.fr” and then you will have the private ip address.

If that configuration work, you can remove the “SSH” service from shorewall, and only allow “OpenVPN” connection.

The big advantage, is I have one router, with all the dns configuration. The server obtain automatically their IP address, and any private server can just start and match the private network. They will have internet, so configuring a new server is very easy. And the IP can be fixed afterward.

Well, I hope it could help. Tell me if you have suggestion, I am very interested to improve that configuration.

Posted in Linux | Leave a comment

Perl – Memory Leaks – Test::LeakTrace at the rescue

Hi,
I have recently face memory leaks with object usage. After a day of work to find out the solution, I want to purpose here the issue and the way I have solved this.

Memory leaks often happen with a process that run for hours, like a FastCGI. The memory grow up (more or less quickly), and never free up.

All files can be found here :

https://gitorious.celogeek.com/talks/perl-memoryleaks

Here and example with objects :

MyData will storage a hash of data :

MyStorage will used by default MyData :

And MyTest will use it’s own data structure and tell storage to use it :

Everything seems normal, but with have a memory leaks here. MyTest use MyStorage that use MyTest. Both can’t be free from memory because they need each other.

A good way to see this (except running million of new and check memory) is to add a ‘DESTROY’ sub and see when it is call.

In MyTest.pm I add (before the ’1;’) :

The result expected is :

But we got this :

In my case, I have added this and check a request thought apache. I was expected a “destroy !” after each request, but never happen. So I reload apache and all my object was released !

Now let see how to test it with Test::LeakTrace :

The first 2 tests pass, no circular references :

But the third one leaks :

I know, it is hard to read this. But we can see that the issue is around “storage” in MyTest. And the reason is I pass “$self” to MyStorage.

So MyStorage has a strong ref to MyTest bless object, and MyTest has a strong reference to MyStorage bless object. They can not free them each other because they depends each other.

The solution is to create a weak ref in MyTest of the “storage” object.

With ‘Moo’ it’s seems not possible to have a “ro” on an attribute with a weak_ref. So I use a lazy mode.

Now let’s play again test.t :

It seems the result we expected !

Let’s run the test again :

We solve the memory leaks !

But how can I find this in a ton of code ? actually I do it raw by raw. I go to my FastCGI, stop the request at the beginning of the response, play a big log, check the memory, and move the stop raw by raw until I get the module I use who consume a lot of memory.

So I test this module.

Now for all my futur module, I will test it, each time I create a new object, I test the “new”, and the usage of the module with Test::LeakTrace. It will prevent lot’s of issue in the futur.

Enjoy !

Celogeek

Posted in Perl | 2 Comments

Gitorious Installer for Ubuntu

Hi, I have made an auto installer for Ubuntu. It create a subsystem in a chroot with a minimal quantal system.
This should work on any debian base system with debootstrap and support of quantal installation.

Here the github : https://github.com/celogeek/gitorious-installer-ubuntu

Use a system with nothing on based (like a virtual machine), so apache, ssh, postfix … should be off from the host system. For ssh you need to use another port.

Clone the repos on your host and run the installer. It will :

  • Install gitorious in /var/lib/gitorious
  • Install gitorious script in /usr/local/bin/gitorious
  • Install cron in /etc/cron.daily and /etc/cron.hourly
  • Install upstart script in /etc/init

You have just to reboot after, it should take about 15 / 20 min if you have a good connection.

Tell me if it work for you.

Enjoy

Celogeek

Posted in Linux | 2 Comments

bash PS1 for git

Hi,

here my PS1 for git :

You can push this in your ~/.bashrc

You’ve got the latest tag and the current branch and his state.

Exemple :

Enjoy

Celogeek

Posted in Github | Leave a comment

Zimbra 8.0.0 OpenSource – Bug unit for french language (and may be others)

I was trying to use the “recall” in the calendar with something like “30 min before”. The apps show “30,000 min before”, that mean in french 30000. So the zimbra server answer ‘out of limit’.

After googling a solution, I have found this : Error displaying user quota

The unit in translation is bad. “,” is for digit in french, and “.” is for separating the thousands.

So the issue is in the file : jetty-distribution-7.6.2.z4/webapps/zimbra/WEB-INF/classes/messages/I18nMsg_fr.properties

Changes from this :

To :

Then save, and restart zimbra :

Problem solved !

Enjoy

Celogeek

Posted in Linux | Leave a comment

Javascript getClickElement (document.elementFromPoint)

Following :

You can get the current click element, even in a multi frame context, in all browsers.

Enjoy

Celogeek

Posted in Javascript | Leave a comment