Skip to content

Recent Articles

24
Jul

Solaris 10 x64 and Symbios SYM22801 (and other LSI SCSI controllers)

Today I’ve discovered that the very common Symbios 22801 (aka Symbios Logic 53c875) SCSI controller is (unexpectedly) failing to be recognized by Solaris 10 on x64 hardware. In fact I was in the middle of the upgrade of my home backup infrastructure from an old DLT 20/40 to a newer DLT 40/80 to be connected to a Symbios card inside my Solaris box. Unfortunately after the reboot, the new card was unseen.

Read moreRead more

19
Jun

I2C Anemometer: cheap wind data logger (Work In Progress)

Lately I’ve been wondering if a wind-generator could help me lower my electricity bill (since my home server burns continuously some hundred watts per hour) in my town, Ponzano Romano. So I came up to the idea that wind data logging is absolutely a must for any further reasoning about wind – that is I need an anemometer. On internet prices for those devices may vary, but I was unable to find anything below 150€ which I think is a bit too much for what is just an experiment for fun.

From the very interesting forum energeticaambiente a post pointed me to the electronic italian magazine “Nuova Elettronica” that posted the following (relatively cheap) anemometer kit:

Nuova Elettronica Anemometer kit lx1606

The kit is fine but is not meeting my requirements for data logging, that is I have the need of a constant wind speed recording into my server; since it’s possible to buy only the anemometer (without the logic board) I went that way.

Read moreRead more

25
May

CyberzOrg::Event library: typesafe event handling in C++

The following article is date back to Thu Dec 14 22:12:44 CET 2006

Event is a little library built on top of boost::signal and boost::mpl that allows the user to declare in a simple way an object that can emit events and allow connection of (type-safe) callbacks as event handler to them. Usage is pretty straightforward, as shown in test/hello.cc:

#include <iostream>
#include "event.h"

enum { HELLO /* event type */ };

using namespace CyberzOrg::Event;

struct HelloEmitter
 : Emitter<
  Event<HELLO, void (const std::string &)>
 >
{ };

void callback(const std::string &s) {
 std::cout << "Event HELLO: " << s << std::endl;
}

int main() {
 HelloEmitter hello;

 // preferred syntax (useful if event emitter has the event table depending on itself,
 // in such case getSignal method is not directly visible).
 getSignal<HELLO>(hello).connect(callback); // connect signal handler (callback)
 getSignal<HELLO>(hello)("hello world"); // fire signal

 // easy syntax
 hello.getSignal<HELLO>().connect(callback); // connect signal handler (callback)
 hello.getSignal<HELLO>()("hello world"); // fire signal
}

You can look at sources or download a tarball. Any feedback is well accepted.

22
May

Controlling the HP NetServer 5/133 LS2 LCD

The following article is dated back to Sat Dec 6 20:15:41 CET 2003

Some time ago, I got an old HP NetServer 5/133 LS2 (that I revived with FreeBSD):

HP Netserver 5/133 LS2

After giving some progress informations during the boot process, I noticed that the front LCD display gets stuck with useless informations when the system is up and running, as shown here:

HP NetServer 5/133 LS2 LCD Display

Since I wanted to put some meaningful text into the LCD, I started investigating around for a way to accomplish that.

Read moreRead more

8
Dec

SVGPan: a Javascript SVG (Viewer) Pan/Zoom/Drag library

Some time ago the need for a browser-compatible vectorial language pushed me to consider the SVG markup language (I won’t say anything about Internet Explorer – it’s just unsupported there). The language itself is great, but, as a beginner, I was so disappointed about the fact that on the Internet I couldn’t find ANY library ready to use for panning and zooming features that I had to write one from scratch.

The SVGPan library features:

  1. Panning (pan à la Google maps) (click on the white background and pan)
  2. Zooming (using the mouse wheel)
  3. Element dragging (click on a drawing element and drag it somewhere else)
  4. Combinations of the above like zooming while dragging

The resulting javascript library is published here, in the hope that someone can find it useful. The library itself is very small and easy to use; and it’s licensed under the BSD license. You can try a demo here


No SVG support at all!

Read moreRead more

7
Dec

Bode and Nyquist diagrams using GNU Octave

Using GNU Octave is easy to plot Bode and Nyquist diagrams, as follows:

bode(zp([], [-1*i, i, -1], 1))

nyquist(zp([-0.5], [0.0, -0.2, -4], 1))

8
Jun

Bacula mail changer script (aka poor man’s autoloader)

I enjoy Bacula for automated home backups on DLT and DDS tape drives. Being used at home there’s no – obviously – big-dollar-company-manager to ask for an autoloader; and when the time of a tape change comes bacula lacks a simple way to request a manual tape change and just hangs up. So I managed to build a fake autoloader shell script, which, using emails, would emulate a real autoloader. This script, which I baptised mail-changer, features:

  • email support
  • periodic email resend when tape change is needed
  • tape detection and check (if you’re supposed to insert tape 4 and you enter 5, the script will kindly refuse the tape, unload it and send a warning email message asking for the right one)

Read moreRead more

8
Jun

Some applications using I2C

Parallel and serial ports are disappearing from today’s pc making life harder for the people who wants to connect their home-made devices to a pc. The USB bus seems to be very appealing but it has the drawback of complexity while the I2C bus is very easy to implement and it’s widely supported by many devices, with the drawback of no direct pc connection (to be honest it’s used inside the pc, so somewhere on the motherboard there is a I2C bus, but yet I haven’t found any decent connection to the external world to use it – no, i won’t solder things on memory modules). Since the first way to start experimenting with I2C is building an I2C port, I’ve built a parport-to-i2c interface implementing the I2C schematic made by Kosma Moczek with the idea of replacing it with a more modern USB-to-I2C solution in the future.

So here it is the prototype of the parport to I2C interface:

The i2c board

Read moreRead more

18
Feb

Code Review

qa

3
Jan

Nagios nrpe and sudo: “NRPE: Unable to read output”

On CentOS 5 (and RedHat EL as well), you can encounter the following behaviour when configuring an nrpe plugin with sudo:

[andrea@feyd ~]$ /usr/lib/nagios/plugins/check_nrpe -H 1.2.3.4 -c check_md_raid
NRPE: Unable to read output

Read moreRead more