Archive for the ‘Software Development’ Category

SVN users, secure your web site!

Tuesday, September 29th, 2009

After reading this article I found I host one of the site affected by this security issue.

I.e. if your website has “.svn” folders (because you’ve forgot to exclude them from the zip or whatever) than your source code may be exposed to the anonymous users.

Two possible (and simple) solutions:

  1. Exclude “.svn” folders when publishing/deploying
  2. Add this to your Apache2 website configuration
    <Directory ~ ".*\.svn">
      Order allow,deny
      Deny from all
      Satisfy All
    </Directory>

glib-2.20.5 b0rks if compiled with plain -O3

Thursday, September 3rd, 2009

Just one more post for the category Improving Free Software: I’ve run into troubles on my laptop when yesterday I upgraded glib, which caused an infinite loop on a dependent software.

Thanks to a suggestion from Gilles Dartiguelongue, I found that the latest glib fails if compiled with a plain -O3 optimization: the problem was solved by disabling the “ipa-cp-clone” optimization (-fno-ipa-cp-clone).

All the details can be found here.

Setting up FoodMart on Mondrian

Monday, August 3rd, 2009

I don’t know either if I’m stupid or if the Pentaho developers are lacking of effort in helping poor conference speakers like me.

If you want to show someone the features of something, you have to set up a demo. And half the times these demos require data. And if you are setting up a demo for a business intelligence tool, data is essential!

Pentaho provides you with a dataset to use in demos and as a playground (thank you), but it’s quite difficult to set it up. An early adopter may judge this as project immatureness, while Mondrian is all but immature!

That’s what you need to set up the FoodMart database on PostgreSQL before demoing Mondrian (don’t try that with MySQL: it will take hours!)

First, locate a copy of these dependencies: log4j, eigenbase-xom, eigenbase-properties, eigenbase-resgen, commons-logging and postgresql-8.4-701.jdbc4.jar (or a suitable postgres jdbc driver): let’s say you have them in folder “mondrian/lib” and that you are in folder “mondrian”

Then write in a console:

java -cp .:lib/mondrian.jar:lib/log4j.jar:lib/eigenbase-xom.jar:lib/eigenbase-properties.jar:lib/eigenbase-resgen.jar:lib/commons-logging.jar:lib/postgresql-8.4-701.jdbc4.jar
mondrian.test.loader.MondrianFoodMartLoader
-verbose -tables -data
-jdbcDrivers=org.postgresql.Driver
-outputJdbcURL='jdbc:postgresql://localhost/mondrian?user=postgres&password=postgres'
-inputFile=demo/FoodMartCreateData.sql

Then wait for a minute.

Bah, maybe it’s just me, too comfy sat on ant and maven.

Speeding Firefox/Thunderbird start-up

Monday, July 13th, 2009

Having found and read this forum thread, I’ve modified the script to:

#!/bin/bash
username=$(whoami)

function check_app {
	proc="$(ps aux | grep $username | grep -v $0 | grep $1 | grep -v grep)"
	if [ "$proc" != "" ]
	then
		echo "!!! Shutdown $1 first!"
		exit 1
	fi
}

function vacuum_mozillas {
	echo "Vacuuming $1..."
	find $2 -type f -name '*.sqlite' -exec sqlite3 {} VACUUM \;
}

check_app firefox
check_app thunderbird
vacuum_mozillas firefox ~/.mozilla/firefox/
vacuum_mozillas thunderbird ~/.thunderbird

echo 'Done!'

While it sensibly improves start up times, don’t expect too much.

ServerDay 2009

Wednesday, May 20th, 2009

Tomorrow I’ll attend the first Italian Java Application Server Day, organized by Genova JUG.


See you there folks!

UPDATE: an unexpected problem prevented me from attending :( Hope to find the slides online, at least.

Effective pairing

Monday, May 18th, 2009

Despite you pair or not, you’re agile or not, this talk will teach you be a better co-worker. It examines some of the common problems you get with you colleagues and depicts how to get out of them or to solve them. It also mentions the “pomodoro technique” :)

ps: I’m trying Parleys embedded videos for the first time. Just go the site if you don’t like it.

KVM: from disk image to LVM

Sunday, May 10th, 2009

In the beginning I was creating virtual machines out of physical ones, overbooking their size to make guests believe they had, say, 30G, while the hard drive just had 20.

With the passing of time, these disk images were growing and growing, and performances went lower and lower.

So I’ve followed this guide, and found a problem at paragraph 8: converting an image file into a raw LVM volume does NOT work, at least with the current version of KVM available on Debian Lenny.

The solution is quite simple, even if time and disk space consuming, and it came from this post.

First create a raw image file:

kvm-img convert disk0.qcow2 -O raw disk0.raw

Then DD it to the LVM volume

dd if=disk0.raw of=/dev/vg01/vm1 bs=1M

Voilą!

ITA: Processo al Database

Wednesday, February 4th, 2009


JRecordBind 2 has been released

Wednesday, January 21st, 2009

JRecordBind 2 is the JAXB of fixed-length files: using XML Schema to describe their structure, it’s able to both produce and consume them, letting the developer focus on the real task, that’s what to do with the data.

This is the final release, ready for production use.

I’ve asked the java.net admins to graduate the project, and I’m waiting for their reply.

Anyway the URL won’t change, so it’s safe to bookmark:
https://jrecordbind.dev.java.net/

JRecordBind goes Jaxb

Thursday, January 8th, 2009

The current stable version on JRecordBind (rev 58) is deprecated: the new version is on its way to stable status!

JRecordBind-2 will be based on JAXB: forget the .properties file and start describing the hierarchy of your fixed length file with XML Schema!

For what I want it to do now, it’s feature complete. It needs a refactoring, since the code is the ugliest I’ve ever written. Once done, I’ll update the documentation, announce the final release and ask java.net admins to get me out of the incubator.

Stay tuned!