From A Ten-Line Script To A Real Utility With Codex

I’m an experienced programmer, and I’ve worked in many different languages. Sometimes being a programmer is a two-edged sword. You want to accomplish something, and you can do it easily — but it can be a lot of work to do it right. Maybe more work than you want to do.

Normally, I’ll kick out a few lines of script for something I want and be done, accepting that it isn’t production-hardened. This time, however, I decided to try an AI tool to see whether they could do the work I was too lazy to do myself. While I’ve played with chatbots, I wanted to try one of the dedicated coding agents, in this case, Codex. Outside of asking ChatGPT to write a simple function or find the cause of an error message, I haven’t done much coding with AI assistance, so I was interested to see what these agents brought to the table.

A Radio Problem

The problem was simple: I wanted an easy way to put buttons on my Linux desktop that launched Internet radio stations. Sure, I could open a player and paste in a long URL, but I’m far too lazy to remember all those URLs.

I searched for a way to make Shortwave — an Internet radio player — open a URL from the command line. Apparently, you can’t. Google Gemini suggested writing a script that launches cvlc, the command-line VLC player, with the URL as an argument.

That’s easy, so I did it. Of course, then I had to find the stream URLs for all my favorite stations. It turns out that Radio Browser maintains an extensive database of stations. I considered scraping the site or using its API, but honestly, the little script was becoming too much of a project.

Besides, I was already struggling to manage the media player’s lifetime. I didn’t want a new station playing on top of one that was already running, and I wanted a command to stop playback, so the script had already grown larger than I first imagined.

My first version used a temporary file containing the player’s process ID so a future script execution could kill the old player. That usually works, but it isn’t very robust, and I knew it. But how much work did I really want to do here? I decided I had done enough and turned the rest over to Codex, OpenAI’s coding assistant.

Continue reading “From A Ten-Line Script To A Real Utility With Codex”

Rescuing A Rescue Device With A DIY Battery Pack

If you find yourself lost in the woods or adrift in the ocean, a GPS-enabled Personal Locator Beacon (PLB) is certainly a handy thing to have as it will pinpoint your location for rescuers. The one [Steve Jernigan] has is relatively affordable considering it might save your life one day, but it turns out that replacement batteries for the unit are extremely expensive and hard to come by because the manufacturer would rather you send the unit back to them for refurbishment. So naturally, he took it apart and figured out how to do it himself.

His DIY battery pack consists of a small custom PCB and pair of off-the-shelf 6 volt lithium manganese dioxide cells in a 3D printed enclosure that slots into the rear of the McMurdo PLB. In assembly video below, [Steve] shows how the pack goes together and demonstrates the use of a two-part potting compound in an effort to keep the elements at bay.

Before anyone says it — putting a homemade battery pack into a device which one day might be the only thing standing between you and death is probably not a great idea. [Steve] mentions in the description of this project that this is meant for backup purposes, and that you should really spring for a legitimate battery if there’s a chance you might actually need to be rescued at some point.

If you’re interested in battery pack hacking that doesn’t potentially risk life and limb, fixing the one that came with your cordless drill might be a better project to start with. Continue reading “Rescuing A Rescue Device With A DIY Battery Pack”

Miniaturized, Working Replica Of Vintage Leslie Speaker

Few pieces of vintage audio gear from the turn of the century (the previous one) inspire the kind of devotion that a Leslie speaker does. Sure, there are plenty of pieces that are rarer or more valuable, but the Leslie speaker has such a big following because of its uniqueness of physically moving sound around a room. Two rotating devices in the speaker physically direct the sound around the cabinet with musician-controlled speed, and this sound remains extremely difficult to reproduce faithfully without the moving components. But originals are enormous and meant for organs, so [Eric] built a 40% replica with a few modern touches for his guitar.

The build starts with a CAD model, where [Eric] works towards making the most accurate enclosure for his speaker as possible. The CAD model heads out to a CNC machine which can care most of the details into the wood, and he eventually is able to finish it, although it took a few tries with stains and paintbrushes of various types. For the speakers themselves, he’s using modern versions including modern brushless motors to drive the rotating elements. Like the original speaker, the high range of sound is sent through a rotating set of horns, of which one is only a counterweight, and the low range is directed out of the bottom of the cabinet through a large rotating drum. Both rotating elements here are 3D printed, and with everything put together and wired up [Eric] has a much more portable, faithful recreation of the original Leslie speaker.

There are some upgrades in the wiring too, which makes it work better with a guitar rather than for an organ. It’s also much lighter, and was a hit when he took it to let a few other guitarists to play as well. It’s not the first time we’ve seen the Leslie’s movement recreated for guitar, but it is the most alike to the classic 1930s-era speaker we’ve seen so far.

Continue reading “Miniaturized, Working Replica Of Vintage Leslie Speaker”