This excellent content from the Hackaday writing crew highlights recurring topics and popular series like Linux-Fu, 3D-Printering, Hackaday Links, This Week in Security, Inputs of Interest, Profiles in Science, Retrotechtacular, Ask Hackaday, Teardowns, Reviews, and many more.
Join Hackaday Editor-in-Chief Elliot Williams and Managing Editor Tom Nardi on another whirlwind tour of the week’s top stories, hacks, and projects. We start off with some breaking Linux security news, and then marvel over impeccably designed pieces of hardware ranging from a thrifty Z table for the K40 laser cutter to a powerful homebrew injection molding rig. The finer technical points of a USB device that only stores 4 bytes at a time will be discussed, and after taking an interactive tour through the internals of the 555 timer, we come away even more impressed by the iconic 50 year old chip. We’ll wrap things up by speculating wildly about all the bad things that can happen to floating solar panels, and then recite some poetry that you can compile into a functional computer program should you feel so inclined.
Take a look at the links below if you want to follow along, and as always, tell us what you think about this episode in the comments!
The CIA Hacktivists have launched a sort of ransomware campaign against the Belarusian rail system, but instead of cryptocurrency, they want the release of political prisoners and removal of Russian soldiers. This could be called an example of cyber-terrorism, though there is a reasonable theory that this is a state-sponsored hack, masquerading as hacktivism. What does seem certain is that something has interrupted rail transit, and a group on Twitter has produced convincing proof of a breach.
Your Antivirus Now Includes a CryptoMiner
Don’t look now, but your latest update of Norton 360 or Avira may have installed a cryptocurrency mining module. The silver lining is that some sanity has been retained, and you have to opt-in to the crypto scheme before your machine starts spending its spare cycles on mining. For users who do, they’re put into a mining pool, making for small payouts for most hardware. Norton, naturally, takes a 15% fee off the top for their trouble.
[Voja Antonic] has been building digital computers since before many of us were born. He designed with the Z80 when it was new, and has decades of freelance embedded experience, so when he takes the time to present a talk for us, it’s worth paying attention.
For his Remoticon 2022 presentation, he will attempt to teach us how to become a hardware expert in under forty minutes. Well, mostly the digital stuff, but that’s enough for one session if you ask us. [Voja] takes us from the very basics of logic gates, through combinatorial circuits, sequential circuits, finally culminating in the description of a general-purpose microprocessor.
A 4-bit ripple-carry adder with additional CPU flag outputs
As he demonstrates, complex digital electronics systems really are just built up in a series of steps of increasing complexity. starting with individual active elements (transistors operating as switches) forming logic elements capable of performing simple operations.
From there, higher level functions such as adders can be formed, and from those an ALU and so on. Conceptually, memory elements can be formed from logic gates, but it’s not the most efficient way to do it, and those tend to be made with a smaller and faster circuit. But anyway, that model is fine for descriptive purposes.
Once you have combinatorial logic circuits and memory elements, you have all you need to make the necessary decoders, sequencers and memory circuits to build processors and other kinds of higher complexity circuits.
Obviously forty minutes isn’t anywhere nearly enough time time to learn all of the intricacies of building a real microprocessor like the pesky details of interfacing with it and programming it, but for getting up the learning curve from just a knowledge of binary numbers to an understanding of how a CPU is built, it’s a pretty good starting point.
If you are a traditional programmer, using bash for scripting may seem limiting sometimes, but for certain tasks, bash can be very productive. It turns out, some of the limits of bash are really limits of older shells and people code to that to be compatible. Still other perceived issues are because some of the advanced functions in bash are arcane or confusing.
Strings are a good example. You don’t think of bash as a string manipulation language, but it has many powerful ways to handle strings. In fact, it may have too many ways, since the functionality winds up in more than one place. Of course, you can also call out to programs, and sometimes it is just easier to make a call to an awk or Python script to do the heavy lifting.
But let’s stick with bash-isms for handling strings. Obviously, you can put a string in an environment variable and pull it back out. I am going to assume you know how string interpolation and quoting works. In other words, this should make sense:
echo "Your path is $PATH and the current directory is ${PWD}"
The Long and the Short
Suppose you want to know the length of a string. That’s a pretty basic string operation. In bash, you can write ${#var} to find the length of $var:
#/bin/bash
echo -n "Project Name? "
read PNAME
if (( ${#PNAME} > 16 ))
then
echo Error: Project name longer than 16 characters
else
echo ${PNAME} it is!
fi
Every winter, millions of tons of rock salt is sprinkled across roads in the US, mostly in the Midwest and Northeast regions. It’s a cheap and effective way to prevent accidents. Rock salt is chemically the same as the stuff that sits next to the pepper, except it isn’t as finely ground, and it doesn’t have sodium or potassium iodine added to it to prevent goiters. Both table salt and rock salt melt ice by lowering the freezing point of water. So does sugar.
Much of what we salt the Earth with every winter comes from underground networks of salt crystal that formed when various ancient seas dried up. As natural as it may be, rock salt is bad for the environment. For one thing, chloride is forever, and can’t easily be decoupled from the soil and water it taints when it washes away. Rock salt also corrodes concrete, makes its way into the groundwater, and is bad for pets. Worst of all, its efficacy drops along with the temperature. At 15° F (-9° C), rock salt loses more than 86% of its melting power.
Disposable Detroit
All this salt is not great for cars, either — it’s bad for the paint and eats up the frame. In the saltiest parts of the US, aka The Salt Belt, cars only last a handful of years before they become Flintstones mobiles. Well, not really, but salt is terrible for the brake lines and most of the undercarriage. Consumer woes aside, there’s a real environmental impact to manufacturing all these disposable cars to meet the demand.
But the problem is that we need to use salt, or at something like it. Even though millions of people are staying home a whole lot more, the trucking industry still relies on salted highways and local roads. So if you like stocked grocery stores and stuff arriving from the Bezos Barn in a timely fashion, you can see the problem. So what are the alternatives? Are there any?
We could all use a hug once in a while. Most people would probably say the shared warmth is nice, and the squishiness of another living, breathing meatbag is pretty comforting. Hugs even have health benefits.
But maybe you’re new in town and don’t know anyone yet, or you’ve outlived all your friends and family. Or maybe you just don’t look like the kind of person who goes for hugs, and therefore you don’t get enough embraces. Nearly everyone needs and want hugs, whether they’re great, good, or just average.
So what makes a good hug, anyway? It’s a bit like a handshake. It should be warm and dry, with a firmness appropriate to the situation. Ideally, you’re both done at the same time and things don’t get awkward. Could a robot possibly check all of these boxes? That’s the idea behind HuggieBot, the haphazardly humanoid invention of Katherine J. Kuchenbecker and team at the Max Planck Institute for Intelligent Systems in Stuttgart, Germany (translated). User feedback helped the team get their arms around the problem.
When it comes to putting together complex mechanisms, we tend to think in a traditional design language that includes elements like bearings, bushings, axles, pulleys — anything that makes it possible for separate rigid bodies to move against each other. That works fine in a lot of cases — our cars wouldn’t get very far without such elements — but there are simpler ways to transmit force and motion, like compliant mechanisms.
Compliant mechanisms show up in countless products, from the living hinge on a cheap plastic box to the nanoscale linkages etched into silicon inside a MEMS accelerometer. They reduce complexity by putting the elasticity of materials to work and by reducing the number of parts it takes to create an assembly. And they can help make your projects easier and cheaper to build — if you know the secrets of their design.
Amy Qian, from the Amy Makes Stuff channel on YouTube, is a mechanical engineer with an interest in compliant mechanisms, so much so that she ran a workshop about them at the 2019 Superconference. She’ll stop by the Hack Chat to share some of what she’s learned about compliant mechanisms, and to help us all build a little flexibility into our designs.