Is Your Mental Model Of Bash Pipelines Wrong?

[Michael Lynch] encountered a strange situation. Why was compiling then running his program nearly 10x faster than just running the program by itself? [Michael] ran into this issue while benchmarking a programming project, pared it down to its essentials for repeatability and analysis, and discovered it highlighted an incorrect mental model of how bash pipelines worked.

Here’s the situation. The first thing [Michael]’s pared-down program does is start a timer. Then it simply reads and counts some bytes from stdin, then prints out how long it took for that to happen. When running the test program in the following way, it takes about 13 microseconds.

$ echo '00010203040506070809' | xxd -r -p | zig build run -Doptimize=ReleaseFast
bytes: 10
execution time: 13.549µs

When running the (already-compiled) program directly, execution time swells to 162 microseconds.

$ echo '00010203040506070809' | xxd -r -p | ./zig-out/bin/count-bytes
bytes: 10
execution time: 162.195µs

Again, the only difference between zig build run and ./zig-out/bin/count-bytes is that the first compiles the code, then immediately runs it. The second simply runs the compiled program. Continue reading “Is Your Mental Model Of Bash Pipelines Wrong?”

FLOSS Weekly Episode 776: Dnsmasq, Making The Internet Work Since 1999

This week Jonathan Bennett and Simon Phipps sit down with Simon Kelley to talk about Dnsmasq! That’s a piece of software that was first built to get a laptop online over LapLink, and now runs on most of the world’s routers and phones. How did we get here, and what does the future of Dnsmasq look like? For now, Dnsmasq has a bus factor of one, which is a bit alarming, given how important it is to keeping all of us online. But the beauty of the project being available under the GPL is that if Simon Kelley walks away, Google, OpenWRT, and other users can fork and continue maintenance as needed. Give the episode a listen to learn more about Dnsmasq, how it’s tied to the Human Genome Project, and more!

Continue reading “FLOSS Weekly Episode 776: Dnsmasq, Making The Internet Work Since 1999”

Trick Your (1970) Pickup Truck

[Dave] wanted an old pickup, and he found a GMC Sierra Grande truck vintage 1970. While it had an unusual amount of options, there weren’t that many high-tech options over 50 years ago. The five-year-long restoration work was impressive, as you can see in the video below, but we were really interested in the electronics part. As [Dave] mentions, the truck was made when the Saturn V was taking people to the moon, but after his modifications, the truck has a lot more computing power than the famous rocket.

He was concerned that the taillights were not up to modern standards and that it would be too easy for someone using their cell phone to plow into the rear of the truck. So he broke out an ESP32 and some LEDs and made an attractive brake light that would have been a high-tech marvel in 1970.

Continue reading “Trick Your (1970) Pickup Truck”

Illustrated Kristina with an IBM Model M keyboard floating between her hands.

Keebin’ With Kristina: The One With The Pickle Pi

Image by [jefmer] via Hackaday.IO
The unstoppable [jefmer] wrote in to alert me to Pickle Pi, their latest Keebin’-friendly creation. Why “Pickle Pi”? Well, the Pi part should be obvious, but the rest comes from the Gherkin 30% ortholinear keyboard [jefmer] built with Gateron Yellows and, unfortunately, second-choice XDA keycaps, as the first batch were stolen off of the porch.

If you’re wondering where the rest of the keys are, they are accessible by holding various keys rather than tapping them. Shift is Shift when tapped held, but becomes Enter when tapped. [jefmer] wrote out their entire project description on the thing in order to break in the Gherkin.

The brains of this acrylic sandwich tablet is a Pi Zero 2, with a Pro Micro for the keyboard controller. Although programs like Ghostwriter and Thonny work fine, Chromium is “painfully slow” due to the RAM limitations of the Pi Zero 2. On the upside, battery life is 7-8 hours depending on usage. Even so, [jefmer] might replace it with a Pi 4 — the current battery pack won’t support a Pi 5.
Continue reading “Keebin’ With Kristina: The One With The Pickle Pi”

Interactive Cake Takes Your Picture

[Abigail] is a confectionery roboticist, and [Hazal] is a developer advocate at a robotics company. The two met recently and decided to collaborate on a smart cake, with amusing results.

The resulting cake not only looks like a camera it also has a camera inside. When the camera detects people in its field of view, a NeoPixel is lit up in green to signal it’s spotted something. If you so desire, you can then hit a button and the cakera (cake-camera, keep up) will take your photo.

The cake itself looks to be a sponge of some sort with fondant used to create the camera housing and a surround for the preview screen. Inside the cake is a standard photo-booth style setup built with a Raspberry Pi. The Pi is responsible for taking photos with a USB cam. It does this when instructed via an arcade button acting as the shutter release. After taking a photo, the Pi prints out a receipt with an Adafruit thermal printer. This provides the user a number they can use to receive their photo afterward.

We’ve seen some neat cakes before, too. If you’ve been hacking on cakes, either edible or theoretical, we might just want to know more. Drop us a line!

Hackaday Podcast Episode 263: Better DMCA, AI Spreadsheet Play, And Home Assistants Your Way

No need to wonder what stories Hackaday Editors Elliot Williams and Al Williams were reading this week. They’ll tell you about them in this week’s podcast. The guys revisit the McDonald’s ice cream machine issue to start.   This week, DIY voice assistants and home automation took center stage. But you’ll also hear about AI chat models implemented as a spreadsheet, an old-school RC controller, and more.

How many parts does it take to make a radio? Not a crystal radio, a software-defined one. Less than you might think. Of course, you’ll also need an antenna, and you can make one from lawn chair webbing.

In the can’t miss articles, you’ll hear about the problems with the x86 architecture and how they tried to find Martian radio broadcasts in the 1920s.

Miss any this week? Check out the links below if you want to follow along, and as always, leave your comments!

Direct download in DRM-free MP3.

Continue reading “Hackaday Podcast Episode 263: Better DMCA, AI Spreadsheet Play, And Home Assistants Your Way”

FLOSS Weekly Episode 775: Meshtastic Central

This week, Jonathan Bennett and Rob Campbell chat with Ben Meadors and Adam McQuilkin to talk about what’s new with Meshtastic! There’s a lot. To start with, your favorite podcast host has gotten roped into doing development for the project. There’s a new Rust client, there’s a way to run the firmware on Linux Native, and there’s a shiny new web-based flasher tool!

Continue reading “FLOSS Weekly Episode 775: Meshtastic Central”