Modern Dance Or Full-Body Keyboard? Why Not Both!

If you felt in your heart that Hackaday was a place that would forever be free from projects that require extensive choreography to pull off, we’re sorry to disappoint you. Because you’re going to need a level of coordination and gross motor skills that most of us probably lack if you’re going to type with this full-body, semaphore-powered keyboard.

This is another one of [Fletcher Heisler]’s alternative inputs projects, in the vein of his face-operated coding keyboard. The idea there was to be able to code with facial gestures while cradling a sleeping baby; this project is quite a bit more expressive. Pretty much all you need to know about the technical side of the project can be gleaned from the brilliant “Hello world!” segment at the start of the video below. [Fletcher] uses OpenCV and MediaPipe’s Pose library for pose estimation to decode the classic flag semaphore alphabet, which encodes characters in the angle of the signaler’s extended arms relative to their body. To extend the character set, [Fletcher] added a squat gesture for numbers, and a shift function controlled by opening and closing the hands. The jazz-hands thing is just a bonus.

Honestly, the hack here is mostly a brain hack — learning a complex series of gestures and stringing them together fluidly isn’t easy. [Fletcher] used a few earworms to help him master the character set and tune his code; the inevitable Rickroll was quite artistic, and watching him nail the [Johnny Cash] song was strangely satisfying. We also thoroughly enjoyed the group number at the end. Ooga chaka FTW.

Continue reading “Modern Dance Or Full-Body Keyboard? Why Not Both!”

Linux-Fu: One At A Time, Please! Critical Sections In Bash Scripts

You normally think of a critical section — that is, a piece of a program that excludes other programs from using a resource — as a pretty advanced technique. You certainly don’t often think of them as part of shell scripting but it turns out they are surprisingly useful for certain scripts. Most often, a critical section is protecting some system resource like a shared memory location, but there are cases where a shell script needs similar protection. Luckily, it is really easy to add critical sections to shell scripts, and I’ll show you how.

Sometimes Scripts Need to Be Selfish

One very common case is where you want a script to run exactly one time. If the same script runs again while the original is active, you want to exit after possibly printing a message. Another common case is when you are updating some file and you need undisturbed access while making the change.

That was actually the case that got me thinking about this. I have a script — may be the subject of a future Linux-Fu — that provides dynamic DNS by altering a configuration file for the DNS server. If two copies of the script run at the same time, it is important that only one of them does modifications. The second copy can run after the first is totally complete.

Continue reading “Linux-Fu: One At A Time, Please! Critical Sections In Bash Scripts”

Semaphore Signal Replica Perfect For The Train Buff In Your Life

semaphore-signal

[John Philip’s] brother has a sizable room set aside for his model railroad setup, and he was looking for something interesting to add to his brother’s collection. Rather than construct something for the railroad itself, he decided that an early 1900’s-style semaphore railroad signal would make a great novelty item for the room.

The project started with [John] scouring the Internet for colored signal lenses. Once he found a set that worked for him, he crunched some numbers to ensure that the rest of the semaphore box stayed true to original scale. Inside the signal’s case you will find a small regulator board for his light source, an Arduino, and a motor controller board to actuate the arm.

To ensure that the signal arm is always perfectly positioned, he installed a pair of reed switches on either side of the case, enabling the Arduino to auto-calibrate the signal’s position each time it is powered on. At first, this control scheme might strike you as a bit over the top, but we really like the fact that the signal can always configure itself to function perfectly, even if someone tinkers with/bumps into/moves the arm at any point.

Be sure to stick around to see a short video of the semaphore signal in action.

Continue reading “Semaphore Signal Replica Perfect For The Train Buff In Your Life”