lnxsense, a system monitoring tool for Linux

Ever since I got my AMD Athlon XP 2500+, I’ve been into overclocking. While my overclocking activities were limited at the time (as a student I couldn’t risk burning up my CPU or motherboard), I made sure that ever since, none of my desktops ran at stock speeds. Even my trusty Intel 2500K that I’m writing this blog on still hums along at 4,4Ghz all core.

Overclocking has always been a Windows thing though, and for good reason; in 2009 the Linux market share was only 0,6%, while Windows dominated the market with a 95% market share. With such a dominating OS, motherboards manufacturers focused fully on (usually terrible) software which allowed you to overclock and monitor your system without leaving Windows. The overclocking community didn’t stop there either, tools like 8rdavcore (apparently ported from Linux), setfsb, MemSet, CPU-Tweaker and many more made it possible to overclock and tweak your system to the max. Combined with a lot of monitoring software like HWInfo, Aida64, SpeedFan, CPU-z and benchmarks like 3Dmark, Sisoft Sandra, Cinebench, and it was clear: overclocking belonged to Windows.

Fast forward to 2025, and things have changed; Linux has a market share of 3% while Windows has dropped to 66%. OCCT is now also available on Linux, GreenWithEnvy makes it easier to overclock NVIDIA gpu’s and benchmarks like y-cruncher, 7-zip and Geekbench run fine on Linux. But when it comes to graphical monitoring applications, we only have Psensor or xsensors. Both work fine but it can still be better.

A screenshot showing xsensors and psensor side by side
Xsensors and PSensor side by side

This is where I want to change a couple of things and after this years release of Java 25 and its Foreign Function and Memory API, I can finally work in a language I love while using C libraries like libsensors, libcpuid, the NVIDIA management API and many more.

After returning from Devoxx I decided to create a Linux alternative to Open Hardware Monitor, HWMonitor and HWInfo and that’s how lnxsense was born. It’s a still in early alpha stages and what it can show depends heavily on what the underlying libraries can return (e.g. NVIDIA’s nvml doesn’t even have an option to get the hotspot temperature or actual fan RPM). Even so, I’m already really happy with what it can do.

lnxsense showing different metrics like cpu usage, power draw, GPU frequency.

In it’s very early stage it supports (when running the back-end server as root)

  • CPU Frequencies (as reported by the Linux kernel)
  • CPU Utilization
  • Memory Utilization
  • Core temperatures
  • Intel requested VCore (the VID)
  • Intel Core multipliers
  • Intel Throttling reasons
  • Intel RAPL Power Management information like PP0, PP1 and Platform power limits and usage
  • NVIDIA Clocks, Utilization, Temperature and Fan speed (in % because why would nvml expose the actual fan speed), P-state and current PCIe speed
  • SMART and NVMe log
  • Blockdevice IOPS and read/write speed
  • Remote monitoring using sockets

If you want to try it out, you can download a release version from Codeberg. Just be sure to read the INSTALL.md, it’s still in early development, so it’s not a one-click experience and definitely not production-ready.

// 2025/12/15: I decided to rename the project from HWJinfo to lnxsense, it just makes more sense, doesn’t it ?

Eclipse RCP Dynamic popup menu

I do not have a lot of experience with the Eclipse Rich Client Platform (RCP), yet I was asked to create a dynamic submenu for an element in a JFace TreeView. The submenu should be filled in depending on the selected object plus a fixed menu item which should open a new dialog. The menu should be hidden if the selected object has a value set for the property ‘myProperty’.
I’ve struggled for days to get this working, especially since most solutions on the internet referred to the MenuManager which didn’t work at all in my case.

Fortunately, after some trial and error I managed to set up the submenu using the standard plugin extensions.

Continue reading “Eclipse RCP Dynamic popup menu”

Simple Angular.JS 1.3 directive for Bootstrap tooltip

This is a very simple Angular.js (1.3) directive to add a Bootstrap 3 tooltip to any component.

angular.module('angularBootstrapTooltipApp')
  .directive('angularTooltip', function () {
    return {
      restrict: 'A',
      replace: false,
      scope: {
        tooltipPlacement: '=?',
        tooltip: '='
      },
      compile: function compile( tElement, tAttributes ) {
        return function postLink( scope, element, attributes, controller ) {
          if (scope.tooltip !== '') {
            element.attr('data-toggle', 'tooltip');
            element.attr('data-placement', scope.tooltipPlacement || 'top');
            element.attr('title', scope.tooltip);
            element.tooltip();  
          }
          
          scope.$watch('tooltip', function(newVal) {
            if (!element.attr('data-toggle')) {
              element.attr('data-toggle', 'tooltip');
              element.attr('data-placement', scope.tooltipPlacement || 'top');
              element.attr('title', scope.tooltip);
              element.tooltip();  
            }
            element.attr('title', newVal);
            element.attr('data-original-title', newVal);
          });
        };
      }
    };
  });

A simple example:

<button type="button" 
    class="btn btn-default" 
    angular-tooltip
    tooltip-placement="bottom"
    tooltip="title">
{{title}}
</button>
<input type="text" ng-model="title"></input>

Whatever you type, the tooltip will always be up to date.
Screenshot from 2015-05-05 19:41:37

Comes with no guarantee, but feel free to use it wherever you need it.

Maven: A required class is missing: hidden/org/codehaus/plexus/interpolation/ValueSource

I had the following issue when building one of our projects on a freshly installed Linux Mint:

-----------------------------------------------------
this realm = app0.child-container[org.zeroturnaround:javarebel-maven-plugin:1.0.5]
urls[0] = file:/home/phillip/.m2/repository/org/zeroturnaround/javarebel-maven-plugin/1.0.5/javarebel-maven-plugin-1.0.5.jar
urls[1] = file:/home/phillip/.m2/repository/org/codehaus/plexus/plexus-utils/1.5.15/plexus-utils-1.5.15.jar
urls[2] = file:/home/phillip/.m2/repository/commons-io/commons-io/1.4/commons-io-1.4.jar
urls[3] = file:/home/phillip/.m2/repository/commons-lang/commons-lang/2.4/commons-lang-2.4.jar
Number of imports: 10
import: org.codehaus.classworlds.Entry@a6c57a42
import: org.codehaus.classworlds.Entry@12f43f3b
import: org.codehaus.classworlds.Entry@20025374
import: org.codehaus.classworlds.Entry@f8e44ca4
import: org.codehaus.classworlds.Entry@92758522
import: org.codehaus.classworlds.Entry@ebf2705b
import: org.codehaus.classworlds.Entry@bb25e54
import: org.codehaus.classworlds.Entry@bece5185
import: org.codehaus.classworlds.Entry@3fee8e37
import: org.codehaus.classworlds.Entry@3fee19d8


this realm = plexus.core
urls[0] = file:/usr/share/maven2/lib/maven-debian-uber.jar
Number of imports: 10
import: org.codehaus.classworlds.Entry@a6c57a42
import: org.codehaus.classworlds.Entry@12f43f3b
import: org.codehaus.classworlds.Entry@20025374
import: org.codehaus.classworlds.Entry@f8e44ca4
import: org.codehaus.classworlds.Entry@92758522
import: org.codehaus.classworlds.Entry@ebf2705b
import: org.codehaus.classworlds.Entry@bb25e54
import: org.codehaus.classworlds.Entry@bece5185
import: org.codehaus.classworlds.Entry@3fee8e37
import: org.codehaus.classworlds.Entry@3fee19d8
-----------------------------------------------------
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Internal error in the plugin manager executing goal 'org.zeroturnaround:javarebel-maven-plugin:1.0.5:generate': 
Unable to load the mojo 'org.zeroturnaround:javarebel-maven-plugin:1.0.5:generate' in the plugin 'org.zeroturnaround:javarebel-maven-plugin'. 
A required class is missing: hidden/org/codehaus/plexus/interpolation/ValueSource
hidden.org.codehaus.plexus.interpolation.ValueSource
[INFO] ------------------------------------------------------------------------
[INFO] For more information, run Maven with the -e switch
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 47 seconds
[INFO] Finished at: Thu Jan 09 19:08:02 CET 2014
[INFO] Final Memory: 52M/124M
[INFO] ------------------------------------------------------------------------

Turns out that the maven 2 version that comes from the Ubuntu repository is a bit fubar.
Download the latest maven 2 release from maven.apache.org and replace the /usr/share/maven2/lib/maven-debian-uber.jar library with the on from the downloaded archive. Now your build won’t fail (at least on this issue).

Or fix it in shell style:

if [[ -d /usr/share/maven2/lib/ ]]; then echo Good; else echo Maven not installed ?; exit 1; fi
wget http://apache.belnet.be/maven/maven-2/2.2.1/binaries/apache-maven-2.2.1-bin.tar.gz
tar --wildcards --strip-components 2 -xvf apache-maven-2.2.1-bin.tar.gz apache-maven-2.2.1/lib/*
rm apache-maven-2.*-bin.tar.gz
echo Needs root access to change files in /usr/share/maven2/lib/
sudo rm /usr/share/maven2/lib/maven-debian-*.jar
sudo mv maven-2*-uber.jar /usr/share/maven2/lib/

Java Performance with JaPe

One of the hot topics at a client I’m working is “performance”: everything has to be super fast, response times must be super low while the applications are supposed to create unicorns that shit rainbows at the click of a button. When an application is slow, we usually look at the following aspects:

  • Slow web services
  • Memory and garbage collection
  • Anything database related
  • Filesystem interactions

And usually we dig deep using tools like Dynatrace to analyze the performance (or the lack of).

(c) Dilbert.com

What we usually forget is that behind all these web services, database calls etc… is just a lot of Java code. We all now how to achieve high performance on an architectural level, but what if we go a level lower ? What’s the fastest way to do for-loops ? Which Java Collection is the fastest ? Nobody seems to know 8O  .

That’s why I wrote JaPe, a simple Java Performance benchmark. It’s a simple Java benchmark program I wrote to test some commonly used implementation of java.util.Collectionjava.util.Map and some other common things like String concatenation and the differences between primitives and their object counterparts. An hour of coding I thought, I couldn’t be more wrong (ps. if you’re just interested in results and answers, then scroll down to 1/4 of this post).

Continue reading “Java Performance with JaPe”