Linux Fu: File Aliases, Links, And Mappings

Have you heard it said that everything in Linux is a file? That is largely true, and that’s why the ability to manipulate files is crucial to mastering Linux Fu.

One thing that makes a Linux filesystem so versatile is the ability for a file to be many places at once. It boils down to keeping the file in one place but using it in another. This is handy to keep disk access snappy, to modify a running system, or merely to keep things organized in a way that suits your needs.

There are several key features that lend to this versatility: links, bind mounts, and user space file systems immediately come to mind. Let’s take a look at how these work and how you’ll often see them used.

Continue reading “Linux Fu: File Aliases, Links, And Mappings”

Linux Fu: Regular Expressions

If you consider yourself a good cook, you may or may not know how to make a souffle or baklava. But there are certain things you probably do know how to do that form the basis of many recipes. For example, you can probably boil water, crack an egg, and brown meat. With Linux or Unix systems, you can make the same observation. You might not know how to set up a Wayland server or write a kernel module. But there are certain core skills like file manipulation and editing that will serve you no matter what you do. One of the pervasive skills that often gives people trouble is regular expressions. Many programs use these as a way to specify search patterns, usually in text strings such as files.

If you aren’t comfortable with regular expressions, that’s easy to fix. They aren’t that hard to learn and there are some great tools to help you. Many tools use regular expressions and the core syntax is the same. The source of confusion is that the details beyond core syntax have variations.

Let’s look at the foundation you need to understand regular expression well.

Continue reading “Linux Fu: Regular Expressions”

Portable Guitar Amp – Is That A Linux In Your Pocket?

When it comes to music production and audio engineering, Linux isn’t the most common choice. This isn’t for lack of decent tools or other typical open source usability issues: Ardour as a highly capable, feature-rich digital audio workstation, the JACK Audio Connection Kit for powerful audio routing, and distributions like Ubuntu Studio packing all the essentials nicely together, offer a great starting point as home recording setup. To add variation to your guitar or bass arrangement on top of that, guitarix is a virtual amp that has a wide selection of standard guitar effects. So when [Arnout] felt that his actual guitar amp’s features were too limiting, he decided to build himself a portable, Linux-based amp.

[Arnout] built the amp around an Orange Pi Zero with an expansion board providing USB ports and an audio-out connector, and powers it with a regular USB power bank to ensure easy portability. A cheap USB audio interface compensates the lacking audio-in option, and his wireless headphones avoid too much cable chaos while playing. The amp could theoretically be controlled via a MIDI pedalboard, but [Arnout] chose to use guitarix’s JSON API via its built-in Python web interface instead. With the Orange Pi set up as WiFi hotspot, he can then use his mobile phone to change the effect settings.

One major shortcoming of software-based audio processing is signal latency, and depending on your ear, even a few milliseconds can be disturbingly noticeable. To keep the latency at a minimum, [Arnout] chose to set up his Orange Pi to use the Linux real-time kernel. Others have chosen a more low-level approach in the past, and it is safe to assume that this won’t be the last time someone connects a single-board computer to an instrument. We surely hope so at least.

Software Development In… Bash

Truly good ideas tend to apply in all situations. The phrase is “never run with scissors”, not “don’t run with scissors unless you are just going into the next room.” Software development methodology is a good idea and most of us have our choice of tools. But what if you are developing a significant amount of bash or similar script? Should you just wing it because bash isn’t a “real” programming language? [Oscar] says no, and if you are writing more than two or three lines of script, we agree.

We’ve made the argument before (and many of you have disagreed) that bash is a programming language. Maybe not the greatest and certainly not the sexiest, but bash is near ubiquitous on certain kinds of systems and for many tasks is pretty productive. [Oscar] shows how he uses a source code formatter, a linter, and a unit test framework to bring bash scripting in line with modern software development. We are pretty sure he uses source control, too, but that seems so elementary that it doesn’t come up outside of a link to his repository in GitHub.

Continue reading “Software Development In… Bash”

Microchip Introduces Tiny Cheap Linux Modules

Linux is in everything these days, and that means designers and engineers are crying out for a simple, easy-to-use module that simplifies the design of building a product to do something with Linux. The best example of this product category would probably be the Raspberry Pi Compute Module, followed by the C.H.I.P. Pro and its GR8 module. There are dozens of boards with Allwinner and Mali chips stuffed inside that can be used to build a Linux product, and the ‘BeagleBone on a Chip’ is a fantastic product if you need Linux and want to poke pins really, really fast.

Now Microchip is rolling out with their answer to the Linux System on Module. The SAMA5D2 is a single chip in a BGA package with a small footprint that runs Linux. It’s capable, it’s cheap, and if you want to put Linux in a project, this is your newest option.

The core product in this new Microchip lineup is the SAMA5D2 SIP, a system in package that puts an ARM Cortex-A5 CPU and DDR2 memory in a single BGA package that, with a cursory examination, looks easy enough to design a PCB around and reflow. There are four chips in this lineup, with 128 Mbit, 512 Mbit, and 1 Gbit of DDR2 memory. The 128 Mbit chip is meant for bare metal and RTOS applications, with the higher memory chips capable of running Linux at least as well as a repurposed router.

This chip is at the core of Microchip’s ATSAMA5D2 SOM, a system on module that adds power management (that only requires a single 3.3V supply), an Ethernet PHY, and boot memory into a single package that’s effectively as hand-solderable as a QFN package. It’s Linux on a Chip, or at least as close as we’ve gotten to such a concept.

Adding Linux to a project is hard, and while there are modules and systems that can do it, we’re always welcoming more options given to designers. While these modules and systems aren’t exactly cheap compared to a beefy ARM microcontroller — the SIP starts at around $9, the SOM is available for $39 in 100-unit quantities — this price is quite low compared to other Linux-on-Modules available.

Tiny Quad Core Module Available Soon

We get a lot of new product announcements here at Hackaday, and we run across even more. As excited as a manufacturer might be about their latest Raspberry Pi killer or cheaper Arduino clone, we usually don’t have much to say about new products unless there is something really interesting about them. Our attention was piqued though when we saw the Neutis N5. Shipping in April, the device packs a quad-core ARM processor running at 1.3 GHz with 8 GB of flash memory and 512 MB of RAM, has an extended temperature range, WiFi (802.11N), and Bluetooth (including BLE). There’s also a crypto chip, and all this is packed into a tiny package. Really tiny. Less than 41×30 mm square and less than 4.5 mm thick. There’s a Debian-based distribution and a development board. Oh and the really interesting thing is the price, which is $49 in single quantities.

Some of the I/O ports are multiplexed, but there are plenty of options including audio, Ethernet, HDMI, USB, and more. They clearly mean for these to be put into products. The module claims UL and CE certification, each unit has a unique serial number, and there is a gang programming capability.

Continue reading “Tiny Quad Core Module Available Soon”

Making The Case For Slackware In 2018

If you started using GNU/Linux in the last 10 years or so, there’s a very good chance your first distribution was Ubuntu. But despite what you may have heard on some of the elitist Linux message boards and communities out there, there’s nothing wrong with that. The most important thing is simply that you’re using Free and Open Source Software (FOSS). The how and why is less critical, and in the end really boils down to personal preference. If you would rather take the “easy” route, who is anyone else to judge?

Having said that, such options have not always been available. When I first started using Linux full time, the big news was that the kernel was about to get support for USB Mass Storage devices. I don’t mean like a particular Mass Storage device either, I mean the actual concept of it. Before that point, USB on Linux was mainly just used for mice and keyboards. So while I might not be able to claim the same Linux Greybeard status as the folks who installed via floppies on an i386, it’s safe to say I missed the era of “easy” Linux by a wide margin.

But I don’t envy those who made the switch under slightly rosier circumstances. Quite the opposite. I believe my understanding of the core Unix/Linux philosophy is much stronger because I had to “tough it” through the early days. When pursuits such as mastering your init system and compiling a vanilla kernel from source weren’t considered nerdy extravagance but necessary aspects of running a reliable system.

So what should you do if you’re looking for the “classic” Linux experience? Where automatic configuration is a dirty word, and every aspect of your system can be manipulated with nothing more exotic than a text editor? It just so happens there is a distribution of Linux that has largely gone unchanged for the last couple of decades: Slackware. Let’s take a look at its origins, and what I think is a very bright future.

Continue reading “Making The Case For Slackware In 2018”