Hackaday Links Column Banner

Hackaday Links: April 28, 2024

Well, it’s official — AI is ruining everything. That’s not exactly news, but learning that LLMs are apparently being used to write scientific papers is a bit alarming, and Andrew Gray, a librarian at University College London, has the receipts. He looked at a cross-section of scholarly papers from 2023 in search of certain words known to show up more often in LLM-generated text, like “commendable”, “intricate”, or “meticulous”. Most of the words seem to have a generally positive tone and feel a little fancier than everyday speech; one rarely uses “lucidly” or “noteworthy” unless you’re trying to sound smart, after all. He found increases in the frequency of appearance of these and other keywords in 2023 compared to 2022, when ChatGPT wasn’t widely available.

Continue reading “Hackaday Links: April 28, 2024”

You Can Run BASIC On An Old HP 4592 Protocol Analyzer

What do you do when you find an ancient piece of test gear and want to have fun? Well, you can always try getting BASIC running on it, and that’s precisely what [David Kuder] did.

The HP4952A Protocol Analyzer actually looks a lot like an old computer, even if it was never meant for general-purpose use. The heart of the machine is a Zilog Z80 CPU, though, so it shares a lot in common with microcomputers of its era.

Among other hacks, [David] worked to get Microsoft Basic-80 running on the machine. Initially, he was only able to get it up and running on the display, with no way to read the keyboard, disk, or access the serial port. Eventually, by diving into the nitty-gritty of the machine, he was able to at least get the keyboard working along with some basic BASIC programs. Usable memory is just 8KB, but you can do a fair bit with that when you’ve only got a 32×16 display for output anyway!

It’s a neat hack and one that was extendable to the HP4957A as well. We’ve seen similar machines on these pages before, too! If you’ve got your own neat retro hacks on the boil, don’t hesitate to drop us a line!

[Thanks to Christopher Zell for the tip!]

Train A GPT-2 LLM, Using Only Pure C Code

[Andrej Karpathy] recently released llm.c, a project that focuses on LLM training in pure C, once again showing that working with these tools isn’t necessarily reliant on sprawling development environments. GPT-2 may be older but is perfectly relevant, being the granddaddy of modern LLMs (large language models) with a clear heritage to more modern offerings.

LLMs are fantastically good at communicating despite not actually knowing what they are saying, and training them usually relies on PyTorch deep learning library, itself written in Python. llm.c takes a simpler approach by implementing the neural network training algorithm for GPT-2 directly. The result is highly focused and surprisingly short: about a thousand lines of C in a single file. It is a highly elegant process that does the same thing the bigger, clunkier methods accomplish. It can run entirely on a CPU, or it can take advantage of GPU acceleration, where available.

This isn’t the first timeĀ [Andrej Karpathy] has bent his considerable skills and understanding towards boiling down these sorts of concepts into bare-bones implementations. We previously covered a project of his that is the “hello world” of GPT, a tiny model that predicts the next bit in a given sequence and offers low-level insight into just how GPT (generative pre-trained transformer) models work.

How Additional Aerodynamic Drag Helped Make GTA III Work On PS2

The PlayStation 2 was a revelation when it hit the market in 2000, and yet by modern standards, it’s almost hopelessly weak. In fact, it’s so under-powered, Rockstar developers had to pull every trick in the book to make Grand Theft Auto IIIĀ even work on the platform.

The story comes to us from developer [Obbe Vermeij]. He explains that the PlayStation 2 couldn’t keep the entire open-world game map in its tiny 32 MB of RAM. Instead, models had to be streamed from the DVD drive as the player moved around the world. However, even the DVD drive wasn’t fast enough. If the player moved too quickly, they would outpace the system’s ability to load new assets, and the world would fall apart. Roads would vanish, buildings simply wouldn’t appear before the player passed by them.

According to [Obbe], getting around this challenge was the job of one [Adam Fowler]. He notes that even optimizing the layout of data on the DVD wasn’t enough to help. Nifty hacks had to be employed to slow the player down. Road networks were changed to stop the player speeding towards areas that needed lots of new models. In other areas, vehicles in the game would experience a nearly-imperceptible 5% increase in air drag to dull their speed. This was chosen as a more invisible solution; cutting engine power directly was audible to players as the audio changed.

It shows you just how hard developers had to work back when resources were far more constrained than they are today!

2024 Home Sweet Home Automation: Spray Bottle Turret Silences Barking

Ah, dogs. They sure like to bark, don’t they? [rrustvold]’s dog likes to bark at the door when a package arrives. Or when someone walks by the house, or whenever the mood strikes, really. To solve the barking issue, at least near the front door, [rrustvold] built a spray bottle turret to teach the dog through classical conditioning.

As you can see from the image, it’s all about pulling the trigger on a standard spray bottle at the right time. This machine only sprays when two conditions are met: it hears noise (like barking) and detects motion (like overzealous tail wagging). It also has heat-seeking abilities thanks to a Raspberry Pi thermal camera.

To do the actual spraying, there’s a DC motor mounted behind the bottle which turns a pulley that’s mounted to its shaft. Around the pulley is a string that wraps around the spray bottle’s trigger. To complete the build, everything is mounted on a lazy Susan so there’s nowhere for Fido to hide-o.

If you’ve a dog whose bite is worse than its bark, consider building a custom dog door to keep it out of the cat box.

The 2024 Home Sweet Home Automation contest has officially wrapped — we’re counting the votes now, so stay tuned for an announcement about the winners shortly.

Hackaday Podcast Episode 268: RF Burns, Wireless Charging Sucks, And Barnacles Grow On Flaperons

Not necessarily the easy way to program an EPROM

Elliot and Dan got together to enshrine the week’s hacks in podcast form, and to commiserate about their respective moms, each of whom recently fell victim to phishing attacks. It’s not easy being ad hoc tech support sometimes, and as Elliot says, when someone is on the phone telling you that you’ve been hacked, he’s the hacker. Moving on to the hacks, we took a look at a hacking roadmap for a cheap ham radio, felt the burn of AM broadcasts, and learned how to program old-school EPROMs on the cheap.

We talked about why having a smart TV in your house might not be so smart, especially for Windows users, and were properly shocked by just how bad wireless charging really is. Also, cheap wind turbines turn out to be terrible, barnacles might give a clue to the whereabouts of MH370, and infosec can really make use of cheap microcontrollers.

Grab a copy for yourself if you want to listen offline.

Continue reading “Hackaday Podcast Episode 268: RF Burns, Wireless Charging Sucks, And Barnacles Grow On Flaperons”

Supercon 2023: Alex Lynd Explores MCUs In Infosec

The average Hackaday reader hardly needs to be reminded of the incredible potential of the modern microcontroller. While the Arduino was certainly transformative when it hit the scene, those early 8-bit MCUs were nothing compared to what’s on the market now. Multiple cores with clock speeds measured in the hundreds of megahertz, several MB of flash storage, and of course integrated WiFi capability mean today’s chips are much closer to being fully-fledged computers than their predecessors.

It’s not hard to see the impact this has had on the electronics hobby. In the early 2000s, getting your hardware project connected to the Internet was a major accomplishment that probably involved bringing some hacked home router along for the ride. But today, most would consider something like an Internet-connected remote environmental monitor to be a good starter project. Just plug in a couple I2C sensors, write a few lines of Python, and you’ve got live data pouring into a web interface that you can view on your mobile device — all for just a few bucks worth of hardware.

But just because we’re keenly aware of the benefits and capabilities of microcontrollers like the ESP32 or the Pi Pico, doesn’t mean they’ve made the same impact in other tech circles. In his talk Wireless Hacking on a $5 Budget, Alex Lynd goes over some examples of how he’s personally put these devices to work as part of his information security (infosec) research.

Continue reading “Supercon 2023: Alex Lynd Explores MCUs In Infosec”