Saturday, August 22, 2026

Visualize Network Performance in Jenkins with the MTR Plugin

As a system administrator or DevOps engineer, troubleshooting network latency and packet loss between servers is a critical but often tedious task. The jwms-mtr-plugin for Jenkins offers an elegant solution by integrating the powerful network diagnostic tool mtr (My TraceRoute) directly into your Jenkins environment, presenting the results as interactive visual graphs.

This plugin transforms raw command-line output into a clear, visual network map. Based on the project's GitHub page, here is a guide on how to set it up and use it in your Jenkins instance.

What is the jwms-mtr-plugin?

This Jenkins plugin allows server administrators to visualize network traceroute tool output directly within the Jenkins web interface. Instead of sifting through text logs, you get a dynamic graph that shows the network path between two hosts, making it easy to spot where latency or packet loss is occurring.

The project was created to provide a "repetitive success in network diagnostic collection, monitoring and report display," making it a valuable tool for automating network health checks as part of your CI/CD pipeline.

Key Features

  • Interactive Visualizations: Uses the vis.js library to display network paths as an interactive graph.

  • Geolocation Data: Can show the geographical location (country, region, city) of each hop when you point your mouse at a node.

  • Flexible Node Configuration: Allows you to define multiple node pairs (e.g., host1->host2) to monitor network paths between various servers.

  • Jenkins Integration: Seamlessly adds a "MTR Report" link to your Jenkins project's build page.

Step-by-Step Setup Guide

Here's how to get the plugin up and running in your Jenkins environment, based on the project's documentation.

1. Prerequisites

  • Jenkins: A running Jenkins instance.

  • Java: Java 8 or later.

  • Python: Python 2 or later (for the helper scripts).

  • MTR: The mtr command-line tool must be installed on all hosts you want to monitor.

  • Jenkins Plugin: Download the .hpi file from the project's releases page.

2. Install the Plugin in Jenkins

  1. In your Jenkins dashboard, go to Manage Jenkins > Manage Plugins.

  2. Go to the Advanced tab.

  3. Under the "Upload Plugin" section, choose the downloaded .hpi file and click Upload. Restart Jenkins if required.

3. Configure a Jenkins Freestyle Project

  1. Create a new Freestyle project in Jenkins.

  2. In the Build section of your project configuration, click Add build step and select 'Node Pair' from the dropdown list.

4. Configure SSH Credentials

In the build step configuration:

  • Provide the SSH username, SSH password, and SSH port. The plugin will use these credentials to connect between the nodes you specify.

  • The documentation recommends having a "common monitoring ssh user" for simplicity. Make sure this user has the necessary permissions to run mtr on the target machines.

5. Define Your Node Pairs

In the "Node pair" text area, define the pairs of hosts you want to trace. The format is simple: one pair per line, separated by ->.

host1.mydomain.com->host2.mydomain.com,

host2.mydomain.com->host1.mydomain.com,

host3.mydomain.com->host1.mydomain.com,

host1.mydomain.com->host3.mydomain.com,

6. Add Supporting Python Files

This step is crucial for the visualization and geolocation features.

  1. Create a Directory: Create a directory on your Jenkins server that Jenkins can read (e.g., /var/lib/jenkins/mtr-data).

  2. Copy Files: Copy the following files from the plugin's source repository (src/main/resources) into the directory you just created:

    • IP2Location.py

    • IPV6-COUNTRY-REGION-CITY-ISP.BIN (or an updated version)

    • sample.py

Note on Database Updates: You can download updated IP2Location LITE databases from their official site to get more accurate geolocation data. Just replace the .BIN file in your directory with the new one.

7. Run the Build and View the Report

  1. Click Build Now on your project's main page. You can monitor the console output to check for any errors.

  2. Once the build finishes, you will see a new 'MTR Report' link on the build's status page.

  3. Click the link to view the interactive network graph.

8. Interact with the MTR Report

  • The main visualization will show the network path between your defined nodes.

  • Hover your mouse over a node (represented by PC icons or circles) to see detailed information, including the IP address, hostname, and its geographical country based on the IP2Location database.

Important Considerations

  • Security: Be mindful of the SSH credentials you store in Jenkins. It is best practice to use a dedicated, limited-privilege user for monitoring tasks.

  • File Permissions: Ensure the Jenkins process has read permissions for the directory where you placed the Python files and the IP2Location database.

  • Maintenance: Remember to occasionally update the IP2Location database to keep geolocation data current.

Conclusion

The jwms-mtr-plugin is a fantastic example of a specialized Jenkins plugin that solves a specific operational problem with a beautiful user interface. By automating mtr runs and visualizing the results, it saves time and makes network diagnostic data accessible to the whole team. If you manage a distributed system, this plugin is definitely worth adding to your Jenkins toolkit.

Saturday, August 8, 2026

Streamlining Your Python Projects with common-util-py: A Handy Toolkit

As Python developers, we often find ourselves reinventing the wheel, writing the same helper functions for file handling, data processing, or logging across different projects. This is where a utility package like **common-util-py** comes to the rescue. Designed as a "library including all the common functionalities used in Python projects" , it aims to provide a standardized set of tools to speed up development and keep your codebase clean.


In this blog post, we'll explore what this project offers and how you can use it to make your Python development more efficient.


## What is common-util-py?


At its core, `common-util-py` is a Python package that serves as a collection of frequently used utilities. While the official PyPI page  is quite minimal, other sources describe it as a "🐳 Library including all the common functionalities used in Python projects" . This suggests it's designed to be a go-to resource for common programming tasks.


The package is licensed under the Apache 2.0 License  and supports modern Python versions (3.11 through 3.14) , making it suitable for a wide range of projects. Its latest version, 1.0.4, was released in July 2022  and has no known security vulnerabilities according to safety analyses .


## Getting Started


### Installation


Installing `common-util-py` is straightforward using pip, Python's package installer. Open your terminal or command prompt and run:


```bash

pip install common-util-py

```


This command will download and install the latest version of the package from the Python Package Index (PyPI) .


### Basic Usage


After installation, you can start using the utilities by importing the package into your Python scripts. Based on similar utility packages (like `py-common-util`), you might use it like this:


```python

import common_util_py


# Or, to use specific modules (assuming a structure similar to other common util packages):

# from common_util_py.common import date_utils, file_utils, etc.

```


**Note:** The specific module structure isn't detailed in the available resources, but the goal is to provide a cohesive set of tools. For more complex examples, such as those involving database operations or workflow management, you might look at similar packages like `at-common-util` .


## Potential Use Cases


While the exact functions of `common-util-py` are not exhaustively listed, we can infer its typical use cases from similar utility libraries:


1.  **Simplifying Common Tasks:** It likely provides helper functions for tasks like:

    - **File I/O:** Reading and writing files in various formats.

    - **Data Manipulation:** Working with lists, dictionaries, and strings.

    - **Date and Time:** Formatting and calculating dates and times.

    - **Logging:** Setting up and managing log files for debugging and monitoring.


2.  **Reducing Code Duplication:** Instead of writing the same functions repeatedly, you can rely on a well-tested library to handle these for you. This makes your code cleaner and easier to maintain.


3.  **Providing a Consistent Foundation:** By using a standard utility library across your projects, you ensure a consistent approach to common operations, making it easier for new team members to understand the codebase.


## Important Considerations


- **Check the Documentation:** Since the official PyPI page is sparse, you'll need to dig deeper to find comprehensive documentation. A good starting point is to explore the package after installation using Python's `help()` function or `dir()` to see what modules and functions are available.

- **Explore the Source:** If the package is hosted on a platform like GitHub, checking the source code can give you a clear picture of its capabilities.

- **Evaluate Alternatives:** The Python ecosystem has many excellent utility libraries, such as `ubelt` . It's always a good idea to evaluate different options to find the one that best fits your needs.


## Conclusion


`common-util-py` aims to be a valuable asset for Python developers by providing a central repository of useful functions. While its documentation could be more detailed, its core promise—to offer common functionalities and reduce repetitive coding—is compelling. If you're looking to standardize your helper functions and speed up development, give `common-util-py` a try. It might just become a staple in your Python toolkit.


Have you used `common-util-py` or a similar utility library? Share your experiences in the comments below

Saturday, July 25, 2026

Testing Your RAM with memtester: A Simple But Powerful Tool for System Stability

 Have you ever experienced random system crashes, mysterious application errors, or corrupted files? Sometimes, the culprit isn't a software bug—it's faulty memory. The memtester utility, originally created by Charles Cazabon and updated by Jason Wee, is a powerful yet simple tool designed to help you diagnose exactly this problem.

What is memtester?

At its core, memtester is a utility for testing your computer's memory subsystem to determine if it's faulty. It's not a replacement for comprehensive hardware diagnostics, but it's an incredibly useful first line of defense when you suspect memory issues.

What makes memtester special? Unlike many memory testing tools that require you to boot from an external medium (like Memtest86+), memtester runs directly from your existing operating system. This makes it perfect for quick tests on production systems, embedded devices, or any situation where rebooting isn't practical.

Key Features

Multiple Test Patterns

The software runs a series of eight different tests that catch various types of memory errors:

  • Stuck bits (bits permanently high or low)

  • Data sensitivity issues

  • Addressing problems

  • More subtle errors that only appear under specific patterns

Cross-Platform Support

memtester is incredibly portable, with successful builds reported on:

  • Various Linux distributions (Debian, RedHat, Ubuntu, etc.)

  • FreeBSD, NetBSD

  • macOS (OS X)

  • HP-UX on PA-RISC and Itanium

  • Tru64 Unix on Alpha

Physical Address Testing

For advanced users, memtester supports testing specific physical memory addresses. This can be useful for checking memory-mapped I/O devices or testing specific RAM banks.

Installing and Using memtester

Installation

Installation couldn't be simpler—there's no complex configure script to run:

# Clone the repository
git clone https://github.com/jasonwee/memtester.git
cd memtester

# Build it
make

# Install it (optional, to /usr/local/)
sudo make install

Basic Usage

The basic command syntax is straightforward:

sudo memtester <memory-amount> [runs]

For example, to test 256 megabytes of memory:

sudo memtester 256M

If you want to run the test only once (the default is unlimited):

sudo memtester 256M 1

Important Notes on Usage

  1. Run as Root: memtester needs root privileges to lock memory pages, preventing them from being swapped out. Without this, testing becomes slow and inaccurate.

  2. Memory Amount: You can specify memory in bytes (B), kilobytes (K), megabytes (M), or gigabytes (G). For example: 256M, 1G, 1024K.

  3. Memory is Overwritten: The memory you're testing will be overwritten during testing. Don't point it at memory containing critical system data or running applications!

When Should You Use memtester?

Here are some common scenarios where memtester proves invaluable:

  • After hardware upgrades: Just added new RAM? Test it before trusting it with your data.

  • System instability: If you're experiencing random crashes, freezes, or corruption, memory issues should be on your suspect list.

  • Embedded systems: For devices without external boot media, memtester can be cross-compiled and run directly.

  • Overclocking: Testing memory stability after overclocking your system.

Advanced Use Cases

Testing Specific Memory Regions

If you have hardware that exposes memory via /dev/mem or a custom device file:

# Test memory at physical address 0x0C0000 (64KB region)
sudo memtester -p 0x0c0000 64k

Custom Device Files

# Test device memory via a custom device file
sudo memtester -p 0 -d /dev/foodev 64k

The jasonwee Repository

The GitHub repository maintained by jasonwee serves as a convenient mirror of the original memtester source, with the latest version (4.7.1 as of December 2024). It includes:

  • The complete source code

  • Build scripts

  • Documentation files

  • Licensing information (GPL v2)

The maintainer builds it for work-related purposes, making it easy to access the latest stable version.

Limitations and Alternatives

While memtester is incredibly useful, it's important to understand its limitations:

  1. Not as comprehensive: For thorough testing (especially finding intermittent errors), you might want to use Memtest86+ or similar bootable tools.

  2. Requires free memory: You can only test memory that's not in use by the system.

  3. Performance impact: The tests can be resource-intensive and may affect system performance.

Final Thoughts

memtester is a gem in the sysadmin's toolkit. Its simplicity, portability, and ability to run from a live system make it an essential utility for diagnosing memory problems quickly. Whether you're a system administrator, developer, or enthusiast, having this tool in your arsenal can save you countless hours of debugging mysterious issues.

The jasonwee GitHub repository ensures this valuable tool remains easily accessible and up-to-date. So next time your system acts up, give memtester a run—it might just identify the problem faster than you'd expect!



Saturday, June 27, 2026

🧰 Building a Practical Java Utility Library: Exploring common_java

 When working across multiple Java applications, one problem appears again and again:

you keep rewriting the same “basic but essential” components.

common_java is a lightweight utility-style library that groups these repeated concerns into reusable modules — from validation and caching to HTTP, database helpers, and email utilities.

Let’s walk through what this library provides.

📦 1. Project Overview

The library is organized into clear functional packages:

  • validator → input validation logic
  • string → string utilities
  • cache → in-memory caching (including LRU cache)
  • network → HTTP and IP utilities
  • http → URL fetch example app
  • alert → email composition and sending
  • database → JDBC helpers and result handling
  • properties → config loading utilities

This is a classic “common utilities” architecture: each package solves a real-world repetitive backend problem.

✅ 2. Validation Layer

Key classes:

  • Validator
  • EmailValidator

This layer focuses on ensuring data correctness before processing.

Typical responsibilities:

  • checking input format
  • validating email structure
  • centralizing reusable validation rules

💡 Design idea:
Instead of scattering validation logic across services, it is centralized.

Example concept:

Validator.isNotNull(value);

EmailValidator.isValid(email);

🧵 3. String Utilities

Hex.java

This likely provides:

  • hex encoding / decoding
  • conversion between byte arrays and hex strings

💡 Why it matters:
Hex utilities are commonly needed in:

  • encryption
  • networking
  • debugging binary data

⚡ 4. Cache System (Most Interesting Part)

Core classes:

  • Cache
  • LRUCache
  • CacheElement
  • Node
  • LinkedListNode
  • DoublyLinkedList
  • DummyNode
  • CacheApp

🧠 What this module shows

This is a classic LRU Cache implementation using:

  • Hash-based lookup (likely via Cache)
  • Doubly linked list for ordering
  • Node abstraction for entries

🔁 LRU Cache concept

Least Recently Used (LRU) cache works like this:

  • Recently used items stay in memory
  • Old unused items are removed first

🧱 Data structure design

This design typically combines:

  • HashMap → O(1) access
  • Doubly Linked List → O(1) insert/remove

💡 Why multiple node classes?

  • Node → base structure
  • LinkedListNode → real element
  • DummyNode → sentinel node (simplifies edge cases)

This shows clean separation of concerns in data structure design.

🚀 Why this module stands out

This is not just a utility — it’s a fully custom cache engine, useful for:

  • performance optimization
  • memory control
  • backend caching strategies

🌐 5. Network Utilities

Classes:

  • HttpUtil
  • HttpClientApp
  • HttpResponse
  • HttpResponseCode
  • IP

What this module does

It likely provides:

  • HTTP GET/POST helpers
  • response wrapper object
  • HTTP status code abstraction
  • IP-related utilities

💡 Design strength

Instead of directly using low-level HTTP calls everywhere, the library:

✔ wraps HTTP logic
✔ standardizes response handling
✔ centralizes error handling

This improves consistency across projects.

📧 6. Email / Alert System

Classes:

  • Email
  • EmailAddress
  • EmailBody
  • EmailAttachment
  • SMTP
  • EmailApp

What this represents

A structured email system with:

  • strongly typed email components
  • separation of:
    • recipient (EmailAddress)
    • content (EmailBody)
    • attachments (EmailAttachment)
  • SMTP abstraction

💡 Why this design is good

Instead of passing raw strings:

sendEmail(to, subject, body)

You model email as an object:

Email email = new Email(...)

This improves:

  • readability
  • validation
  • maintainability

🗄️ 7. Database Utilities

Classes:

  • DatabaseManager
  • DatabaseStatementManager
  • StatementUtil
  • Jdbc
  • Result
  • RStoListMap

What this module solves

JDBC in Java is powerful but verbose.

This module likely simplifies:

  • connection handling
  • statement execution
  • result set mapping

💡 Key idea: abstraction over JDBC

Instead of repeating boilerplate:

Connection conn = ...
PreparedStatement stmt = ...
ResultSet rs = ...

You centralize it into utilities.

🔁 RStoListMap

This likely converts:

ResultSet → List<Map<String, Object>>

This is extremely useful for:

  • APIs
  • JSON conversion
  • dynamic queries

⚙️ 8. Configuration Utilities

ConfigApp

This likely handles:

  • loading .properties files
  • environment configuration
  • app-level settings

💡 Why it matters:

Every Java system needs config loading, and centralizing it avoids duplication.

🌍 9. HTTP Example App

UrlFetchApp

This is likely a demo or utility showing:

  • fetching URL content
  • using HttpUtil

This acts as:

a usage example of the network module

🧠 Overall Design Observations

✔ Strengths

1. Clear modular separation

Each package has a single responsibility.

2. Real-world utility coverage

It covers:

  • validation
  • caching
  • HTTP
  • email
  • database

This is basically a mini backend toolkit.

3. Strong focus on reusability

Everything is designed to be reused across projects.

🚀 Final Summary

common_java is essentially a personal backend utility framework that helps reduce repetitive Java boilerplate across projects.

It demonstrates:

  • practical backend engineering patterns
  • data structure implementation (LRU cache)
  • abstraction over JDBC and HTTP
  • structured email handling
  • reusable validation logic