Me, myself & I

Andrea Leofreddi's blog

Random code  

  • Home
  • About

macOS: X cannot be opened because the developer cannot be verified

Lately I was installing the embedded ARM toolchain to compile some STM32 code, and I ran into this beautiful error: If you are a macOS user it's very probable that you have already...

  • Andrea Leofreddi
    Andrea Leofreddi
1 min read

macOS & PL-2303

The Olimex USB-serial-cable - a 3.3v USB-to-serial adapter based on the PL2303XA chip - won't work out of the box on macOS. While there are various drivers out there in the wild, my...

  • Andrea Leofreddi
    Andrea Leofreddi
1 min read
Java

OpenJDK 9 & macOS: java.lang.UnsatisfiedLinkError: Library not loaded: @rpath/libfreetype.6.dylib

Some time ago I wrote a post on how to brew and manage multiple (Adopt)OpenJDK versions on your mac - which is my current java setup. Premised so, lately I wanted to install...

  • Andrea Leofreddi
    Andrea Leofreddi
1 min read
AWS

AWS Cognito: list of users

AWS Cognito is a great tool to chop-off authentication from your app, with a lot of bonuses when it comes to single sign on and integration with existing directories, but the web console...

  • Andrea Leofreddi
    Andrea Leofreddi
2 min read

Generator remote start hack

DISCLAIMER Carbon monixide is very poisonous and can kill quickly! Under no circumstances I will be held responsible or liable in any way for any claims, damages, losses, death, expenses, costs or liabilities...

  • Andrea Leofreddi
    Andrea Leofreddi
11 min read
macOSX

Manage multiple jdk versions on macOS

Using homebrew It's super easy to install any JDK version from the adoptopenjdk builds: Andreas-Mac-mini:installer a.leofreddi$ brew tap AdoptOpenJDK/openjdk ==> Tapping adoptopenjdk/openjdk Cloning into '/Users/a.leofreddi/Applications/homebrew/Library/Taps/adoptopenjdk/homebrew-openjdk'... remote: Enumerating objects: 24, done. remote: Counting objects:...

  • Andrea Leofreddi
    Andrea Leofreddi
1 min read
macOSX

Perl fails to compile XS modules on macOS Mojave

On Mojave, I ran into a situation while trying to install CryptX via CPAN: "/usr/bin/perl" -MExtUtils::Command::MM -e 'cp_nonempty' -- CryptX.bs blib/arch/auto/CryptX/CryptX.bs 644 "/usr/bin/perl" "/System/Library/Perl/5.18/ExtUtils/xsubpp" -typemap '/System/Library/Perl/5.18/ExtUtils/typemap' -typemap '/Users/a.leofreddi/.cpan/build/CryptX-0.063-EfIC0d/typemap' CryptX.xs > CryptX.xsc mv CryptX.xsc...

  • Andrea Leofreddi
    Andrea Leofreddi
1 min read

Using Slf4j from C++ JNI

Lately I've been gluing some Java+Netty code with a C++ native library, and I wanted the native C++ code to use Java's logging too (in this case the ubiquitous slf4j framework). So, let's...

  • Andrea Leofreddi
    Andrea Leofreddi
4 min read

Internet is a safe place

In the meantime... a.leofreddi@XXX's password: Last login: Thu Oct 13 17:26:12 UTC 2016 from YYY on pts/0 Last failed login: Sat Oct 29 12:23:42 UTC 2016 from ZZZ on ssh:notty There were 135084...

  • Andrea Leofreddi
    Andrea Leofreddi
1 min read

Scanner with mono document-feeder: how to scan double-sided documents?

I'm a happy owner of a Brother DCP-9020CDW which has a nice document-feeder feature, allowing you to automatically scan multi page documents (and perfectly integrated with macOSX). Unfortunately the feeder there is able...

  • Andrea Leofreddi
    Andrea Leofreddi
1 min read
Unix

How to compress a PDF file on MacOSX (& Linux)

Often (and especially when scanning documents with my printer) from MacOSX I would get unreasonable huge PDFs which are not suitable for emails. To strip them down without pain one can use ghostprint:...

  • Andrea Leofreddi
    Andrea Leofreddi
1 min read

Yubico Yubikey, CentOS/RHEL 7 and ssh

Today I wanted to setup ssh yubikey authentication for a CentOS 7 box, and I've lost more time that expected. Since I've found a lot of wrong documentation I'm posting below the correct...

  • Andrea Leofreddi
    Andrea Leofreddi
2 min read

TimEL: a new streaming API

TimEL is a Java library specifically developed to evaluate time-series expressions using a user-friendly language. Check out the new version which comes a new streaming API allowing it to crunch very large amounts...

  • Andrea Leofreddi
    Andrea Leofreddi
1 min read
Java

Jetty on RHEL 7/CentOS 7

If you look around on the internet you may find a lot of blogs guiding you on the installation of Jetty in RHEL 7 (or CentOS) which require you to download a new...

  • Andrea Leofreddi
    Andrea Leofreddi
2 min read

cyberz.org is now vleo.net

Back in the 90s I used to hang out on irc, and there, for many years, I’ve used the cyberz nickname, hence cyberz.org. But life goes on and a lot of things changed...

  • Andrea Leofreddi
    Andrea Leofreddi
1 min read

SELinux: how to change default context of a directory

Sometimes you may want to override the default SELinux context for a given path. This can be easily accomplished editing adding an entry (which is made by a path regexp and the selinux...

  • Andrea Leofreddi
    Andrea Leofreddi
1 min read

WebLogic 12c: very slow domain creation

While creating a new domain on Linux, your Weblogic gets stuck at the following message? Try passing the option to the JVM!

  • Andrea Leofreddi
    Andrea Leofreddi
1 min read

Resuming an scp transfer

Did it ever happen to you that while you're scp'ing a huge file the connection drops and you have to start all over again? There are big chances that you know I'm talking...

  • Andrea Leofreddi
    Andrea Leofreddi
1 min read

How to expand a ZFS device

Nowadays virtual environment are very common, thus a hot increase of an existing drive into a virtual machine is a very common operation (roughly equivalent to a LUN expansion in SAN). When you...

  • Andrea Leofreddi
    Andrea Leofreddi
1 min read

SMF Manifest for Oracle 12c DBMS on Solaris 11.1

Here’s the procedure for adding Oracle 12c DBMS as SMF service in Solaris 11.1, based on this guide. The version provided here is slightly modified for the sake of simplicity as It needs...

  • Andrea Leofreddi
    Andrea Leofreddi
1 min read

Java State Machine (JSM): build your own Deterministic Finite Automaton in Java!

Some time ago I’ve built some code to declare Finite State Machines in Java in an annotated fashion so you wouldn’t have to bother yourself with state handling. Since it turned out that...

  • Andrea Leofreddi
    Andrea Leofreddi
1 min read

Integrating Oracle and MySQL with Bacula

After putting your precious data into your preferred database (Oracle or MySQL if you’re here) your next worry should be how to back them up. Here Bacula comes to help as a valid...

  • Andrea Leofreddi
    Andrea Leofreddi
2 min read

Multi-lun autoloader with VMware ESXi 5.0 with Adaptec SCSI HBA

VMware ESXi 5 is not able to handle multi-lun devices by default, so many SCSI autoloaders are not supported as-is (as HP StorageWorks LTOs), showing only the tape drive or media changer but...

  • Andrea Leofreddi
    Andrea Leofreddi
1 min read

Proguard on MacOSX

While executing proguard (via maven2) on MacOSX Snow Leopard, I’ve got the following error: [proguard] Error: Can't read [/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/lib/rt.jar] (No such file or directory) Similarly, you can also get the following error: [proguard]...

  • Andrea Leofreddi
    Andrea Leofreddi
1 min read

Solaris 11 Express: bind an iSCSI target to an IP

Lately I wanted to bring the advantages of ZFS (on Solaris 11 Express) to a Linux box using iSCSI. After following the Oracle guide, I’ve noticed an unexpected behaviour when discovering the iSCSI...

  • Andrea Leofreddi
    Andrea Leofreddi
1 min read

OpenWRT on TP-Link TL-WR743ND

TP-Link TL-WR743ND is the PoE brother of the common TL-WR741ND wireless router which is supported flawlessly by openwrt. Since I’ve got one WR743ND, I wanted to convert it into a useful OpenWRT router...

  • Andrea Leofreddi
    Andrea Leofreddi
4 min read

CadSoft Eagle and Fedora Linux x86_64

CadSoft’s Eagle (a well known CAD tool for designing PCBs) is not compatible as-is with Linux 64 bit. In my case, after a fresh Fedora 14 install, I was getting this error: #...

  • Andrea Leofreddi
    Andrea Leofreddi
1 min read

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

  • Andrea Leofreddi
    Andrea Leofreddi
2 min read

I²C Anemometer: cheap wind data logger

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

  • Andrea Leofreddi
    Andrea Leofreddi
3 min read

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

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

  • Andrea Leofreddi
    Andrea Leofreddi
1 min read

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

Some time ago I had a need to display some vectorial drawings on the web so I've found out that SVG is decently supported by modern browsers (I won’t say anything about Internet...

  • Andrea Leofreddi
    Andrea Leofreddi
2 min read

Bode and Nyquist diagrams using GNU Octave

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

  • Andrea Leofreddi
    Andrea Leofreddi
1 min read
Backup

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

  • Andrea Leofreddi
    Andrea Leofreddi
3 min read
Electronics

Some applications using I²C

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. Some time ago I was considering USB, but...

  • Andrea Leofreddi
    Andrea Leofreddi
7 min read
Delirium

Code Review

  • Andrea Leofreddi
    Andrea Leofreddi
1 min read
Linux

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/checknrpe -H 1.2.3.4 -c checkmd_raid NRPE: Unable to read output...

  • Andrea Leofreddi
    Andrea Leofreddi
1 min read
Linux

Using samba with autofs on Fedora 9

Mount a samba share on the fly without having it mounted statically at boot via the file can bring you the advantage of a painless boot in case of unavailability of the samba...

  • Andrea Leofreddi
    Andrea Leofreddi
1 min read
Delirium

Bash delirium (delirio in bash)

  • Andrea Leofreddi
    Andrea Leofreddi
1 min read
Amarok

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: To make it work, just

  • Andrea Leofreddi
    Andrea Leofreddi
1 min read
Linux

SSH X11 forwarding issue

Recently I’ve been in an awkward situation with ssh and X11 forwarding, where ssh using the classic or option wasn’t working (DISPLAY was not set): [andrea@duncan ~]$ ssh -Y root@thufir root@thufir's password: Last...

  • Andrea Leofreddi
    Andrea Leofreddi
1 min read
Delirium

Artificial Intelligence

?- 1 + 2 = 3. fail.

  • Andrea Leofreddi
    Andrea Leofreddi
1 min read
sata

Solaris 10 si3124 backport (workaround for bug

Do you think you can get a fast cheap SATA mass storage at home with Solaris 10 and ZFS just plugging a cheap si3124 controller? Not so easily: on Solaris 10 you will...

  • Andrea Leofreddi
    Andrea Leofreddi
3 min read
Solaris

seq equivalent

On platforms without (MacOSX, Solaris), you can emulate it using as follows (note the upper bound and the lower bound): For example: alia:~ andrea$ echo '[1+pd5>aq]sa0 1-lax' | dc 0 1 2 3...

  • Andrea Leofreddi
    Andrea Leofreddi
1 min read

Projects

Sometimes I code something, which might eventually be published here; as I did so far for the followings: - Sun Mar 26 12:45:09 CEST 2006, NNet, a multilayered metaprogrammed c++ neural network. Network...

  • Andrea Leofreddi
    Andrea Leofreddi
1 min read
News

Last of the Mohicans

After years of heroic resistance my site finally became a blog.

  • Andrea Leofreddi
    Andrea Leofreddi
1 min read

NNet: a metaprogrammed C++ neural network

NNet is a (metaprogrammed) neural network. It allows the selection of the network layout (number of layers and activation functions) in a simple way, without runtime costs -- check out the following 2...

  • Andrea Leofreddi
    Andrea Leofreddi
1 min read

Controlling the HP NetServer 5/133 LS2 LCD

Some time ago I got an old HP NetServer 5/133 LS2 (that I revived with FreeBSD). After giving some progress during the boot process, the front LCD display gets stuck with a useless...

  • Andrea Leofreddi
    Andrea Leofreddi
5 min read
Andrea Leofreddi's blog © 2026
Latest Posts GitHub LinkedIn Ghost Astro