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?”

Neural Network Helps With Radar Pipeline Diagnostics

Diagnosing pipeline problems is important in industry to avoid costly or dangerous failures from cracked, broken, or damaged pipes. [Kutluhan Aktar] has built an system that uses AI to assist in this difficult task.

The core of the system is a MR60BHA1 60 GHz mmWave radar module, which is most typically used for breathing and heartrate detection. Here, it’s repurposed to detect fluctuating vibrations as a sign that a pipeline may be cracked or damaged. It’s paired with an Arduino Nicla Vision module, with the smart camera able to run a neural network model on the captured radar data to flag potential pipe defects and photograph them. The various modules are assembled on a PCB resembling Dragonite, the Dragon/Flying-type Pokemon.

[Kutluhan] walks us through the whole development process, including the creation of a web interface for the system. Of particular interest is the way the neural network was trained on real defect models that [Kutluhan] built using PVC pipe. We’ve looked at industrial pipelines in detail before, too. Video after the break.

Continue reading “Neural Network Helps With Radar Pipeline Diagnostics”

All Dressed Up And Nowhere To Flow: Russia’s Nord Stream 2 Pipeline

At over 1230 km (764 mi) in length, $10 billion in cost, and over a decade in the making, the Nord Stream 2 pipeline was slated to connect the gas fields of Russia to Western Europe through Germany. But with the sanctions against Russia and the politics of the pipeline suffering a major meltdown, this incredible feat of engineering currently sits unused. What does it take to lay so much underwater pipe, and what challenges are faced? [Grady] over at Practical Engineering lays out out nicely for us in the video below the break.

A Bubble Curtain containing the disposal of WW2 ordinance

As with any undersea pipeline or cable, a survey had to be done. Instead of just avoiding great chasms, underwater volcanos, or herds of sharks with lasers, planners had to contend with culturally important shipwrecks, territorial waters, and unexploded ordnance dating from the second world war. Disposing of this ordinance in a responsible way meant employing curtains of bubbles around the explosion to limit the propagation of the explosion through the water- definitely a neat hack!

Speeding up the job meant laying several sections of pipe at once, and then tying them together after they were laid. The sheer amount of engineering, manpower and money involved are nothing short of staggering. Of course [Grady] makes it sound simple, and even shares his take on some of the geopolitical issues involved, such as Germany refusing to certify the line for use after the Russian invasion of Ukraine. So far, the $10 billion pipeline is unused, and even Shell has walked away from its $5 billion investment.

Be sure to watch the whole video for even more fascinating details about the Nord Stream 2’s amazing engineering and construction. Check out a Robot Eel concept for the maintenance of underwater pipelines too.

Continue reading “All Dressed Up And Nowhere To Flow: Russia’s Nord Stream 2 Pipeline”

Hackaday Links Column Banner

Hackaday Links: August 29, 2021

If you thought that COVID-19 couldn’t possibly impact space travel, think again. The ongoing pandemic is having unexpected consequences for companies like SpaceX, who are worried about liquid oxygen shortages due to increased demand for medical oxygen. Massive amounts of liquid oxygen are used as the oxidizer for each rocket launch, of course, as well as in hospitals, which have giant tanks of liquid oxygen somewhere on site. Whether destined for space or for patient care, liquid oxygen comes from cryogenic separation plants, and SpaceX fears that they would have to delay or even cancel launches if manufacturers can’t keep up with demand and have to prioritize their healthcare customers. We’re actually not sure if this is a concern, though, since there are usually separate supply chains for medical and industrial gasses. Then again, we’d suspect a rocket engine might prefer to breathe ultra-pure LOX too.

Speaking of space, if you want to be an astronaut, perhaps the first skill you need to develop is patience. Not only might your ride not be ready to go when you are, but at least in the EU, you’ve got a long line of applicants in front of you. The European Space Agency announced this week that they’re working through a backlog of 23,000 applications for astronaut positions. About 20% of those will apparently be dropped in the pre-screening process, but the rest will (eventually) get an invitation to a full-day test at one of the ESA’s facilities. We imagine the attrition rate from there increases dramatically; either that or the ESA intends to hire a lot of astronauts.

Back here on Earth, Google this week did what it seems to do a lot of, and killed off one of its popular apps. This time the victim is the Android Auto phone app, although we have to admit the whole thing is confusing. The app allows you to connect your phone to the infotainment system in a compatible late-model car, letting you access all your apps without having to fiddle with your phone while driving. But Google also had an app that offered the same experience directly on the phone, for cars without a compatible display. As far as we can tell, the on-phone app is the only thing that’s going away in Android 12; the app for in-car displays will continue to be supported. Former users of the phone-only app are being encouraged to migrate to Google Assistant’s Driving Mode. Or, you know, you could just drive the car instead.

So your brand-new video card is running hot, and you can’t figure out why. At your wit’s end, you crack open the card’s cover and find the reason — a somewhat suspicious-looking foreign object. That’s what happened to Antony ter Horst and his Nvidia RTX 3090, which had a finger cot wedged inside it. It would appear to have slipped off the finger of some assembly worker, and it was clearly interfering with heat flow inside the card. Antony posted the pictures on reddit, which of course found much humor in the finger cot’s resemblance to another latex object. For our part, it put us in mind of some other stories of foreign objects found in common products — there’s a reason why we always check a loaf of bread before using it.

And finally, in a lot of ways YouTube has become the new “vast wasteland” of useless content. But like television before it, there are occasional gems to be found, especially to those of us who love to learn a little something as we watch. And so when we stumbled upon a video with the title “Hot Tap and Stopple Bypass at Smoky Lake” we had to check it out just to find out what each of those words meant. It turned out to be a great video on pipeline construction methods. The “hot tap” refers to cutting into the pipeline, containing high-pressure diluted bitumen from the shale oil fields near Smoky Lake, Alberta, without interrupting the flow of product. The “stopple” is a device that can be threaded into the pipe to permanently seal it, diverting the flow to a newly installed bypass. The whole process is fascinating, so we thought we’d share. Enjoy.

Continue reading “Hackaday Links: August 29, 2021”

This Week In Security: Watering Hole Attackception, Ransomware Trick, And More Pipeline News

In what may be a first for watering hole attacks, we’ve now seen an attack that targeted watering holes, or at least water utilities. The way this was discovered is a bit bizarre — it was found by Dragos during an investigation into the February incident at Oldsmar, Florida. A Florida contractor that specializes in water treatment runs a WordPress site that hosted a data-gathering script. The very day that the Oldsmar facility was breached, someone from that location visited the compromised website.

You probably immediately think, as the investigators did, that the visit to the website must be related to the compromise of the Oldsmar treatment plant. The timing is too suspect for it to be a coincidence, right? That’s the thing, the compromised site was only gathering browser fingerprints, seemingly later used to disguise a botnet. The attack itself was likely carried out over Teamviewer. I will note that the primary sources on this story have named Teamviewer, but call it unconfirmed. Assuming that the breach did indeed occur over that platform, then it’s very unlikely that the website visit was a factor, which is what Dragos concluded. On the other hand, it’s easy enough to imagine a scenario where the recorded IP address from the visit led to a port scan and the discovery of a VNC or remote desktop port left open. Continue reading “This Week In Security: Watering Hole Attackception, Ransomware Trick, And More Pipeline News”

Gassing Up: Understanding The Liquid Fuel Distribution Network

When someone talks about “The Grid,” as in “dropping off the grid” or “the grid is down,” we tend to think in terms of the electromagnetic aspects of the infrastructure of modern life. The mind’s eye sees The Grid as the network of wires that moves electricity from power plants to homes and businesses, or the wires, optical cables, and wireless links that form the web of data lines that have stitched the world together informatically.

The Grid isn’t just about power and data, though. A huge portion of the infrastructure of the developed world is devoted to the simple but vital task of moving liquid fuels from one place to another as efficiently and safely as possible. This fuel distribution network, comprised of pipelines, railways, and tankers trucks, is very much part of The Grid, even if it goes largely unseen and unnoticed. At least until something major happens to shift attention to it, like the recent Colonial Pipeline cyberattack.

Continue reading “Gassing Up: Understanding The Liquid Fuel Distribution Network”

Hydraulics Made Simple

Corralling electrons is great and what most of us are pretty good at, but the best projects have some kind of interface to the real world. Often, that involves some sort of fluid such as water or air moving through pipes. If you don’t grasp hydraulics intuitively, [Practical Engineering] has a video you’ll enjoy. It explains how flow and pressure work in pipes.

Granted, not every project deals with piping, but plumbing, sprinkler systems, cooling systems, and even robotics often have elements of hydraulics. In addition, as the video points out, fluid flow in a pipe is very similar to electrical current flowing through wires.

Continue reading “Hydraulics Made Simple”