Skip to main content

Posts

Showing posts from 2005
The Pledge Bank
Today I have read on the register about this pledge bank idea and I must say it is great! Somebody should start something similar in Italy too: we have a great need for a change.
This is the kind of stuff that makes me believe in the revolutionary power internet! The internet is not only about making the coolest site for your customer, downloading music but is MOST IMPORTANTLY about putting the power and the freedom to speak back in the hands of the people.(caterpillar would say combattere le corrazzate dell'informazione)

Boot ltsp from NT/2K/XP

This week I have been tasked with the setup of a Linux terminal server for a press room with 15 terminals (mostly used for OpenOffice, browsing and printing). The terminals are refurbished pcs with intel II processor and 128MB of ram.
In case the terminal servers failed I decided to keep the original hard drives and install NT4 on them. I also set a small FAT partition apart for installing the linux kernel necessary for bootstrapping the client.

I installed Fedora Core 3 on the two servers (they roughly share the load) and chose KDE as the default desktop environment. Then I installed LTSP.
For the initial phase I went with bootable floppies, but after the setup was considered stable I wanted something installed on the local hard drive of the terminals.
After some googling I found syslinux. SYSLINUX is a bootloader that can be used to boot the zlilo images from rom o' matic.
The installation is very easy: I downloaded and uncompressed syslinux on the NT box while I was running NT, then…

How to remove empty lines and weird characters from MANY files

Say you have a file (a print) and need to clean it up, remove weird control caracters: how do you do it?
First you look at an hex dump of the file with hexdump -C: then you take note of the control caracters and their hex code.
After that you simply replace them with blanks or strip them off, depending on taste or requirements.
In the end you put together a big for loop like the following:

for f in directory/* ; do

# replace control characters
perl -pi -e 's/[\x0b\x01\x0c]//g' $f;
dos2unix $f;
# remove empty lines or lines with only blanks
grep -v '^[ \t]*$' $f > tmp;
mv tmp $f;
unix2dos $f;
doneCheers
Open source portals and my apps
Today I have just tried to deploy an application based on struts/tiles/securityfilter on the popular jetspeed portal.
It has not been easy: jetspeed definitely needs better docs, but in the end it worked. My application even picked up authentication credentials from the portal. In the end it took me about 4 hours just to deploy the application, starting from zero.
Open Source Rocks!
I am an hacker!
I have gone through this famous hacker checklist and I am positive: I am an hacker.
Next step: write it on my CV.

heartbeat won't start zope

Today I was installing a web cluster with the usual heartbeat/drbd stuff. The customer also needs zope because a part of the web site requires it, so I went and built a fresh rpm of it (link to zope rpm).
I then added zope to the haresources file, only to find out that heartbeat will cowardly refuse to start it!

When heartbeat starts to acquire resources it checks the status first by running resource status.
The problem is that the zope rc script prints 'not running' when it cannot find any zope instance running and heartbeat resource manager greps the zope status output for [Rr]unning, to decide whether it must start zope or it is already started for whatever reason.

The solution should be already in heartbeat cvs for some time now and was proposed by Lars Ellemberg of the drbd project. See this link for details:
http://lists.linux-ha.org/pipermail/linux-ha/2004-June/011154.html

Courier IMAP - vpopmail troubles

I like the qmail/vpopmail solution as a email server a lot and use it in lots of places. Usually there is only one domain, but in one special case I had to create more than one. I also use courier-imap as imap/pop3 daemon because of its support for vpopmail.
So last week I went to create a new virtual domain on this site and at first all seemed to work fine, but after a while users on the new virtual domains reported login errors.
After some googling I searched the vpopmail mailing lists and found the following posts:

http://www.mail-archive.com/vchkpw@inter7.com/msg09933.html
http://www.mail-archive.com/vchkpw@inter7.com/msg09943.html

Since I usually install qmail on SuSE linux systems I wanted to modify the rpm of courier-imap (version 3.0.8) so that it would also build the needed authvchkpw . This turned out not to be easy and required a modification to the spec file that I am attaching here:


--- courier-imap.spec.orig 2005-03-21 09:51:21.000000000 +0100
+++ courier-imap.spec 2005-…
Publish your site with forrest (XML+XSLT)
If you have ever maintained a web site you know that pure html is difficult to mantain and impossibile to change without doing it all again from scratch (even if you use css).
XML once again is the solution to all of your (web) problems. By using XML and a couple of XSLT sheets you can easily skin your site whilst keeping the content in one separate, safe, upgradeable place.
If you want a tool that will make you started quick go have a look at Apache Forrest.
[shameless plug] My web site was made with forrest: www.unicolet.org

Saturday morning live: SLES9+DRBD upgrade

I have not worked on saturday mornings (at least officially) since 2001, but today I planned an upgrade of a SLES 9 cluster to the latest patchlevel. The cluster uses drbd to replicate two disks, used mainly for samba sharing.

My plan was to try a rolling upgrade, even tough nobody is at work today, so that I could get some experience on this and avoid other saturday mornings live ;-) . From what I understand drbd can be upgraded on one node at the time as the protocol is compatible between minor versions and since the upgrade was from 0.7.pre to 0.7.5 I thought: ok, I can do it.
Believe it or not it is not true: the pre thing in the original SLES9 is not compatibile with the one that comes from online update. So I had to upgrade both and then reboot. The whole process took about one hour (add some time for safety checks on partitions, etc) and I was really disappointed that even in the suse support portal this was not mentioned at all!
Except for that drbd did not force a full resync …

Goodbye mainframe

Today I have presentiated at the shutdown of a Bull DPS 9000 mainframe. It will be replaced by an Oracle RAC cluster on linux and hp hardware. My first work as an IT person was creating a suite of shell scripts that essentially fetched data via ftp from the mainframe and loaded them in an Oracle database. That was some 5 years ago and thise scripts more or less worked for all that time.

The scripts were scheduled to run on a BULL Escala machine (it featured a powerPC processor) running AIX. Those were my first tries with vi in an horrible zsh enviroment only! The escala will be shutdown very soon too.

Rest in peace...

Snowy weather

Yesterday afternoon it started snowing and it was so beautiful...

In the evening I took a nice and relaxing walk cross the snow covered place where I live (Trissino, BTW)...
The picture in the header was taken yesterday in the morning when it was 6 below and everything was white for the ice. See it in full here.

AHHHH, life smiles again!

Checking mysql replication

Question: What happens if you have two mysql database with replication, they stop replicating and you do not notice?
Answer: you get into trouble....

Here is a small script to help you stay informed...


#!/usr/bin/php
/* Connessione e selezione del database */
$connessione = mysql_connect("localhost", "root", "secretpw")
or die("Connessione non riuscita");
print "Connesso con successo\n";

/* Esecuzione di una query SQL */
$query = "SHOW SLAVE STATUS";
$risultato = mysql_query($query) or die("Query fallita");
$slaveok=0;

while ($row = mysql_fetch_array($risultato, MYSQL_ASSOC)) {
print "Slave is running: ".$row["Slave_Running"] . "\n";
print "Last error : ".$row["Last_error"] . "\n";
if ($row["Slave_Running"]=="Yes" && $row["Last_error"]=="") {

Crazy crazy weekend

So last week I managed to migrate the file server cluster and everything worked ok.
It was then time for me to take a break and relax... and luckily friday the 7th I was able to take a day off at work.
I worked hard all friday as a lumberjack and at the evening I was ready for some fun!
Friday night was spent enjoying a warming drink (called jager tee) in a pub and chatting with a friend of mine.
We then planned for Saturday to be more quiet, but could not resist groovy caipiroskas in cozy disco bar until 4am....

So here I am, Monday morning fighting computers as hard as I can! I need some coffeeeeee

Yesterday's dinner and good thought for 2005

Yesterday eve I went out with some friends of mine and as usual we ended up talking about computers and eventually boring to death my poor girlfriend who, in a desperate attempt to save her evening and good mood decided to get drunk (with no success at all I must say).

I proposed them to write an open source version of My Life Bits.

My good thought for 2005 is to develop (possibily useful ;-) ) open source stuff and give it away. I am currently working on a java implementation of mapserver.

Happy new Year Everybody!!