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.

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.

My open source story

In 1995, an email from my brother introduced me to Linux. Although I had heard of a high school student using Linux to build a web server, my knowledge was limited. Intrigued by my brother’s recommendation, I purchased a copy of Red Hat 5.0 from a nearby computer store. However, my initial attempt to explore it on an older computer resulted in a command prompt without success in running Xserver, leaving me unimpressed. A year later, I stumbled upon Red Hat 6.0 during another visit to the store. Taking it to work, I successfully installed Gnome on a Hewlett-Packard Vectra 75 with a Cyrix processor upgrade. This experience sparked my interest further.

The Red Hat 6.0 distribution came bundled with fascinating software like the Mozilla browser and OpenOffice 1.0, which I hadn’t encountered before. Excited about this discovery, I shared it with my IT team, and together we experimented with another machine. While we could browse Yahoo Mail using the browser, our workplace’s official email system, Lotus Notes, remained inaccessible. It was around early 2001 when I expressed my dissatisfaction with content filters to a vendor, and he suggested I build my own using Linux. This suggestion was an epiphany for me.

With minimal knowledge of Linux and no prior experience building a content filter, I embarked on a rapid learning journey. Armed with a Dell Optiplex GX1 equipped with a Pentium II-300 processor, I upgraded the hard disk and purchased Suse Linux 7. Through my exploration, I came across Squid and Squidguard and discovered Mandrake Linux, which appealed to me for various reasons. I also learned about the Red Hat Package Manager. Leveraging these newfound tools, I successfully built the first non-proprietary content filter in the history of Western New York’s public schools. Initially using Mandrake and later Fedora Core 1 on the older Dell machine, I employed Squid and Dansguardian to meet the requirements of CIPA compliance with E-rate. Although I faced some resistance from other technicians, I gradually demonstrated the legality and practicality of this solution over time.

This was just the beginning of my Linux journey. While developing the content filter, I delved into Samba and created our first network-attached storage device, providing our teachers with a reliable file backup solution. Subsequently, we built a Samba server running Fedora Core 1 and 2. I found stories of other schools utilizing Linux and learned about the K12 Linux Terminal Server Project. I taught myself Linux and Linux system administration through online forums, Google searches, and several books. I became a passionate advocate for open source, often promoting it at regional technology coordinator gatherings.

Using idle computers tucked away in closets across our school, I assembled a working demonstration of the K12 Linux Terminal Server. With an old Pentium II-300 boasting a mere 192 megabytes of RAM, I acquired special boot ROMs and repurposed additional older computers as thin clients for the server. One of our principals was so impressed with the results that he suggested implementing this solution in one of our computer labs. The success of the trial led to equipping two computer labs and numerous computers in classrooms and libraries with the K12LTSP solution. As the project expanded, we needed a more robust server and acquired a Dell PowerEdge with an advanced RAID controller. However, this setup proved incompatible with K12LTSP packages on Fedora Core 4. That’s when I discovered K12LTSP on CentOS. We adopted the CentOS 4 LTSP server as our DHCP server, seamlessly integrating it with Microsoft’s Active Directory. It served us well for over three years until we eventually virtualized our servers using VMWare ESX.

My foray into learning Linux empowered me to explore and create in ways I never imagined possible. Initially, open source presented challenges, with some components requiring unfamiliar configurations. However, I overcame these obstacles by relying on search engines and reading forums on the internet on Red Hat, Fedora, and other Linux user groups. Subsequently, I secured grants funded by our New York State Legislature, allowing me to attend Red Hat System Administration training in March 2003. A year later, another grant facilitated my participation in the Linux Boot Camp hosted by Training Camp and taught by Ross Brunson. Brunson’s teaching method involved building a system “from the ground up” with Red Hat 7.0, starting with the command line and gradually transitioning to a graphical user interface.

Equipped with experience and training, I became a resource for other regional school districts. Recognizing the tremendous potential of teaching students Linux, I seized every opportunity to do so. Unlike other operating systems, Linux allowed students to learn the fundamentals and progress to building their files and web servers. I utilized tools like VirtualBox to virtualize other Linux systems, such as Ubuntu and Debian, providing students with additional learning opportunities. Beyond developing a deep understanding of the operating system, my students and I familiarized ourselves with various open-source projects such as Audacity, OpenOffice.org, Apache, WordPress, Drupal, and Moodle, to name just a few.

The open-source ethos resonated with my desire to serve individuals and small businesses, which continues to this day as I work as a consultant for my own information technology business.

The foundational knowledge that propelled me toward advanced studies continues to animate my life and career. I teach young people and adults about Linux using platforms like the Raspberry Pi computer at our local library and other venues. Linux and open-source software have also spurred my exploration of social entrepreneurship, heavily influenced by what I have learned and witnessed within the open-source community. Later this month, I will be able to teach middle school students how to use Raspberry Pi 400 computers and Python at a local library.

This article is adapted from https://opensource.com/life/15/6/my-linux-story-don-watkins