Drop #561 (2024-11-25): Monday Morning Grab Bag

Do You Follow?; A Real [She]Banger Of A Utility; onefetch

Quick follow-up to the Bonus Drop: this is a solid “A-to-Z” guide for setting up your own Blueksy/ATproto PDS for ~$6.00 USD/mo.


If you’re in the market for one, small thing you can do (repeatedly) to help fight the good fight and reduce any current or future feelings of helplessness and despair, you can learn how to archive sites to preserve knowledge which is most certainly going to be erased over the next 4—40 years.

Saving Ukrainian Cultural Heritage Online (SUCHO) — an international volunteer initiative to safeguard the digital cultural heritage of Ukraine amidst the ongoing Russian invasion — is hosting a DIY archiving workshop 11/25 at 1 Eastern / 10 Pacific. Sign up @ https://www.sucho.org/diy-archiving.


In today’s Drop, we bounce between Blueksy, git, and SQL, hopefully either inspiring you to poke at something new, or solve some recurring problem in a new/innovative way.


TL;DR

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


Do You Follow?

I saw this post by Jacob Matson, and was curious, so I made a pure, single vanilla HTML/CSS/JS version of said tool to export your Bluesky followers to a CSV file. Unlike the cost of X’s API, or the — for lack of a better word — fragmentation of ActivityPub, Bluesky/ATproto is a joy to hack on, especially with the generous limits of the unauthenticated public API.

There’s no repo for it, but consider it MIT licensed, so go hack on your own version!


A Real [She]Banger Of A Utility

Shebanger is a clever CLI tool that transforms regular shell scripts into a series of files containing only shebang lines. The tool works by base64-encoding the original script and splitting it into chunks that are embedded within multiple shebang lines across separate files.

When you run shebanger on a shell script, it creates multiple output files with .shebanged extensions. Each output file contains exactly one shebang line, with no actual code in the body. The first file, when executed, triggers a chain reaction that reconstructs and runs your original program.

The reconstruction process works by collecting the encoded contents through sequential execution of the generated files. Each generated file’s shebang line contains a portion of the base64-encoded original script. The tool uses environment variables to pass the accumulated script contents between executions, which creates an inherent limitation — scripts larger than a few hundred kilobytes cannot be processed due to environment variable size constraints.

For example:

# First, create a shell script
cat test.sh
#!/usr/bin/env bash
echo "arguments to this script: $@"

# Transform it with shebanger
shebanger ./test.sh

# Execute the transformed script
./test.sh.shebanged hello this is an argument

The execution will produce identical output to running the original script.

Shebanger was inspired by the bangscript project, though it takes a different approach to script embedding in shebangs. While it may not be practical for production use, it serves as an interesting exploration of shebang line capabilities and script transformation techniques.


onefetch

Photo by mali maeder on Pexels.com

Onefetch is a neat Rust-based command-line utility that provides comprehensive Git repository analytics directly in your terminal, operating completely offline with no network connectivity required. The tool excels at presenting detailed repository metrics including code distribution, pending changes, dependency counts (organized by package manager), contributor statistics, disk usage, repository age, and lines of code.

The tool’s default output pairs repository statistics with the primary programming language’s logo, though it can be configured to display custom images (on supported terminals) or text, or operate in a minimal mode without any decorative elements.

With support for over 100 programming languages, Onefetch automatically identifies and analyzes codebases, providing granular statistics about the repository’s composition. The tool also includes built-in license detection capabilities to identify open-source licenses within project files.

Onefetch offers extensive customization through command-line parameters, letting us precisely control both the content and presentation of the analysis. Output options include traditional terminal display as well as structured formats like JSON and (ugh) YAML. We can also configure text formatting, selectively enable or disable specific information categories, and specify exclusion patterns for files and directories.

The project maintains an active development community and welcomes contributions, with a documented contribution process for those interested in extending its capabilities. For languages not currently supported, users can request additions through the project’s issue tracker.


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.