FOSSPicks
xonsh
Despite most distributions defaulting to use the Bash shell, we all know there is a good selection of alternatives. There's the original sh, of course, the geeky C shell (csh), Korn shell (ksh), and the increasingly popular Z shell (Zsh). Each one of these is well established and likely to be a simple configuration option or package install away. Xonsh, however, will need to be installed manually, usually as a Python pip
package, although there's an AppImage available too. And installing via pip
is a clue to why you might want to install xonsh in the first place, because it's a shell that's going to be of most use to Python developers and users.
Xonsh is a little like launching the Python interactive interpreter and still being able to run regular shell commands. It lets you easily execute all the commands you might expect, such as ls
, mv
, and echo
, within a Python environment. As a Python programmer, you can type 3.14*3.14
to perform a calculation or even start to write code. You can import external modules and use literal data types and multiline input. Python environment variables take the same format as those for a normal shell environment, which is useful for doing programmatic evaluation, and you can use pipes too, just like with Bash. There's a configuration file you can populate with your own options, and the prompt can be customized just like other shell environments. If you spend most of your day programming in Python, using a shell environment where this can be extended to the way you interact with the operating system makes a lot of sense, especially as Python can be a lot more opinionated about what it permits and processes. Even if you're not (yet) a Python programmer, using xonsh might be a brilliant way to learn.
Project Website
MQTT client
MQTT Explorer
MQTT is one of those things that initially sounds complicated but is actually quite easy to understand – and profoundly powerful when you know how to use it. The project doesn't exactly do itself any favors, either, describing itself as "an OASIS standard messaging protocol for the Internet of Things (IoT)." Put simply, however, MQTT is an easy to understand protocol and architecture for sending messages, and one that can be easily used from almost any device to send updates to another. You might have a USB temperature sensor connected to a Raspberry Pi in your garage, for example, and you'd like to share its data with your Node-RED server in your home. This is where MQTT can help. A simple command-line client tool called mosquitto_pub
can transform the output from your sensor into an MQTT message and publish this to a local client, launched with another command called mosquitto_sub
. The result is the aggregation of all MQTT messages which can then be connected to an MQTT broker, such as Node-RED.
One interesting aspect to MQTT is that the receiving clients don't know what each receiving message contains, and this is where MQTT Explorer can help. MQTT messages themselves are structured and easily parsed thanks to their native JSON support, and MQTT is a beautifully designed client that can unfold these messages and help you explore their contents and track their changing values. You simply enter the details of the publishing server you wish to connect to, and the incoming messages are aggregated and listed in the main window. Unfolding these will show their values in the pane on the right, along with a histogram of changes and other viewing options. It's a great way to demystify MQTT and pull the parts you need into other software.
Project Website
Buy this article as PDF
(incl. VAT)
Buy Linux Magazine
Subscribe to our Linux Newsletters
Find Linux and Open Source Jobs
Subscribe to our ADMIN Newsletters
Support Our Work
Linux Magazine content is made possible with support from readers like you. Please consider contributing when you’ve found an article to be beneficial.
News
-
So Long Neofetch and Thanks for the Info
Today is a day that every Linux user who enjoys bragging about their system(s) will mourn, as Neofetch has come to an end.
-
Ubuntu 24.04 Comes with a “Flaw"
If you're thinking you might want to upgrade from your current Ubuntu release to the latest, there's something you might want to consider before doing so.
-
Canonical Releases Ubuntu 24.04
After a brief pause because of the XZ vulnerability, Ubuntu 24.04 is now available for install.
-
Linux Servers Targeted by Akira Ransomware
A group of bad actors who have already extorted $42 million have their sights set on the Linux platform.
-
TUXEDO Computers Unveils Linux Laptop Featuring AMD Ryzen CPU
This latest release is the first laptop to include the new CPU from Ryzen and Linux preinstalled.
-
XZ Gets the All-Clear
The back door xz vulnerability has been officially reverted for Fedora 40 and versions 38 and 39 were never affected.
-
Canonical Collaborates with Qualcomm on New Venture
This new joint effort is geared toward bringing Ubuntu and Ubuntu Core to Qualcomm-powered devices.
-
Kodi 21.0 Open-Source Entertainment Hub Released
After a year of development, the award-winning Kodi cross-platform, media center software is now available with many new additions and improvements.
-
Linux Usage Increases in Two Key Areas
If market share is your thing, you'll be happy to know that Linux is on the rise in two areas that, if they keep climbing, could have serious meaning for Linux's future.
-
Vulnerability Discovered in xz Libraries
An urgent alert for Fedora 40 has been posted and users should pay attention.