cyberz.org

December 8, 2009

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

Filed under: News — andrea @ 7:37 pm

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

View code
Title: SVGPan demo
Description: Hello

(more…)

December 7, 2009

Bode and Nyquist diagrams using GNU Octave

Filed under: News — andrea @ 6:51 pm

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))

June 8, 2009

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

Filed under: News, Solaris, Technical, Unix — Tags: , , , — andrea @ 11:16 pm

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)

(more…)

Some applications using I2C

Filed under: News — Tags: , , , — andrea @ 10:49 pm

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 schematics 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

(more…)

February 18, 2009

Code Review

Filed under: News — Tags: — andrea @ 7:34 pm

qa

January 3, 2009

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

Filed under: Unix — Tags: , , , — andrea @ 7:21 pm

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

(more…)

September 7, 2008

Using samba with autofs on Fedora 9

Filed under: News — Tags: , — andrea @ 3:55 pm

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

(more…)

April 18, 2008

Bash delirium (delirio in bash)

Filed under: Unix — Tags: — andrea @ 1:19 pm

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

April 13, 2008

MusicBrainz not working with Amarok on Fedora 8

Filed under: News — Tags: , — andrea @ 11:14 am

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

April 12, 2008

SSH X11 forwarding issue

Filed under: Unix — Tags: , , , — andrea @ 10:38 pm

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@vladimir
root@vladimir's password:
Last login: Sat Apr 12 23:30:09 2008 from ***
[root@vladimir ~]# echo $DISPLAY
[root@vladimir ~]#

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

Newer Posts »

Powered by WordPress