Monthly Archives: June 2025

Speed Up Your Linux System with Zram

Zram, https://www.kernel.org/doc/html/latest/admin-guide/blockdev/zram.html, is a Linux kernel module that creates a compressed block device in RAM. This device can be used as swap space or a general-purpose RAM disk. By compressing data in memory, zram allows your system to store more data in RAM, reducing the need to swap to slower disk storage and improving overall responsiveness.

In particular, zram

  • Increases effective RAM capacity by compressing data.
  • Reduces disk I/O and wear, especially useful on SSDs.
  • Improves performance on systems with limited memory.

If you’re looking to boost your Linux system’s performance, especially on machines with limited RAM, zram is a powerful tool worth exploring.

In this post, I’ll show how to set it up on both Arch Linux and Ubuntu.

Installing zram

On Arch Linux

Install the zram generator package:

On Ubuntu

Install the systemd zram generator:

Configuring zram

Create a configuration file to set up your zram device. For example, to allocate half of your system’s RAM to zram and use the efficient zstd compression algorithm, run:

After saving the configuration, reboot your system to activate zram.

By default, zram will have the precedence over an existing swap partition.

You can use the command zramctl to see the status of zram and swapon to show your swap partitions (zram’s one will be /dev/zram0).

Install Nerd Fonts on macOS with Homebrew

I like Nerd Fonts a lot, and blogged about those in the past. If you spend a lot of time in the terminal, you’ve probably heard of them: they patch popular programming fonts with a huge set of icons, making your terminal and development environment look great and more informative.

Here’s how you can easily install Nerd Fonts on macOS using Homebrew.

Step 1: Install Homebrew (if you haven’t already)

If you don’t have Homebrew installed, open your terminal and run:

Step 2: Install fontconfig

Before installing fonts, it’s a good idea to have fontconfig:

Step 3: Install Nerd Fonts with Homebrew Cask

Homebrew makes it easy to install fonts with the --cask option. Here’s how I install my favorite Nerd Fonts:

You can add or remove fonts from this list as you prefer. Homebrew will handle downloading and installing them for you.

Step 4: Use Your New Fonts

After installation, open your terminal or code editor’s settings and select your preferred Nerd Font from the font list. Now you can enjoy enhanced icons and a better coding experience!


Tip: You can browse all available Nerd Fonts with:

Happy fonts! 🙂

Better diffs in Lazygit with delta

If you use Lazygit as your terminal Git UI, you know how convenient it is for staging, committing, and managing branches.

I use it in Neovim (LazyVim already configures it).

Integrating a custom pager (Lazygit Custom Pagers Documentation) can dramatically improve how diffs are displayed.

In this blog post, I’ll document how to use delta: a syntax-highlighting pager for git, diff, and grep output.

Delta makes diffs much more readable by adding syntax highlighting, line numbers, and custom themes. This is especially helpful when reviewing changes in Lazygit, as it makes it easier to spot what’s changed at a glance.

Installing delta

On Arch Linux (or derivatives), you can install delta with:

For other platforms, check the delta installation instructions.

Configuring Lazygit to use delta

To use delta as the pager in Lazygit, add the following to your ~/.config/lazygit/config.yml:

This tells Lazygit to use delta for displaying diffs, with color always enabled and paging disabled (since Lazygit handles paging itself).

Here are two screenshots with the diffs better highlighted:

Show line numbers

If you want to see line numbers in your diffs, update the pager line with “–line-numbers”.

Customizing delta with themes

Delta supports custom themes for even better readability. You can find a collection of themes here.

To use these themes:

  1. Download the raw themes.gitconfig file, for example, to ~/.config/delta/themes.gitconfig:

  2. Include it in your global Git config by adding the following to your ~/.gitconfig:

  3. To see available themes, run:

  4. Pick a theme you like (e.g., colibri) and enable it in your Lazygit config:

For example, with the “colibri” theme:

With “weeping-willow” theme:

Enjoy your diffs! 🙂

Computing the total test execution time of Maven Surefire

When working with Maven projects, the Surefire plugin is commonly used to execute tests, but it lacks a built-in feature to display the total execution time across all test suites. This can be particularly important when monitoring performance trends in larger projects with many test classes.

Maven’s Surefire plugin reports execution time for individual test classes but doesn’t provide an aggregated view of the total test execution time. The reports are generated in the “target/surefire-reports” folder, both as text files and XML files.

Here’s a shell script that parses the XML report files generated by Surefire and calculates the total execution time. The script is compatible with both Linux and macOS environments.

These are the steps:

  1. Look for lines containing <testsuite> tags
  2. For each matching line, loops through all fields (words) in the line
  3. Find fields that start with time=
  4. Uses gsub() to extract just the numeric value by removing the time=" prefix and the " suffix
  5. Add the extracted value to the running total
  6. Format the output in the same way, with the total time in seconds

To make this script run automatically after your tests, you can integrate it into your Maven build process using the exec-maven-plugin:

The above snippet assumes the script is in a file “report-total-time.sh” in the same directory as the POM. Otherwise, you’ll have to adjust the argument accordingly.

When your tests complete, you’ll see output similar to:

That’s all!