Five things you can do with the nano editor

In the early stages of my experience with Linux servers, I had to learn how to edit text files using the command line. While there are other powerful text editors in Linux, such as vi and vim, I found Nano to be particularly useful. Nano is a simple yet powerful text editor that comes pre-installed on many Linux distributions. You can easily install it from the command line if it’s not pre-installed on your system.

Debian-based systems:

$ sudo apt install nano

RPM based systems:

$ sudo dnf install nano

Basic Text Editing

Nano is a user-friendly text editor designed for simple and efficient text editing. To open a file, type “nano” followed by the file name in the terminal. Once inside, you can begin typing or editing text immediately. Navigation is easy, using the arrow keys to move around. To save your changes, press Ctrl + O; to exit, press Ctrl + X.

Screen picture by Don Watkins CC by SA 4.0

Search and Replace

Nano has a valuable search and replace feature. To search for a specific term, press Ctrl + W, type your search term, and press Enter. To replace text, press Ctrl + \, enter the text you want to replace, followed by the new text. This feature is handy for quickly updating configuration files or scripts.

Undo and Redo

Mistakes happen, but Nano makes it easy to correct them with its undo and redo functionality. Press Alt + U to undo the last action and Alt + E to redo it. This feature ensures that you can quickly revert changes without losing your progress

Syntax Highlighting

Nano offers syntax highlighting for those working with code, making reading and editing code easier. Syntax highlighting is available for various programming languages and can be enabled by adding the appropriate syntax files to your Nano configuration.

Screen picture by Don Watkins CC by SA 4.0

Custom Key Bindings

Nano enables you to customize key bindings to match your workflow. You can edit the /etc/nanorc file to modify default key bindings or add new ones. This flexibility allows you to personalize the editor based on your specific requirements, enhancing your editing experience and making it more efficient.

Nano’s simplicity and powerful features make it a great choice for text editing in Linux. Whether editing configuration files, writing scripts, or taking notes, Nano has the tools to do the job efficiently.

System76’s Cosmic Desktop: A New Era in Linux UX

Last week, System76 unveiled COSMIC, a groundbreaking desktop for Linux computers. This isn’t an iteration of Gnome, Cinnamon, XFCE, or KDE. It’s a paradigm shift for the Linux desktop, crafted in Rust.

According to the System76 website:

“We aim to liberate the computer with a new desktop environment powerful enough to build custom OS experiences — for users, developers, and makers of any device with a screen.”

COSMIC stands for ‘Computer operating system main interface.’ I was eager to try this new desktop and downloaded the Alpha release ISO for my five-year-old Darter Pro laptop, which I purchased from System76 in early 2019. I created a bootable USB drive and was ready to install the new desktop. I began the installation process and answered a few questions similar to those in earlier releases of Pop!_OS, which I am familiar with. After I completed the installation, I was quick to ‘kick the tires.’

Screen picture by Don Watkins CC by SA 4.0

I looked at the top of the display for the ‘Accessibility’ icon, which is on other Linux distributions, but it was missing. I later learned from reading that this feature of COSMIC has not been released. I briefly installed Gnome-Tweaks, which is how I usually tweak Linux computers so that a person with aging eyes can manage them. After installing that software, I discovered that the COSMIC desktop has a unique settings menu that is easily accessed by clicking the third icon from the left at the bottom of the screen.

Screen picture by Don Watkins CC by SA 4.0

Clicking on COSMIC settings provides a very granular approach to most of the settings I needed to make the computer interface more accessible. Here, I found that by adjusting the ‘Panel,’ I could change the size of the icons at the top of my display to make them larger and more accessible. The first choice is ‘Wallpaper’, which is self-explanatory. The second is ‘Appearance’, which I can choose from based on a light and dark theme. I can also adjust the accent colors for the application windows. The third selection is ‘Panel,’, where I could change the size of the icons and where they were displayed, whether left, right, or center.

Screen picture by Don Watkins CC by SA 4.0

Besides adjusting how the desktop appeared, I could also change the display resolution and the scale, which I set to 125%. The COSMIC settings app is compelling. Once I became more aware of all the options, I became quite happy with the experience.

Applications launch quickly. As a writer, I frequently illustrate my articles with pictures like the ones above. Taking screen pictures in COSMIC is accessible by pressing the Print-Screen key on the keyboard. There are several options for screen pictures. One is a self-selected window; the others are the entire screen or the present window.

The COSMIC App Store is great, too. There are dozens of applications to choose from, including my favorite applications, such as VS Codium, Chromium web browser, VLC, and many more. Flatpak is preferred, but distribution-packaged apps are also shown.

Screen picture by Don Watkins CC by SA 4.0

The text in the terminal is okay, but I’d like to increase the size to 12 points, making it more accessible. I look forward to more changes as COSMIC continues its development cycle.

You can easily download COSMIC and try it out for yourself, or you can add the COSMIC desktop to many of your favorite Linux distributions by following the directions for your distribution listed next. . Try Cosmic on Fedora, Arch, NixOS, and others. Cosmic is based on Pop!_OS 24.04. See the code.

Contributing to open source

I started using Linux and open-source software in the late 1990s, and the more familiar I became with it, the more uses I saw for it, whether on the server side of our school system data infrastructure or software applications for students and teachers.

My contributions to our school system were significant. I developed a content filter using Suse Linux, Squid, and Squidguard and later enhanced it with Dansguardian. We lacked the funds for expensive servers, so I introduced Linux servers and Samba to create user home directories for our teachers. This provided a backup system for our teachers and saved the school system money.

Recognizing the disparity in software accessibility, I sought alternatives. Instead of relying on the special deals school systems get from proprietary software vendors, I introduced Open Office and later LibreOffice. We provided these software on CD-ROMs and later USB drives, empowering students and parents to install them on their home computers.

As we continued to benefit from this free software, I couldn’t shake the feeling that we were taking more than we were giving. Our appreciation, though genuine, was not flowing upstream to the programmers who shared their work with us. This led me to ponder: how could we, as a school system, repay these open-source communities for the fruits of their labor?  

Within a year of my retirement in 2013, I received an invitation to attend All Things Open in Raleigh, NC. There, I was invited to join the team at Opensource.com as a ‘community moderator,’ a person who wrote articles about open-source software and open-source communities. At last, I was contributing to the communities and folks whose work I had been benefitting from for the previous fifteen years.

Coding is not my long suit, but writing is something that comes more naturally, and in the next eight years, I wrote almost three hundred articles about the various aspects of open-source software and open-source communities. I became part of a growing community of writers from all over the world. It became one of the most fulfilling avocations of my life. Opensource.com was shuttered in May of 2023, but the writers’ community lives on both.org and TechnicallyWeWrite.com. You can quickly become part of these vibrant writing communities.

In addition, there are other ways to contribute to the open source community. You can contribute to open source projects and communities using Patreon, PayPal, and other forms of payment for communities such as FedoraLinux MintUbuntuGnuCashand LibreOffice.

Mastering the ‘rm’ command

The “rm” command in Linux is a powerful tool for deleting files and directories. While it may seem simple, mastering this command requires understanding its various options and potential pitfalls. Early on in my Linux journey, I managed an Apache web server and needed to remove files occasionally. That is when I became familiar with the ‘rm’ command. It’s very effective, but its misuse can be devastating without understanding the basics and having proper respect for the command.

Understanding the Basics

The rm command stands for “remove.” Its primary function is to delete files and directories from the filesystem. The basic syntax is:

rm [options] file...

For example, to remove a file named example.txt, you would use:

rm example.txt

Removing Multiple Files

You can remove multiple files at once by listing them separated by spaces:

rm file1.txt file2.txt file3.txt

Using Wildcards

Wildcards allow you to remove multiple files that match a specific pattern. For instance, to remove all .txt files in a directory, you can use:

rm *.txt

 Removing Directories

It would help if you used the -r (recursive) option to remove directories. This tells rm to remove the directory and its contents:

rm -r directory_name

Be cautious with this option, as it will delete everything within the specified directory.

Force Deletion

The -f (force) option allows you to remove files without prompting for confirmation. This is useful for scripts or when you want to bypass confirmation prompts:

rm -f file_name

Combining Options

You can combine options to perform more complex deletions. For example, to forcefully remove a directory and its contents without confirmation, use:

rm -rf directory_name

Safety Tips

Practical Examples

Removing Log Files:

$ rm -rf /var/log/*.log

Removing Temporary Files:

rm -rf ~/tmp/*

Deleting Old Backups:

rm -rf /backups/backup-*.tar.gz

 I had serious file system trouble using ‘rm—rf’ inside my root partition. There is no undoing such a move, and you can quickly render your operating system and its files useless or worse. Always double-check your commands, use interactive mode when needed, and create backups of important data. With these tips, you’ll be well on mastering the rm command. Check the man pages on your Linux system for more information.

The Freedom of Linux: A World Beyond Hardware Restrictions

In the ever-evolving world of technology, software updates often bring excitement and anticipation as they promise new features and improvements. However, with operating system updates for proprietary operating systems, the excitement can be tempered by stringent hardware requirements that leave many users facing the inevitable need for a new computer. Fortunately, an alternative,  the Linux kernel which powers the many Linux distributions and open source, allows users to embrace the latest software without hardware limitations.

A Diverse Landscape of Compatibility

Unlike proprietary operating systems with strict hardware prerequisites, Linux distributions offer fresh air. Whether you choose Pop!_OS, Fedora, or Linux Mint, Linux’s open nature ensures compatibility with a wide range of hardware, even aging systems. This remarkable flexibility is a testament to the power of open-source software.

Take, for instance, the case of the Darter Pro laptop from System76, acquired in early 2019 with Pop!_OS 18.10 pre-installed. Despite the years that have passed, this hardware continues to support the latest versions of not just Pop!_OS but also Ubuntu, Fedora, and Arch without breaking a sweat. Such an upgrade would be an unattainable dream if one attempted to install Windows 11 on the same machine. Likewise, the closed ecosystem of MacOS locks users into a world where they can only experience the latest software if they invest in Apple’s proprietary hardware.

The Hidden Treasure of Open Source

Regrettably, many people remain oblivious to the hidden treasure trove that is open-source software. Beyond the Linux kernel that forms the foundation of countless distributions, a vast ecosystem of applications thrives, often outperforming their proprietary counterparts. This abundance of high-quality, open-source software is built on principles prioritizing user freedom and choice.

For instance, consider the MarkText application, a tool I use to craft this article. It’s an exemplary testament to the capabilities of open-source software. With abundant features, a user-friendly interface, and an active community of developers and users, MarkText competes toe-to-toe with proprietary alternatives without any vendor lock-in or hardware mandates that plague proprietary systems. This is the essence of open source—a realm in which the user controls.

Breaking the Chains of Vendor Lock-In

Vendor lock-in is a pervasive challenge in the technology world. Proprietary software and hardware vendors often design their products to ensure consumers remain captive to their offerings. This strategy serves the interests of these companies. Still, it can be detrimental to the user, who may be in a never-ending cycle of purchasing new hardware to stay current.

In contrast, Linux and open-source software operate under a different ethos. They empower users to take control of their technology. With the freedom to choose software and customize their experience, users are no longer chained to a specific vendor’s roadmap. This approach breaks the cycle of forced obsolescence and keeps hardware relevant for years, ultimately saving users money and reducing electronic waste.

A Sustainable Approach

In an era of increasing environmental consciousness, the longevity of hardware takes on added importance. The “throwaway culture” of rapid hardware turnover is financially wasteful and environmentally unsustainable. By embracing Linux and open-source software, users can extend the lifespan of their hardware, contributing to a more sustainable future.

Additionally, the open-source community fosters collaboration and innovation without the limitations of proprietary systems. Developers worldwide work together to create secure, stable, and feature-rich software, often outpacing the development cycles of their proprietary counterparts. This collaborative spirit ensures that Linux users can access cutting-edge technology without the need for frequent hardware upgrades.

Conclusion

In the world of technology, where operating system updates often come with stringent hardware requirements, Linux stands as a beacon of freedom and sustainability. Its compatibility with a wide range of hardware, commitment to open-source principles, and freedom from vendor lock-in make it a compelling choice for those who wish to break free from the shackles of constantly upgrading their hardware.

As we navigate an ever-changing technological landscape, let us remember that there is a world beyond hardware restrictions, a world where Linux and open-source software offer an oasis of choice and longevity. In this realm, the user is king, and technology serves their needs, not vice versa. So, next time you hear the siren call of a new operating system update, consider the boundless possibilities of Linux and liberate yourself from the cycle of forced obsolescence.

qrcp: A Command Line Tool to Transfer Files over Wi-Fi using QR Codes

 

I am an iPhone user, and my daily driver is Linux. I am always taking pictures with my phone but how do I get them easily transferred to my computer? I found the answer a few years ago when I discovered ‘qrcp’.

Qrcp is a command-line tool that allows you to transfer files over Wi-Fi using QR codes. It is a simple and efficient way to transfer files between devices, without the need for any third-party apps or services.

Claudio d’Angelis, the developer, has introduced the qrcp software under the MIT license. The application can be accessed on GitHub and boasts simplicity in both installation and usage. Compatible with Linux, Windows, and macOS, it offers download options in RPM, DEB, and tarball. Remarkably, there are builds tailored for a wide array of platforms, encompassing even the Raspberry Pi

The project maintains a downloads page where you can choose the appropriate package for your platform. Once that is accomplished, you can easily install the software with your package manager.

$ sudo dnf install ./qrcp*rpm

or

sudo apt install ./qrcp.*deb

Once the software is installed you need to configure it for your computer. If you are running a firewall you can configure ‘qrcp’ to use a particular port and make an exception rule on youir firewall.

$ qrcp config

To begin, initiate the configuration file creation process. Employ the qrcp config command for guidance, though it involves a few intricate inquiries. The first is what interface your computer is going to use, whether wireless, wired, etc. One of the queries is an option to choose a port. I chose port ‘8080’ but you can choose whatever makes sense to you. There is an option to choose a fully qualified domain name. In my case, I left it blank. You can specify a ‘url path’ or leave it blank. You can choose a default directory where the file will be received. Leave it blank, and the file will be placed in your ‘home’ directory.

Once the configuration is complete, you can use ‘qrcp’ to receive or send files from your mobile phone.

$ qrcp receive

The software generates a QR code similar to what is pictured above. Point your iPhone camera at the QR code, and your phone will recognize the QR code and initiate the transfer.

Successful transfers provide feedback on your phone specifying the file name and location where it has been transferred.

You can choose the picture from your photo library and easily send the file or text from your iPhone to your computer using your wireless network.

WoeUSB-ng to the rescue

Frequently, I’m approached by individuals seeking assistance in rescuing Windows computers that have encountered locking or damage issues. I occasionally utilize a Linux USB boot drive to access Windows partitions effectively. This enables me to transfer and safeguard files from these compromised systems securely.

Sometimes, clients misplace their passwords or lock themselves out of their login accounts. One viable method to restore account access involves generating a Windows boot disk to initiate repairs on the computer. Microsoft provides the option to obtain Windows copies via its official website and tools designed for crafting a USB boot device. However, utilizing these tools necessitates access to a Windows computer, posing a challenge for me as a Linux user. Consequently, I’ve sought alternative approaches for creating a bootable DVD or USB drive. My go-to tools, such as Etcher.io, Popsicle (for Pop!_OS), UNetbootin, and even utilizing the command line utility ‘dd’ for crafting bootable media, have yielded limited success. Since my daily driver is Linux, it was near impossible to create a USB drive with a bootable Windows version.

A few years ago, I learned about WoeUSB and the subsequent project WoeUSB-ng. WoeUSB-ng is a software utility used for creating bootable Windows USB drives using Windows ISO images and effectively transferring them onto a USB drive, making it possible to install or repair Windows operating systems from that USB drive. On Linux systems, the WoeUSB-ng software package. The “ng” in its name stands for “next generation,” indicating that it’s a successor or evolution of the original WoeUSB tool. I have used it to create bootable Windows drives with both Windows 10 and Windows 11. WoeUSB-ng is open source with a GPL v3 license.

The project website lists several install options for Linux users.

Fedora users can use the following commands to install the software necessary to support WoeUSB-ng.

sudo dnf install git p7zip p7zip-plugins python3-pip python3-wxpython4

Ubuntu/Linux Mint users can use the following commands to install the software necessary to support WoeUSB-ng.

sudo apt install git p7zip-full python3-pip python3-wxgtk4.0 grub2-common grub-pc-bin parted dosfstools ntfs-3g

Then issue the following commands to install WoeUSB-ng on your system.

git clone https://github.com/WoeUSB/WoeUSB-ng.git
cd WoeUSB-ng
sudo pip3 install .

Once the software is installed, creating a bootable Windows drive is very straightforward.

Click install, and depending on the processor and RAM in your machine, you should have a bootable Windows 10 or Windows 11 drive in very little time. This article is adapted from Use this bootable USB drive on Linux.

Crafting a Universal Linux Live USB Drive

I frequently create USB boot devices for Linux to troubleshoot ailing Windows computers. I also use these drives to introduce new users to the beauty and utility of using Linux as their primary operating system. If you are a Fedora user, you can easily create bootable media using the Fedora Media Writer. It is usually included by default with Fedora, but if not, you can easily create your media by installing the software on your computer with the following command.

sudo dnf install liveusb-creator

Pop!_OS users can use Popsicle. Popsicle, an open-source application designed for Linux, empowers users to securely and effortlessly write images onto USB drives. This software comes pre-installed in Pop!_OS versions 18.04 and newer. Popsicle has an MIT license.

Linux Mint users have Mintstick which is part of the default install of LinuxMint Cinnamon 21.2. Like Popsicle it can be used to create live USB drives from any Linux ISO you can download. It is open source with a GPL v2 license.

Ubuntu users have a similar tool designed to create bootable USB drives for Ubuntu. The Fedora and Ubuntu tools are great to make bootable media for those distributions. But what if you create a bootable drive for Linux Mint or Pop!_OS? Neither of the previous tools will create that media. There is an excellent open-source tool that allows you to make the media you need regardless of the host operating system you are using. It’s Balena Etcher.

According to the project’s Github repository, “Etcher is a powerful OS image flasher built with web technologies to ensure flashing an SDCard or USB drive is a pleasant and safe experience. It protects you from accidentally writing to your hard-drives, ensures every byte of data was written correctly, and much more. It can also directly flash Raspberry Pi devices that support USB device boot mode

Etcher is also available for installation of MacOS 10.10 and later and Microsoft Windows too. If you are on a Debian or Ubuntu based system you can install Etcher easily with the following command sequence. Download the latest release for Debian/Ubuntu.

  sudo add-apt-repository universe
  cd Downloads
  sudo apt install ./balena-etcher_*_amd64.deb

Fedora users can install Etcher using ‘dnf’,

   sudo dnf upgrade --refresh
   wget https://github.com/balena-io/etcher/releases/download/v1.18.12/balena-etcher-1.18.12.x86_64.rpm
   sudo dnf install balena-etcher-1.18.12.x86_64.rpm

If you are a Windows user, you can install Etcher using Chocolatey.

choco install etcher

MacOS users can install it by downloading the disk image.

Etcher has excellent documentation and an Apache 2.0 license.

Reviving Vintage Laptops: A Tale of Linux Mint and Broadcom Woes

A week ago, I met Gary at the local library; who was having trouble with his aging Dell laptop that he had purchased from a refurbisher. Troubleshooting revealed that the laptop was fine but needed an operating system. Gary chose to let me install Linux Mint Cinnamon on his computer.

A few days ago Gary emailed me to ask if I could help him with another laptop he’d purchased from a refurbisher. Similar models are currently selling for $45 online. I started the laptop with a USB with Linux Mint 21.2 Cinnamon edition and used ‘inxi‘ from the command line to determine what the processor, RAM, and wireless card were. This one Dell Latitude D630, which is vintage 2007, had an Intel Core 2 Duo T7500 processor with 4 gigabytes of RAM and a Broadcom 4311 wireless card.

I quickly decided that Linux Mint XFCE was a better OS choice than Cinnamon due to the processor and RAM. Fortunately for us, we were in the public library, and I had no trouble downloading Linux Mint 21.2 XFCE. I wrote the image to the USB drive and began the installation process on D630. The computer started up well and loaded Mint XFCE very well. I chose to install it, and after twenty minutes, we had a laptop with Mint XFCE adequately installed.

However, this D630 had Broadcom wireless, so the wireless card wasn’t recognized out of the fresh install. I have encountered this issue before with Dell laptops and knew immediately what to do. An internet search led me to Ubuntu’s excellent documentation of how to install Broadcom wireless drivers. I followed the command sequence below to update the drivers easily and restarted the Latitude D630.

sudo apt update
sudo apt install firmware-b43-installer
sudo apt install linux-firmware
sudo reboot

Once the computer was restarted, the tiny wireless indicator light began to glow as it should. I knew we were in business and could finish the update process and add additional software to this vintage Dell laptop. Gary had a big grin and once again thanked me for rescuing another old laptop from the landfill.

Customize an Intel NUC 11

In the previous year, I acquired a Hewlett-Packard DevOne to replace an Intel NUC 10, which had been serving as my primary workstation. I set up the DevOne with a docking solution detailed in an article I wrote last year, aiming to replace both the NUC and an older Darter Pro I had been using. However, I gradually realized that the DevOne wasn’t quite suitable for me due to its smaller fourteen-inch screen. Given my aging eyes, I needed to adjust accessibility settings, which work better with larger displays.

I must acknowledge that the DevOne is an impressive laptop—crafted with quality and firm performance. Nevertheless, the idea of docking a computer that I never use in a laptop mode started to seem less logical. After careful consideration, I recently decided to transition back to a dedicated desktop setup. Despite being four years old, I plan to retain the Darter Pro, which continues to serve me well during my travels and while assisting clients at their residences.

A lot of research for a bit of PC

Embarking on constructing your computer brings forth a distinct feeling of liberation. Instead of accepting pre-determined choices from a computer manufacturer, you can handpick each component that constitutes your system. Engaging in a do-it-yourself PC project entails an element of risk and adventure and lends a greater sense of accomplishment than a mere purchase.

I diligently conducted research to ensure the compatibility and viability of my selected NUC and its associated components. As part of this process, I switched from Pop!_OS 22.04 to Linux Mint 21.2, which also draws from the Ubuntu 22.04 base. I have relied on Cronopete as my chosen backup solution throughout my journey. Anticipating a smooth installation of Mint, I’m confident that I can seamlessly restore my files, reassuring me of the feasibility of my chosen path.

Assembling the NUC

When the package arrived, I was eager to assemble my new computer. I took the NUC out of its box and looked at the directions. The NUC has four screws in the base, which I loosened until I could easily remove the bottom plate. Once the case was opened, it was easy to see where the RAM chips belonged. I gingerly removed them from their packaging and, one by one, inserting them into their places.

Installing the SSD drive was a bit more complicated. I had to remove a tiny mounting screw before inserting the NVMe drive. A good screwdriver with a magnetic tip is an excellent aid when securing the NVME drive.

It was finally time to see the fruits of my labor. I connected the NUC to a monitor with an HDMI cable, attached the keyboard and mouse to the USB ports, and turned on the device. As the directions instructed, I pressed the F10 key at startup to enter the BIOS and selected the USB drive on which I had previously installed Linux Mint 21.2.

Booting Linux on a NUC

After connecting the NUC to my Logitech wireless keyboard and mouse and a Sceptre 27-inch monitor, I was ready to begin the installation. My first boot was unsuccessful, so I turned off the ‘Secure boot’ option, and on the second boot, Linux Mint came up! A quick check revealed that the wireless was fine, and the keyboard and mouse were both working. The installation took only about 10 minutes. I added my favorite applications, including the Chrome browser, and began to have some fun.

The NUC is certified on several Linux distributions, including Ubuntu, OpenSuse, and Clear Linux.

Once the operating system and updates were installed, boot time was much quicker than the NUC 10 I replaced a year ago. I used ‘Neofetch’ for a brief overview of the system.

Give it a try

I use my system primarily for writing, coding, video conferencing, virtualizing other operating systems, and reading. If you are considering building your compact Linux system, this is an excellent option.