Skip to content

Recent Articles

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

7
Sep

Using samba with autofs on Fedora 9

Mount a samba share on the fly without having it mounted statically at boot via the /etc/fstab file can bring you the advantage of an unpainful boot in case of unavailability of the samba server like in the following common scenarios:

  • laptop: you mount your pc share at home, but when you move it becomes unavailable
  • workstation: you mount the share of your workmate – but when he/she goes on holiday his/her workstation stays off

Read moreRead more

18
Apr

Bash delirium (delirio in bash)

f1() { :; }; f0() { f$((${#1}==0)) "${1:1}"; echo -n "${1:0:1}"; }; f0 'dlrow olleh'; echo

13
Apr

MusicBrainz not working with Amarok on Fedora 8

On my Fedora 8 system with Amarok I was trying to fill an mp3′s tag header using MusicBrainz, getting the following error:

Tunepimp (MusicBrainz tagging library) returned the following error: "Fingerprinting of .mp3 files is not supported."

To make it work, just yum install libtunepimp-extras-nonfree

12
Apr

SSH X11 forwarding issue

Recently I’ve been in an awkward situation with ssh and X11 forwarding, where ssh using the classic -Y (or -X) switch wasn’t working (DISPLAY was not set):

[andrea@duncan ~]$ ssh -Y root@thufir
root@thufir's password:
Last login: Sat Apr 12 23:30:09 2008 from ***
[root@thufir ~]# echo $DISPLAY
[root@thufir ~]#

If you are experiencing the same and your sshd_config looks fine (which means TCP and X11 forwarding is already enabled) then the answer is missing xauth!

On RedHat yum install xauth will do the trick

31
Mar

Artificial Intelligence

?- 1 + 2 = 3.
fail.