Wednesday, November 29, 2006

Integrating Mantis Bug Tracking with Win32 TortoiseSVN

25-Apr-2005 11:11 #419
Brief guide to TortoiseSVN integration on Win32. This will allow you to enter a Mantis issue number when doing an SVN commit, automatically add a note to the Mantis 'notes' log containing info about the change, and show a link to the issue from TortoiseSVN log.

1. Set properties for your SVN repository (e.g. in TortoiseSVN, use the file properties dialog) to include the following:
bugtraq:label = issue
bugtraq:url = http:///mantis/view.php?id=%BUGID%
bugtraq:message = issue %BUGID%
bugtraq:warnifnoissue = true

2. Create a post commit hook file in the SVN respository hooks directory (\hooks\post-commit.bat), containing the following batch commands. This will add a comment to the notes field for the issue provided during the SVN commit, containing the SVN change log, the SVN revision number and the file differences.

REM Post-commit hook for MantisBT integration
SET LOG_FILE=\svnfile_%REV%_Log

echo ****** Source code change ******>>%DETAILS_FILE%
svnlook log -r %REV% %REPOS%>>%DETAILS_FILE%
echo SVN Revision:%REV%>>%DETAILS_FILE%
svnlook diff -r %REV% %REPOS%>>%DETAILS_FILE%

\php.exe \core\checkin.php <%DETAILS_FILE% >%LOG_FILE%

3. Add the following to your Mantis config_inc.php

#Integration to SVN
$g_source_control_notes_view_status = VS_PUBLIC;
$g_source_control_account = '';
$g_source_control_set_status_to = OFF;
$g_source_control_regexp = "/\bissue [#]{0,1}(\d+)\b/i";

Sunday, November 19, 2006

Dump database MySQL tiap hari

To backup MySQL everyday with simple shell script.
I'm using Ubuntu 5, MySQL 5.

Create a file at /etc/cron.daily .
Named, e.g. "backup-mysql" .
The content of the file is (between dashes) :

test -x /usr/bin/mysqldump || exit 0
/usr/bin/mysqldump --all-databases -u root --password=a | gzip - > /backup/mysql/mysql-`date +%F`.sql.gz
cd /backup/mysql
find . -atime +14 -delete


Tell the shell wich shell to run this script. Ubuntu default is bash shell.

test -x /usr/bin/mysqldump || exit 0
Check the /usr/bin/mysqldump is it there ? If not just exit.

/usr/bin/mysqldump --all-databases -u root --password=a | gzip - > /backup/mysql/mysql-`date +%F`.sql.gz
Dump all the databases from server with user 'root' and password 'a' (for example). Zipped with gzip and store at /backup/mysql. The file name generated differently every day prefixed with 'mysql-' follow by the date (from `date +%F`, it's a back quote pair).

cd /backup/mysql
find . -atime +14 -delete

Go to the folder and check if there are some file older than 14 days, delete it.

Tags: , , , , ,

Wednesday, August 30, 2006

C Development Environment on Ubuntu

To set C Development Environment on Ubuntu
Just apt-get install build-essential

Sorry one-liner

Tags: ,

Monday, July 03, 2006

Linux : Ubuntu 6.06 Dapper Drake
GSM : XL Xplore
Mobile : Sony Ericsson T610
using Bluetooth (Dial Up Network/DUN) service

Create new file /etc/ppp/peers/xlgprs

connect "/usr/sbin/chat -v -f /etc/chatscripts/xlgprs"
user "xlgprs"

File /etc/ppp/pap-secrets, add this line at the end of the file.
"xlgprs" * "proxl"

Create new file /etc/chatscripts/xlgprs

"" "ATZ"
"" "AT&FH0M0"
OK AT+cgdcont=1,"IP",""
OK-AT-OK "ATDT*99***1#"

"AT&FH0M0" is specific for SE T610.

Prepare your bluetooth connection, so your computer can see your SE T610.
Some commands need root priviledge.
Search for device and channel for Dial-Up Network.
$ sdptool search DUN

In my case, the device is 00:0F:DE:04:6F:0E
and the channel is 1.

We'll use rfcomm0 . So release old connection, if any.
$ rfcomm release 0

Bind the device, use sdptool's result.
$ rfcomm bind 0 00:0F:DE:04:6F:0E 1 

Next, we need to pair your computer and your SE T610.
Well, I don't know how to do it better. Please advice ....
But we need to open xhost security.
$ xhost +

Place the PIN at the handset.
Match the Bluetooth PIN at the Ubuntu.
$ cat < /dev/rfcomm0

Control-C to back to prompt.
Then close the X security.
$ xhost -

Then call the pppd
$ pppd call xlgprs

Happy surfing ....

Wednesday, June 21, 2006

Ubuntu 6.06 Dapper Drake Installation

First of all is to download the ISOs. I managed to download it three of them, the desktop, the server, and the alternate ISOs for i386. Fortunately while I was in Singapore, I had a very good Internet cable in my corp's apartment to get those three in one night.
I had not opportunity to burn when I was there. So, days latter I'm in base city, Jakarta, I burn two of them. The desktop and alternate ISOs.

First idea to make it live CD as interface to install the Ubuntu is a great one. But, my experience is not so good as I expected. I try first the desktop CD.
The CD didn't boot smoothly in my desktop PC [IBM ThinkCenter] also in my notebook [Sony VAIO VGN-B100B]
It hang for quite a while when it try to mount the root on both PC and notebook.
After that many lines of error messages shown up.
So, I suspect the ISO file is broken or the burning process have some glitches.
I check and double check the MD5 hash and it's a correct one. So, I try to burn the desktop ISO for the second time.
Try to boot with the new CD but the same situation always came up.
So, I start to googling the "error while mount the root with Ubuntu 6.06 CD". Fortunately the Ubuntu forums has the work-around. Just type 'evms_activate' (without quote) and press Enter when you see the text error messages in the monitor. For my desktop PC the error is consistent but for my notebook the error is gone and I not doing anything except the CD is the new one. Creepy ...

After I defract my hard-disk and backing-up all important files. I decide to try to install the Dapper Drake.
First try was the notebook. I feel the desktop live CD is quite slow or heavy some way.
But this was my first time of my life while I install the Linux I can play Tetris, Mines, etc (of course Gnome's game version). The resize and install procedures was smooth as I expected but still I feel it's took more time then text-based installer.

Next, my desktop. I try to install with desktop CD. After passing the boot problem, I already got the feeling that this is not a good idea. The boot process took a very long time to show the Gnome Desktop. Even I was trying to pop-up the Terminal it took forever.
So, just push the magic 'ON' button until my PC is off.
Next, I try to boot with alternate CD and try to install with text-based installer. The installation was fast and easy.

Tags: , , , , , , , , ,

Wednesday, May 17, 2006

Installing Rails on Ubuntu Breezy

After I have Apache2, PHP, MySql, etc installed in my Ubuntu box,
I want to try to install Rails [Ruby] also.

So I do these as root (sudo su) :

apt-get install rails
apt-get install libapache2-mod-ruby
a2enmod rewrite

I don't want to touch my DocumentRoot at

So, I add in the end of but within <VirtualHost></VirtualHost> :

Alias /rails/ "/usr/lib/cgi-bin/rails/"
<Directory "/usr/lib/cgi-bin/rails/">
     Options ExecCGI FollowSymLinks
     AddHandler cgi-script .cgi
     AllowOverride all
     Order allow,deny
     Allow from all

Then re-start the apache

/etc/init.d/apache2 force-reload

Then goto /usr/lib/cgi-bin

cd /usr/lib/cgi-bin
mkdir rails
cd rails

To test the rails at /usr/lib/cgi-bin/rails/

rails test
cd test
ruby script/generate controller pleasework
vi app/controllers/pleasework_controller.rb

Add something inside pleasework_controller.rb, to be look like this :
class PleaseworkController < ApplicationController
    def index
        render_text "rails ok juga"

Edit public/.htaccess

vi public/.htaccess

Change the RewriteRule from

RewriteRule ^(.*)$ dispatch.cgi [QSA,L]

to this

RewriteRule ^(.*)$ /cgi-bin/rails/test/public/dispatch.cgi [QSA,L]

I don't know how to do this more elegant (damn ... another regex!!)

At last, we ready to shoot the URL :


Tags: , , , , ,

Tuesday, April 18, 2006

Setting autentikasi apache 2 dengan mysql di Ubuntu

Install :
apt-get install libapache2-mod-auth-mysql

Berikut ini spesifik untuk kasus saya yg mungkin berbeda dengan Anda.

Edit file /etc/apache2/sites-available/ssl-default

Kira-kira sebagian isinya seperti ini :

    Auth_MySQL_Info "www-data" w
    Alias /svnadmin/ "/var/www/svnadmin/"
    <Directory "/var/www/svnadmin/">
        Options FollowSymLinks
        AllowOverride None
        Order deny,allow
        Deny from all
        Allow from
        AuthMYSQL on
        AuthMySQL_Authoritative on
        Auth_MySQL_DB http_auth
        Auth_MySQL_Empty_Passwords off
        AuthName "Subversion user admin"
        AuthType Basic
        require valid-user

Posisi Auth_MySQL_Info harus diluar <Directory>.