Blowing Up Shell Scripts

One of the most universal experiences of any Linux or Unix user is working through a guide or handbook and coming across an almost unbelievably complex line of code meant to be executed with a shell. At the time of encountering a snippet like this it’s difficult to imagine any human ever having written it in the first place, but with some dedication it is possible to tease out what these small bits of code do when they’re typed into the terminal and run (unless it’s something like :(){ :|:& };: but that’s another story entirely). [noperator] recently built a tool which helps users in this predicament understand these shell scripts by expanding them into a more human-intelligible form.

The tool is named sol and does much more than expanding shell one-liners into a readable format. It also provides an interactive shell environment where the user can explore the exploded code in detail, modify it in any way they see fit, and collapse it back down to a single line so it can easily be sent to other users. It can be used with most of the major text editors as well as piped directly to standard input, and has a number of other options as well such as custom configurations and the ability to see non-standard bits of code that might not be compatible from one shell environment to another, as well as helping to translate those bits of code.

[noperator] has made the code available in the linked GitHub page for anyone curious about its use, and has a to-do list for future versions of the tool as well including adding support beyond bash. We’d definitely recommend a tool like this especially if you’re still relatively new to bash scripting (or shell scripting in general) and, as always, we’d just to remind everyone not to blindly copy and paste commands into their terminal windows. If you’re the type of person to go out on a limb and run crazy commands to see what they actually do, though, make sure you’re at least logged into the right computer first.

Automatic Position Reporting Over HF Radio

While most of us carry cell phones that have GPS and other location services, they require a significant amount of infrastructure to be useful. Drive from Washington to Alaska like [Lonney] did a while back, where that infrastructure is essentially nonexistent, and you’ll need to come up with some other solutions to let friends and family know where you are.

A tool called the Automatic Packet Reporting System (APRS) is fairly robust in the very high frequency (VHF) part of the amateur radio spectrum, but this solution still relies on a not-insignificant amount of infrastructure for the limited distances involved with VHF. [Lonney] adapted a few other tools to get APRS up and running in the HF range, letting his friends keep tabs on him even from the most remote locations.

Continue reading “Automatic Position Reporting Over HF Radio”

Your Text Needs More JPEG

We’ve all been victims of bad memes on the Internet, but they’re not all just bad jokes gone wrong. Some are simply bad as a result of being copies-of-copies, as each reposter adds another layer of compression to an already lossy image format like JPEG. Compression can certainly be a benefit in areas like images and videos, but [Michal] had a bit of a fever dream imagining this process applied to text. Rather than let the idea escape, he built the Lossifizer to add JPEG-like compression to text.

JPEG compression uses a system similar to the fast Fourier transform (FFT) called the discrete cosine transform (DCT) to reduce the amount of data in an image by essentially removing some frequency information. The data lost is often not noticeable to the human eye, at least until it gets out of hand. [Michal]’s system performs the same transform on text instead, with a slider to control the “amount of JPEG” in the output text. The code for this script uses a “perceptual” character map, clustering similarly-looking and similarly-sounding characters next to each other, resembling “leet speak” from days of yore, although at high enough compression this quickly gets out of hand.

One of the quirks that [Michal] discovered is that certain AI chat bots have a much less difficult time interpreting this JPEG-ified text than a human probably would have, which provides a bit of insight into how some of these algorithms might be functioning under the hood. For some more insight into how JPEG actually works on images, we posted about a deep dive into the image format a while back.

Terminal-Based Image Viewer, and Multi-OS Binary, and Under 100kb

[Justine Tunney]’s printimage.com is a program capable of splatting full-color images to text mode terminal sessions, but that’s not even its neatest trick. It’s also a small binary executable capable of running on six different operating systems: Linux, Windows, MacOS, FreeBSD, OpenBSD, and NetBSD. All without having to be installed or otherwise compiled first. On top of it all, it’s less than 100 kb.

How is this possible? It’s thanks to [Justine]’s αcτµαlly pδrταblε εxεcµταblε format, implemented by a project called Cosmopolitan which aims to turn C into a build-once-run-anywhere language. The printimage.com source code is included within the Cosmopolitan project.

If the name sounds a bit familiar, it’s probably because the Cosmopolitan project is a key piece of a tool we recently covered: llamafile, which allows people to package up an LLM (large language model) as a single-file, multi-OS executable.

As printimage.com shows, terminal windows are capable of more than just text. Still, plain ASCII has its appeal. Check out the ASCII art STL file viewer which might just make your next sick ASCII art banner a bit easier to generate.

Building A Communications Grid With LoRaType

Almost all of modern society is built around various infrastructure, whether that’s for electricity, water and sewer, transportation, or even communication. These vast networks aren’t immune from failure though, and at least as far as communication goes, plenty will reach for a radio of some sort to communicate when Internet or phone services are lacking. It turns out that certain LoRa devices are excellent for local communication as well, and this system known as LoraType looks to create off-grid text-based communications networks wherever they might be needed.

The project is based around the ESP32 platform with an E22 LoRa module built-in to allow it to operate within its UHF bands. It also includes a USB-based battery charger for its small battery, an e-paper display module to display the text messages without consuming too much power, and a keyboard layout for quickly typing messages. The device firmware lets it be largely automated; it will seek out other devices on the local mesh network automatically and the user can immediately begin communicating with other devices on that network as soon as it connects.

There are a few other upsides of using a device like this. Since it doesn’t require any existing communications infrastructure to function, it can be used wherever there are no other easy options, such as in the wilderness, during civil unrest where the common infrastructure has been shut down, or simply for local groups which do not have access to cell networks or Internet. LoRa is a powerful tool for these use cases, and it’s even possible to network together larger base stations to extend the range of devices like these.

A Raspberry Pi Phone For The Modern Era

While it might seem like mobile phones are special devices, both in their ease of use and in their ubiquity in the modern culture, they are essentially nothing more than small form-factor computers with an extra radio and a few specific pieces of software to run. In theory, as long as you can find that software (and you pay for a service plan of some sort) you can get any computer to work as a phone. So naturally, the Raspberry Pi was turned into one.

[asherdundas], the phone’s creator, actually found a prior build based around the Raspberry Pi before starting this one. The problem was that it was built nearly a decade ago, and hadn’t been updated since. This build brings some modernization to the antiquated Pi phone, and starts with a 3D printed case. It also houses a touchscreen and a GSM antenna to connect to the cell network. With some other odds and ends, like a speaker and microphone, plus a battery and the software to tie it all together, a modern functional Raspberry Pi phone was created, with some extra details available on the project page.

The phone has the expected features — including calling, texting, and even a camera. A small WiFi USB dongle allows it to connect to the Internet too, allowing it to do all of the internet browsing a modern smartphone might want to do. The only thing that it might be pretty difficult to do is install Android apps, and although there are ways to get Android apps working in Linux, it’s not always strictly necessary to have this functionality.

Engraving A Puzzle Box? Here’s A Collection Of Single-Line Cryptex Fonts

Here’s a neat resource from [MSRaynsford] that is worth bookmarking for anyone who gets creative with laser engravers, CNC routers, or drawing robots: SVGFonts are single-line symbol fonts that [MSRaynsford] created for his laser-cut and engraved cryptex puzzle boxes. They provide an easy way to engrave text as symbols.

Single-line fonts for engraving that include a runic-looking alphabet, a Greek-inspired set, and two symbol sets based on Flag Semaphore.

CNC engraving of letters and symbols is one of those things that seems simple, but is actually more complex than it may appear. It is often desirable to use a tool to engrave symbols with a single line, in much the same way a person would write them if using a pen. But fonts and art for letters and numbers aren’t normally a single line. Thankfully there is a solution in the form of Hershey text, an extension for which is included in Inkscape. It turns out that Hershey Fonts have their origin back in the 1960s, when the changing landscape of electronics and industry opened new opportunities and demanded new solutions.

That’s why, when [MSRaynsford] needed fonts in different styles and symbols for creating his puzzle boxes, he had to design them himself and they had to be single-line vector art, just like Hershey Text. The small collection includes English letters designed to resemble a runic alphabet, a Greek-inspired series, and two coded alphabets based on flag semaphore.

Grab ’em on GitHub, because you never know when you’ll need to make a quick cryptex.