On Unix — the progenitor of Linux — there was
/bin/sh. It was simple, by comparison to today’s shells, but it allowed you to enter commands and — most importantly — execute lists of commands. In fact, it was a simple programming language that could make decisions, loop, and do other things to allow you to write scripts that were more than just a list of programs to run. However, it wasn’t always the easiest thing to use, so in true Unix fashion, people started writing new shells. In this post, I want to point out a few shells other than the ubiquitous
bash, which is one of the successors to the old
Since the 7th Edition of Unix,
sh was actually the Bourne shell, named after its author, Stephen Bourne. It replaced the older Thompson shell written in 1971. That shell had some resemblance to a modern shell, but wasn’t really set up for scripting. It did have the standard syntax for redirection and piping, though. The PWB shell was also an early contender to replace Thompson, but all of those shells have pretty much disappeared.
You probably use
bash and, honestly, you’ll probably continue to use
bash after reading this post. But there are a few alternatives and for some people, they are worth considering. Also, there are a few special-purpose shells you may very well encounter even if your primary shell is
Continue reading “Linux Fu: Alternative Shells”
The ARM series of processors are an industry standard of sorts for a vast array of applications. Virtually anything requiring good power or heat management, or any embedded system which needs more computing power than an 8-bit microcontroller is a place where an ARM is likely found. While they do appear in various personal computers and laptops, [Pieter] felt that their documentation for embedded processors wasn’t quite as straightforward as it could be and created this development board which will hopefully help newbies to ARM learn the environment more easily.
Called the PX-HER0, it’s an ARM development board with an STM32 at its core and a small screen built in. The real work went in to the documentation for this board, though. Since it’s supposed to be a way to become more proficient in the platform, [Pieter] has gone to great lengths to make sure that all the hardware, software, and documentation are easily accessible. It also comes with the Command Line Interpreter (CLI) App which allows a user to operate the device in a Unix-like environment. The Arduino IDE is also available for use with some PX-HER0-specific examples.
[Pieter] has been around before, too. The CLI is based on work he did previously which gave an Arduino a Unix-like shell as well. Moving that to the STM32 is a useful tool to have for this board, and as a bonus everything is open source and available on his site including the hardware schematics and code.
[Marek Gibney] poses an interesting puzzle. What does the following bash command line print?
( echo red ; echo green 1>&2 ) | echo blue
You’d like to think it prints three lines: red, green, and blue. But would you be surprised to find out that it can sometimes output “blue green” and sometimes just output blue. The first surprise is that it isn’t deterministic. But the second thing that is surprising is the sometimes the entire left-hand part of the line doesn’t do anything. [Chris Siebenmann] did the analysis and explains what’s going on in a recent blog post.
Before you click the link or read further, you might want to see if you can deduce what’s going on. Give up? Here’s a hint: Part of the solution hinges on the fact that echo is built into the shell.
Continue reading “Bash Pipeline Puzzle: Green, Blue, Or Blue Green?”
We all maintain this balancing act between the cool things we want, the money we can spend, and our free time. When the pièce de résistance is a couple of orders of magnitude out of our budget, the only question is, “Do I want to spend the time to build my own?” [Nick Charlton] clearly answered “Yes,” and documented the process for his Nautilus speakers. The speaker design was inspired by Bowers & Wilkins and revised from a previous Thingiverse model which is credited.
The sound or acoustic modeling is not what we want to focus on since the original looks like something out of a sci-fi parody. We want to talk about the smart finishing touches that transform a couple of 3D printed shells into enviable centerpieces. The first, and most apparent is the surface. 3D prints from consumer FDM printers are prone to layer lines, and that aesthetic has ceased to be trendy. Textured paint will cover them nicely and requires minimal elbow grease. Besides sand and shells go together naturally. At first glance, the tripod legs holding these speakers seemed like a classy purchase from an upscale furniture store, but they are, in fact, stained wood and ground-down bolts. Nicely done.
The moral is to work smarter, take pictures, then drop us a line.
The title of this post says it all: GoTTY is a program that lets you share Linux terminal applications into a web browser. It is a simple web server written in Go that runs a non-GUI program and can push it out a socket in such a way that a browser can display it and, optionally, let the user interact with it.
With the emphasis on security these days, that ought to alarm you. After all, why would you want a shell running in a browser? Hang on, though. While that is possible — and not always undesirable — the real value to this technique is to run a specific command line program in a browser window. Here’s a use case: You want users to remotely monitor a system using
htop, if you are fancy). But you don’t want users logging into the system nor do you want to require them to have
ssh clients. You don’t want to install monitoring tools, just use what you already have.
If you could get the output from top to show up in a browser window — even if the users had no ability to input — that would be an easy solution. Granted, you could just run
top in batch mode, collect the output, and write it somewhere that a web server could find it. Assuming you have a web server installed, of course. But then what if you did want some other features like taking command line options or having the option for (hopefully) authenticated users to interact with the software? Now that would be more complicated. With GoTTY, it is easy.
Continue reading “Linux Fu: Share Terminal In Browser”
When using an Arduino, at least once you’ve made it past blinking LEDs, you might start making use of the serial connection to send and receive information from the microcontroller. Communicating with the board while it’s interacting with its environment is a crucial way to get information in real-time. Usually, that’s as far as it goes, but [Pieter] wanted to take it a step farther than that with his command line interpreter (CLI) for the Arduino.
The CLI allows the user to run Unix-like commands directly on the Arduino. This means control of GPIO and the rest of the features of the microcontroller via command line. The CLI communicates between the microcontroller and the ANSI/VT100 terminal emulator of your choosing on your computer, enabling a wealth of new methods of interacting with an Arduino.
The CLI requires a hex file to be loaded onto the Arduino that you can find at a separate site, also maintained by [Pieter]. Once that’s running, you can get all of that sweet command line goodness out of your Arduino. [Pieter] also has some examples on his project page, as well as the complete how-to to get this all set up and running. There’s a lot going on in the command line world, in Linux as well as windows. So there’s plenty to explore there as well.
It’s that time of year again in the United States, and the skies will soon be alight with pyrotechnic displays, both professional and amateur. Amazing fireworks are freely available, sometimes legally, sometimes not. For the enthusiasts that put on homebrew displays, though, the choice between watching your handiwork or paying attention to what you’re doing while running the show is a tough one. This Raspberry Pi fireworks show controller aims to fix that problem.
[netmagi] claims his yearly display is a modest affair, but this controller can address 24 channels, which would be a pretty big show in any neighborhood. Living inside an old wine box is a Raspberry Pi 3B+ and three 8-channel relay boards. Half of the relays are connected directly to breakouts on the end of a long wire that connect to the electric matches used to trigger the fireworks, while the rest of the contacts are connected to a wireless controller. The front panel sports a key switch for safety and a retro analog meter for keeping tabs on the sealed lead-acid battery that powers everything. [netmagi] even set the Pi up with WiFi so he can trigger the show from his phone, letting him watch the wonder unfold overhead. A few test shots are shown in the video below.
As much as we appreciate the DIY spirit, it goes without saying that some things are best left to the pros, and pyrotechnics is probably one of those things. Ever wonder how said pros pull it off? Here’s a behind-the-scenes look.
Continue reading “Launching Fireworks With Raspberry Pi This Fourth Of July”