latexdiff, git-buildpackage and topgit

I’ve packaged latexdiff for debian, that is a small utility to generate latex files with revision markers from multiple versions of the same file. While packaging this utility I’ve learned about two very nice tools to help the debian maintainers: git-buildpackage and topgit.

Regarding git-buildpackage there is an extensive manual that should get you started : http://honk.sigxcpu.org/projects/git-buildpackage/manual-html/gbp.html

Topgit documentation is a bit sparse. tg help <command> should guide you for syntax. The README file in the tg distribution is full of examples.

Zack’s work on debcheckout to make it topgit aware is also very interesting ( http://upsilon.cc/~zack/blog/posts/2008/10/debcheckout_hacking/ )

I’ve put everything on alioth.debian.org in my personal git space following these instructions : http://wiki.debian.org/Alioth/Git

the git repo is here : http://git.debian.org/?p=users/munga-guest/latexdiff.git;a=summary

to build the package :

debcheckout git://git.debian.org/git/users/munga-guest/latexdiff.git
debian/rules tg-export
git-buildpackage --git-pristine-tar --git-ignore-new

the second command debian/rules tg-export exports the patch from the git branch that is managed by topgit and transform it to a quilt patch that will be applied to the master branch to generate the package.

You can also get the package in the usual way with dget : dget -u http://alioth.debian.org/~munga-guest/latexdiff_0.5-1.dsc

This package is nice and easy, with only on patch, so it should be nice to see what topgit, git-buildpackage is all about.


add sqlite3 collation with python 2.5 and storm

Recently I started a small project to build an incremental sql database of meta information related to debian packages. In the process I discovered that the newly available feature of sqlite3 to add custom collation doesn’t work well with the sqlite3 bindings present in python 2.5 . The reason is that in order to load a collation at run time, you must explicitly enable the extension loading mechanism. The binding present in python 2.5 (fixed in python 2.6) do not expose this C function.

In order to enable call this function, and instead of patching and recompiling python, I wrote a small python module using swig.

briefly (not tested, but you should get the idea):

import storm.database
import sqlitext

db_url = 'sqlite:db'
database = stm.create_database(db_url)
store = stm.Store(database)
sqlitext.enable_extension(store._connection._raw_connection,1)
store.execute('''SELECT load_extension('./libcollate_debian.so')''')

The code is available here: https://gforge.inria.fr/plugins/scmsvn/viewcvs.php/trunk/torchone/sqlite/?root=sodiac


ruby, rails and redmine on debian as a user

Rails/redmine installation on debian etch as a user requires a bit of googling. This is what I have done.

First, as root, install these packages:

apt-get install ruby rake
apt-get install rubygems -t etch-backports
aptitude install libopenssl-ruby1.8 libfcgi-ruby1.8

you need the backports version of gems as the version in etch is not compatible anymore with redmine.

Then you should follow these instructions: http://www.redmine.org/wiki/redmine/HowTo_Install_Redmine_in_a_home_directory_on_Debian

Once you setup the db, installed your gems (remember to install rails 2.0.2 : gem install -i $GEM_PATH -v=2.0.2 rails -y) you need to pass your GEM_PATH to your cgi. I use fcgi and I added ENV["GEM_HOME"] = "/path/to/gems" to the file dispatch.fcgi .

that’s all. Happy redmining


my new freerunner !

The other day I got a new, shiny freerunner. This is my dream mobile phone/ wearable computer. The HW spec can be found here [1] . Reading the wiki I pleasantly discovered that two HW problem were fixed in my phone release, namely the battery problem and the GPS problem. I can boot my freerunner without the battery. Before because the charging circuitry wasn’t activated but after the boot, it was impossible to boot the phone without a battery, or with a dry battery. Now this problem seems gone. This is the reference [2] . The second problem is related to an bad interaction between the sd card and the GPS chip. The fix is to add a small resistor. From a visual inspection of my phone, the resitor seems already in place. I haven’t try it yet, but I hope this is the case. Reference [3]

I think my freerunner is the GTA02v6

[1] http://wiki.openmoko.org/wiki/Neo_FreeRunner_GTA02_Hardware

[2] http://wiki.openmoko.org/wiki/Freerunner_Hardware_Issues#PMU.2FCharger_Issue

[3] http://wiki.openmoko.org/wiki/GPS_Problems


use vlogger with apache2

vlogger [1] is a nice piece of software to deal with large number of virtual hosts. It is meant to work with apache by piping the logs to the vlogger process that will then take care of storing them in you log directory.

I found an excellent howto that describes how to install vlogger in debian [2] .

To better integrate it with webalizer you can use this small bash snippet to generate conf files automatically for all your vhosts. This assumes that your log files are stored in /var/log/apache2 and that you don’t have any other directories there but those generated by vlogger.

#!/bin/sh

for vhost in `ls -l /var/log/apache2 | grep "^d" | awk '{print $9}'`; do

cat <<EOF >> $vhost.conf
LogFile /var/log/apache2/$vhost/access.log
LogType clf
OutputDir /var/www/webalizer/$vhost
Incremental yes
IncrementalName webalizer.current
ReportTitle Usage statistics for
HostName $vhost
PageType    htm*
PageType    cgi
PageType    php3
PageType    php
DNSCache    dns_cache.db
HideURL     *.gif
HideURL     *.GIF
HideURL     *.jpg
HideURL     *.JPG
HideURL     *.png
HideURL     *.PNG
HideURL     *.ra
IgnoreSite  localhost
IgnoreReferrer  localhost
SearchEngine    yahoo.com   p=
SearchEngine    altavista.com   q=
SearchEngine    google.com  q=
SearchEngine    eureka.com  q=
SearchEngine    lycos.com   query=
SearchEngine    hotbot.com  MT=
SearchEngine    msn.com     MT=
SearchEngine    infoseek.com    qt=
SearchEngine    webcrawler  searchText=
SearchEngine    excite      search=
SearchEngine    netscape.com    search=
SearchEngine    mamma.com   query=
SearchEngine    alltheweb.com   query=
SearchEngine    northernlight.com  qr=
SearchEngine    sensis.com.au   find=
SearchEngine    google.nl   q=
SearchEngine    google.fr   q=
SearchEngine    google.ch   q=
SearchEngine    google.ca   q=
SearchEngine    google.be   q=
EOF

done

[1] http://n0rp.chemlab.org/vlogger/ [2] http://www.howtoforge.com/apache_log_splitting_vlogger