Drop #559 (2024-11-21): CLI Time

ripunzip; pv; joker

A trio of handy tools is on the Drop’s docket for today: a parallel unzipper that works while you download, a pipe monitor that we should’ve covered ~600 drops ago, and a no-nonsense, super-minimal daemon wrangler.


TL;DR

(This is an AI-generated summary of today’s Drop using Ollama + llama 3.2 and a custom prompt.)

  • A Rust-based tool for parallel file unzipping that can start decompression during downloads, featuring performance testing with cargo criterion and fuzzing support (https://github.com/google/ripunzip)
  • Pipe Viewer (pv) is a terminal utility for monitoring data flow through Unix pipelines with real-time statistics and progress indicators (https://www.ivarch.com/programs/pv.shtml)
  • Joker is a lightweight daemon management tool that converts regular processes into background daemons with basic control functionality and log management (https://github.com/txthinking/joker)

ripunzip

Photo by Jonathan Borba on Pexels.com

Ripunzip ((https://freedium.cfd/@adetaylor/introducing-ripunzip-ef8d52ed7e55)) ((https://freedium.cfd/@adetaylor/does-parallel-unzipping-work-cdaf89124c88)) is a Rust-based command-line tool and library that enables parallel unzipping of files using the Rayon library. We’re doing this quick intro to it not just because of the parallel bit, but also due to its ability to not only decompress files in parallel but also begin the unzipping process while a file is still being downloaded from a URI.

It can be installed via Cargo with cargo install ripunzip, and a .deb package is available in the GitHub releases section. For folks wanting to integrate the library into their own projects, it’s accessible through cargo add ripunzip.

Performance testing is conducted using cargo criterion, which is another reason I’m introducing Ripunzip, since I hadn’t played with that before and it looks like it would be great if you’re planning any real-world Rust-based projects in 2025. It groks “async”, deals with measurement “jitter” super well, and has a cadre of output options.

The project maintains a strong focus on efficient full-zip file extraction, and goes so far as to included fuzzing support through cargo fuzz to compare parallel and non-parallel unzipping behaviors, helping identify potential edge cases or inconsistencies.

I’m definitely adding this to all my cloud-init configs.


pv

Photo by Tam Ming on Pexels.com

I cannot believe we’ve done over 600 total Drops so far and never covered pv (Pipe Viewer) before. Its a terminal-based utility that monitors data flow through Unix pipelines, providing real-time statistics and visual progress indicators. The current version is 1.8.12, which was released earlier this year.

The utility functions similarly to cat but adds spiffy monitoring capabilities. When inserted between pipeline stages, it displays transfer rates, elapsed time, completion percentage, and estimated time remaining.

You can deploy multiple pv instances in a single pipeline to monitor different stages. Using the -cN flag with named streams prevents output corruption when monitoring multiple points:

pv -cN source input.file | gzip | pv -cN compressed > output.gz

This setup reveals both raw data throughput and compressed output rates.

For operations where total size isn’t automatically detected, pv accepts a -s parameter to enable accurate progress reporting. A common pattern combines this with dynamic size calculation:

tar -cf - . | pv -s $(du -sb . | awk '{print $1}') | gzip > archive.tgz

This provides precise progress tracking for directory archiving operations.

Pipe Viewer excels in network transfer scenarios when combined with netcat (nc). A typical bidirectional transfer setup looks like:

# Sending side
tar -cf - /source/dir | pv | nc -l -p 6666 -q 5

# Receiving side
nc sender.ip 6666 | pv | tar -xf -

This configuration provides real-time transfer rate monitoring for large-scale data movements.

It should be available through most package managers, but ./configure and sudo make install‘s very cleanly.


joker

Photo by Akshay Anand on Pexels.com

Joker is a minimalist daemon management utility that transforms regular processes into background daemons without requiring complex configuration or system dependencies. Unlike traditional service managers like systemd or supervisord, Joker operates as a standalone tool that provides essential daemon control functionality.

The utility stores all daemon logs in the $HOME/.joker directory, organizing them by process ID (PID) for easy access and management. When executing a command through Joker, it handles the daemonization process automatically, managing the stdout/stderr streams and providing basic process control capabilities.

The command interface provides these operations:

joker <command>        # Executes command as a daemon
joker last            # Shows PID of most recent daemon
joker list            # Displays all running daemon processes
joker log <pid>       # Retrieves logs for specific daemon
joker stop <pid>      # Terminates daemon via SIGTERM
joker restart <pid>   # Performs stop/start cycle

A practical example (from the README) of Joker’s usage would be running a brook network service:

joker brook server -l :9999 -p password

This command would daemonize the brook server process, redirecting its output to a PID-specific log file while maintaining the process in the background.

The tool deliberately avoids systemd dependencies, making it particularly useful in environments where systemd is unavailable or undesirable (think a very bare minimum server, Raspberry Pi with a minimal distro, or if you really just dislike systemd). For systems requiring boot-time process initialization, the developers recommend their companion tool txthinking/jinbe.

(We’ll be covering more of txthinking‘s tools in some 2025 Drops.)


FIN

We all will need to get much, much better at sensitive comms, and Signal is one of the only ways to do that in modern times. You should absolutely use that if you are doing any kind of community organizing (etc.). Ping me on Mastodon or Bluesky with a “🦇?” request (public or faux-private) and I’ll provide a one-time use link to connect us on Signal.

Remember, you can follow and interact with the full text of The Daily Drop’s free posts on Mastodon via @dailydrop.hrbrmstr.dev@dailydrop.hrbrmstr.dev ☮️

Leave a comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.