SongNet: Building a Private WiFi LAN

SongNet: Building a Wireless Private LAN with a Raspberry Pi and a pocket router

By Gene Wilburn

Songnet

Overview

There are times when you meet with a group and want to share documents in common, but your meeting place doesn’t have WiFi Internet access. It could be an informal classroom situation, a regular meetup group, or, as in my case, two music-jam/singing groups.

In one of my groups we use Dropbox for sharing electronic versions of lyric and chord sheets. In the other we use Google Drive. These work well enough when there is Internet access, but often the places we meet to set up and play don’t have WiFi available.

Dropbox and Google Drive also have two disadvantages: every time a new member joins the group, we have to set them up with Dropbox or Google Drive and Google Docs apps for sharing. Even worse is helping them make local copies of the lyric sheets on their tablets for offline access.

This was technically challenging for some members, not to mention that it requires each member to personally update their local storage regularly. In order to create a more user-friendly experience I put together a solution that I’ve dubbed SongNet.

It occurred to me, as I’m certain it must have occurred to many others, that a nifty solution would be to create a small private wireless LAN, or Intranet, that could be set up in the meetup venue room, creating a private hotspot that could be accessed by any device that members preferred, whether it was a smartphone, tablet computer, or laptop. The only required app is a web browser.

Equipment Needed

The gear needed to set up a private local wireless LAN has been around for some time and you might even have some of this in your parts bin.

  • A router that also serves DCHP addresses
  • A Raspberry Pi computer or equivalent

I focused on small size and portability by selecting the following three pieces of hardware:

  • Raspberry Pi Zero W Linux computer
  • TP-Link TL-WR802N Wireless N300 Travel Router
  • High-performance 32GB MicroSD card

Any Raspberry Pi model with a built-in or external USB WiFi adapter would work. I acquired the TP-Link travel router from Amazon for around $35 Canadian. Because the MicroSD card holds the operating system, the web server, and the web contents, I wanted one with plenty of storage and one that is as fast as possible. I selected a Samsung EVO Select 32GB microSDHC UHS-I U1 Memory Card with Adapter from Amazon for around $12 Canadian.

Setting up Raspberry Pi

The first order of business with the new MicroSD card is to set it up so it can boot the Raspberry Pi. Using the SD adapter that comes with the MicroSD card, put the card into an ordinary SD slot of a Windows, Macintosh, or Linux computer download NOOBS and add the NOOBS files to the MicroSD card, following these instructions and the ones that come with the download.

This done, remove the MicroSD card from the adapter and insert it into the Raspberry Pi and boot it, connected to a monitor, external keyboard, and mouse. When it boots, choose to install which version of Raspbian you prefer. I selected Raspbian (not Raspbian Complete or Raspbian Minimal). When that’s done, reboot the Raspberry Pi and follow the prompts for resetting the password to one of your choice and selecting an active WiFi network. More prompts will follow for updating the files. This takes awhile.

The Raspberry Pi Zero has so little RAM (512MB) it strains to run the graphical desktop environment and the GUI is a significant drain on system resources, so we want to eliminate it from regular use once we’re set up. We also want to activate the SSH server in order to log into the Raspberry Pi when it’s “headless” — that is, unattached to an external monitor or keyboard.

To so this, open a Terminal application and type the following:

$ sudo raspi-config

This brings up an easy-to-follow, character-based menu.

raspi-config-1

Select 3 Boot Options and press Enter.

Next Select B1 Desktop / CLI and press Enter.

raspi-config-2

Then select B2 Console Autologin hit the TAB key and press OK.

raspi-config-3

What this does is deactivate the GUI desktop environment from loading automatically, presenting you instead with a console screen with user pi already logged in. Should you need to boot up the GUI for any reason, when you’re attached to an external monitor, type the following at the Command-Line prompt:

$ startx

The next step is to activate the Raspberry Pi’s SSH server so you can log in from other machines using an SSH client:

raspi-config-4

Put the cursor line on P2 SSH then tab to Select and press Enter.

raspi-config-5

On the next screen tab the cursor to “Yes” and press Enter.

raspi-config-6

Setting up the web server

Next, in a Terminal window or at the console, type the following commands to set up the directories to prepare for installing the web server.

$ cd /var
$ sudo mkdir www
$ sudo mkdir www/html
$ sudo chmod -R 755
$ sudo chown -R pi

Because the Raspberry Pi Zero W is a minimalist Linux computer, I elected not to use the fully-featured Apache2 web server. Instead I opted for the simpler Webfs, a lightweight web server that is more than sufficient for serving static pages such as song lyrics.

To install webfs on the Raspberry Pi, type the following commands in a Terminal or at the Console and follow the prompts:

$ sudo apt update
$ sudo apt upgrade
$ sudo apt install webfs

In order to add content, we need to know the IP address of the Raspberry Pi. To find this out, type the following:

$ ifconfig

And look at the IP address for wlan0, the WiFi adapter. The IP address is the set of numbers just to the right of inet, in this case 10.0.0.10.

ifconfig

We can first test this by opening a Terminal on a Macintosh, Linux, or Windows Subsystem for Linux (WSL2) computer and typing:

$ ssh -l pi 10.0.0.10

or whatever your IP address is for the Raspberry Pi. Answer yes to accept the security credentials and if all is well you should now be logged into the RPi.

To populate the Raspberry Pi’s web site, we turn to another command-line utility called rsync. Go to the directory where your lyric sheets are stored on your Mac or PC and type the following in a Terminal window:

$ cd Lyrics (or whatever your directory name is)
$ rsync -avz * pi@10.0.0.10:/var/www/html/

Of course you use your IP address rather than the 10.0.0.10 for my Raspberry Pi. Then you can watch as the files transfer to the Raspberry Pi’s web directories.

To test the site, first log onto SongNet (password: singalong):

songnet-select

Then open a browser and point it to the IP address of the Raspberry Pi: e.g.,

http://10.0.0.10/

You should see an alphabetical listing of your song sheets. Webfs by default allows directory listing, which, if you don’t mind scrolling, may be all that’s needed for your site. The web listing will look something like this and you simply scroll and click on the song you want to see:

plain

If you know some HTML and want to create your own index.html page for the site, log into the Raspberry Pi and type the following:

$ sudo nano /etc/webfsd.conf

Go to the line that reads

web_index=""

And change it to

web_index="index.html"

Because Webfs defaults to port 8000, it’s also preferable to set the port to the standard 80. This too is located in the webfsd.conf file. Go to the line that reads

web_port=""

And change it to

web_port="80"

Save the changes and reboot.

$ sudo shutdown -r now

Because my groups have accumulated a very large number of files, I wrote a Perl script called buildIndex.pl that pretties this up by putting an Alphabet Selector at the top of the lyrics page and Anchors within the listing for quicker access. It also looks nice.

listing

Setting Up the Router

Following the instructions that come with your router, log into the router using a browser. The first thing to do is to set the IP address of the LAN (Local Area Network). Choose a network IP range that is different from the one you have at home to assign what is called a “non-routable IP” range, which is a set of numbers set aside for LANs that are not connected directly to the Internet. To make typing the addresses easy, I set my router to a 10.0.0.0 network, subnet 255.255.0.0.

router-1-lan

It’s important that the Raspberry Pi have a fixed IP address or the system won’t work. You can do this in one of two ways. One is to use the RPi’s graphical interface to log onto the portable router hotspot and follow the menus to manually assign a fixed, or static, IP address. Another way to do this is, if your router permits it, is to put the MAC address of the Raspberry Pi’s WiFi adapter in the router itself and have it automatically assigned by the router:

router-2-macip

Users of SongNet need to type this IP address into their browsers to access the songs, so I chose to assign the address 10.0.0.10 for ease of entry.

DHCP

One of the critical functions of the router is that of a DHCP server that serves dynamic IP addresses to the users of the network. When they log into SongNet they get a 10.0.0.X address that connects them to the system. This is handled in the router’s DHCP section where you set aside the range of IP addresses that are available. In this case the addresses from 10.0.0.100-199 (100 addresses) have been made available.

dhcp

 

Test Out the System

Now that it’s all put together, it’s time for a test. Disconnect the travel router from the Internet by removing its ethernet cable, disconnect the Raspberry Pi from its external monitor and keyboard, and put the router and RPi together in a room and plug them in.

At this point it’s necessary to use your tablet or computer’s WiFi setting to join SongNet.  I assigned the password singalong for joining SongNet.

songnet-select

Now open a browser and enter:

http://10.0.0.10

This should show you (and everyone logged in) your songs and allow you to select them for display.

Finally, before you unplug the local WiFi network to carry it or put it away, you should shut down the Raspberry Pi properly. To do this SSH into the Pi and type the following:

$ sudo shutdown -h now

Give it a minute to finish closing all its files then it’s ready to tote to the next gig.

Lenovo C330 Chromebook: A Writer’s Delight

Lenovo C330 Chromebook: A Writer’s Delight

By Gene Wilburn

lenovo

Until recently I’d shied away from Chromebooks. They didn’t seem like real computers to me and for the price of even the basic ones, you could often pick up a used laptop with more overall functionality. I have several programs, such as Photoshop and InDesign, that require a high-end computer and I use both MacOS and Linux computers for these heavier-duty computing needs.

What softened me to the possibility of using a Chromebook was my iPad. It changed the way I used the Web. Between the iPad and the advent of reasonably-priced cloud storage, I began using the iPad more than my laptop computers, especially for writing. I went from being a touch typist to a single-finger poke typist on the iPad’s virtual keyboard. Occasionally I augmented this with Bluetooth keyboards and the combination of an iPad with a wireless keyboard made me wish for something along the same lines but in a single, integrated unit, similar to but not expensive like the Microsoft Surface.

I was intrigued by an announcement from Google in the fall of 2017 that they would soon upgrade ChromeOS to allow it to run both Linux and Android apps concurrently with ChromeOS apps on their Chromebooks. Linux is my favourite operating system and Android apps are pretty much identical to the apps on my iPad. It was beginning to look very interesting.

Deciding to take the plunge, I found the Chromebook unit that had the specs I was looking for in the Lenovo C330: 4GB RAM and a 64GB eMMC drive, plus extras that I thought of as gravy, such as a touch screen and a 180 degree pivot of the LCD panel. At roughly $360 Cdn, it seemed reasonably priced.

Setup and Experimentation

The first thing I did when the machine was in front of me was hold it up so I could check out the whereabouts of the I/O ports. On the left side, facing the machine, is one USB-C slot which the power supply uses but which can be shared with other peripherals. One USB3 slot for backward compatibility plus an SD card slot. Nice touches these. The right side of the unit has a mechanical volume control, on/off switch, and an earphone jack. Did you hear that, Apple? An earphone jack! A lot of us still have good wired headphones we’re satisfied with. It’s a real courtesy to customers to not expect all of us to upgrade to USB-C devices in one fell swoop. Kudos to Lenovo.

I opened the lid and feasted my eyes on the keyboard. An honest, full keyboard with all the keys exactly where I want them. Wide shift keys, easy-to-hit Enter key, full-size numeric keys, and a set of arrow keys at the bottom right, underneath the right shift key. The keys are coated in a kind of plastic that feels slightly rubberized. Response is on the soft side, but so far I have not witnessed any sign of keyboard bounce. Speaking as a writer, the Lenovo keyboard passes muster. It’s not as good a feel as my Macbook Air (old style non-butterfly) keyboard, but given the difference in price level, the Lenovo keyboard holds its own.

As I was about to turn on the unit, I paused momentarily for a big breath. I’d never before in my life ever used a Chromebook and had no idea what to expect, other than its reputation for ease of use. When it booted into the Chrome logo it asked the same kinds of setup questions you get on any tablet, such as network and password. It assumes you have an email account with Google. That’s mandatory, I believe, so I put in my Gmail ID name and password, and it began the setup, already familiar with my profile. There was the usual keyboard question, defaulting to US keyboard but I chose the Canadian-English spell checker. Boom, it was done. Installed and ready to go. Anything else you want, visit Settings and help yourself.

Naturally the default browser is Chrome. It went straight to my Gmail account and right into my Google Docs documents and folders. Seamless.

I studied my way through Settings next. I tested the Bluetooth adapter on a BT speaker and a pair of BT headphones and they both checked out fine. The only disappointment for me was that I didn’t see anything about Linux. I then guessed, rightly in this case, that ChromeOS wasn’t up to date so I updated it, rebooted, and this time in Settings, there was a new Linux section, with Install Linux as an option. It warns that this is still in beta, but I’ll take a beta Linux over no Linux any day.

When it finished installing Linux I opened the Terminal app. After a few seconds wait as things initialized in a KVM (kernel virtual machine), a beautiful Linux system appeared, at the command line. It turned out to be pure Debian, the latest version of Debian at that, which delighted me. I’ve been a Debian Linux fan since the mid–90s. I used Apt to update Linux and now both ChromeOS and Linux were up to date.

Android Stuff

The desktop of ChromeOS has a bottom panel called the Shelf that contains an icon for the Chrome browser, Gmail, YouTube, and Play Store. Play Store is where you find Android apps. I’ve populated my Chromebook with some of the same apps I use on my iPad: iA Writer (a writer-oriented Markdown editor), Netflix, a File Manager utility, Dropbox, Snapseed, Great Courses, plus a few more. Each, so far, has worked as expected. An Android app, such as iA Writer, has access to that same shared Downloads folder that is shared by ChromeOS and Linux, meaning you could edit the same document from three different operating systems, which I did out of sheer curiosity.

One of the noticeable things about using Android apps is that the fonts are not as crisp as you might like. The fonts have a slightly fuzzy, artificial look, unlike the well-formed ChromeOS native fonts. This is not a show stopper but it makes the Chromebook more of a Grade B tablet when running Android apps. I would not care to read an ebook with the Android fonts.

Linux Subsystem

For me the Linux subsystem (still in beta) is the jewel in the crown of the Chromebook. As mentioned, the default installation is based on Debian GNU/Linux, and there are hints that other distributions of Linux might be offered sometime in the future. Oddly the Chromebook default Downloads directory does not appear in my /home/gene personal space. Instead it’s mounted at /mnt/chromeos/MyFiles/Downloads. To make this more convenient I immediately made a symlink to that from inside my personal workspace with:

 $ ln -s /mnt/chromeos/MyFiles/Downloads/ Downloads

At this point the system was ready to easily share files among the three operating systems.

I used the Debian Apt utility to update Linux and install certain pieces of software to try. Among my downloads were Gedit, Wordgrinder, Joe, Emacs, Pandoc, and LibreOffice. All worked well, though there was occasional background screen flashing when using Gedit. I experimented with writing a bash script but could not get the system to chmod my file to an executable, even using $ sudo chmod a+x filename. It appears that the basic ChromeOS file system is mounted with a ‘noexec’ flag and at this time I haven’t yet figured out if this can be changed. The good news is that the shell script can be run as $ bash scriptname.

I installed and tried out a couple of different standard Linux terminal programs, Gnome-terminal and Konsole, and unlike the default terminal they can be launched in multiple instances either in separate windows or in tabs. The default terminal can only handle one thing at a time and there are no tabs for additional instances. What it does have, however, are better looking fonts.

There are occasional glitches in the Linux subsystem. Once in awhile, if I’d switched between environments several times while using Linux, it would lose its pathing and respond with “command not found.” When I closed the terminal app and opened it again everything returned to normal.

At a user level, the Linux subsystem generally works well, but I wouldn’t try any development in the environment, at least not at this point in its evolution. All the Linux utilities I tried worked normally, including the many text utilities.

I gave the Linux subsystem a serious workout by installing LyX and all its TeX and LaTeX components. It took four tries. The subsystem crashed three times, once with a segmentation fault, requiring me to shut down and restart the entire Chromebook each time, but it picked up each time where it left off after the previous try. Eventually it finished and I was able to run LyX and preview a typeset document. Not bad, but the Linux subsystem is not yet what I’d call robust. At this point it’s best to think of it as Linux Lite.

Choosing the Best Writing Editor

As a writer who is also a techie I’ve usually eschewed word processors. I like working with text files because they’re non-proprietary and there are many good utilities that work with them, but, like writers everywhere, I often need to italicize the title of a book or movie or a record album and sometimes I want to boldface a word. I also want to put hyperlinks in my text that point to places on the Web. To handle this, in plain text, I use the excellent Markdown system of notation.

My go-to editor for the past couple of years has been iA Writer, which comes in Windows, Mac, Android, and iPad versions. It’s a text editor wrapped around Markdown, making it easy for writers to use, and it has a first-rate HTML export function built in. It’s uncluttered and has a focus mode and a night mode that allows the writer to concentrate on the writing rather than the writing environment. The Android version is similar enough to my Mac and iPad versions that I suspected it to be my editor of choice on the Chromebook.

I’m also addicted to Linux text editors and as long as I was setting up shop anew on the Chromebook, I gave them a spin, using them with Markdown. I tried a number of console editors, including the very basic word processor called Wordgrinder, Joe, which has WordStar/Borland style keyboard shortcuts, and my favourite console editor, Vim, with stands for Improved Vi. These all work flawlessly in the Linux subsystem, and they’re light on resources. Occasionally, when I’m feeling exceptionally brave, I dabble with Emacs.

On a whim, however, I decided to try Chromebook’s featured editor, which is Google Docs. I’d used Google Docs occasionally to store information, but I’d never taken it seriously as a writing tool. I was surprised at how much I liked it, not least because the fonts are excellent and easy on the eyes. I wrote a few paragraphs then tested its various export formats. All were very good except for one quirk when it saves output to a plain text file. In text files it puts two blank lines between paragraphs where I only put in one while I’m typing.

Not being too sure about Google Docs, I asked writers in the “Canada Writes” Facebook group if any of them used it and what they thought about it. I got back several replies from writers who say they use it nearly exclusively and have found it to be stable and excellent for all their writing, including client work. That was enough to convince me it was worth a try and this review is my first piece written in Docs. I suspect Google Docs will become my main editor.

Conclusion

In the short time I’ve owned the Lenovo Chromebook C330, it’s become my favourite writing machine for drafting stories. It’s also a pretty decent machine for listening to music or watching streaming video. To be honest, other than seeing that it works, I don’t make use the feature that allows me to fold the viewing screen back 180 degrees. I already own an iPad which I greatly prefer as a tablet.

For the most part, the Chromebook is a writing machine with the side benefits of being a very good web browser and Gmail viewer. I use the Linux terminal to run utilities on text files, and to SSH (encrypted remote login) to my other Linux and Mac computers.

It has met my expectations and then some. Overall I’d give it high marks in the bang-for-the-buck department. At $360 Cdn, it’s a bargain, and a writer’s delight.

 

Linux on Mac

Linux on Mac

By Gene Wilburn

linux-on-mac

My Macbook Air is now a dual-boot MacOS/Linux laptop. I’ve always wanted to run Linux on really nice hardware so I decided to try installing the Ubuntu 18.04 LTS release after setting aside half my SSD, using Mac’s Disk Utility program to format it as MS-DOS. (Linux reformats this to native Linux Ext4.)

I chose Ubuntu because of its excellent hardware support and, to my surprise, it installed trouble free, though it didn’t initially recognize the built-in wifi hardware of the Mac. To fix this I booted with a USB wifi adapter inserted and Ubuntu downloaded the Broadcom device driver I needed for the Mac. One reboot and I had a live, fully functioning system.

The installation didn’t ask me to try to put Grub into any kind of pre-boot partition, like MBR. To change from one OS to another, I simply hold the Option key down while booting and choose which OS to boot. In MacOS you can set the boot default and mine is set to default to Linux.

I’ve been a Linux user since 1993, starting out with Slackware on an old 386 PC, in character mode only. I’ve used many distributions since then, and I find things to like most of them, but I prefer the Debian-based distributions because of the robust .DEB packaging system. Ubuntu has been rock solid for me so it’s the one I put on the Mac.

There was one oddity. Neither Gnome3 (Ubuntu’s version), nor Cinnamon would recognize any kind of right-click emulation from the Mac’s trackpad. Mate worked just fine, but I’ve grown fond of Cinnamon and by setting its trackpad settings to “mouse emulation” the trackpad had left and right clicks located in the bottom-left and bottom-right corners, just the way I set them up in MacOS. The Mac trackpad worked almost as smoothly as it does under MacOS. I’ve never had much luck with Windows hardware trackpads and Linux so this was a nice surprise.

The greatest moment of acceptance came for me when I synchronized my Linux Dropbox client and it downloaded my photo files. I opened some of them with Gimp, which I already knew how to use, and Gimp looked really good on the Mac’s Retina display. This was a key finding. As a photographer who has used Photoshop for years, I found myself falling behind Adobe because I was sticking with my Photoshop CS6 package. Adobe’s ACR raw editor no longer supports the cameras I use and I’m just not even remotely tempted to buy in to Adobe’s rent-Photoshop-every-month-for-the-rest-of-your-life option. Photoshop is excellent, but so is Gimp, which costs nothing and stays up to date.

The main part of the Adobe package I’ll miss is Adobe Bridge because it could easily review and batch rename files with my custom naming convention. But last year I solved that too, by writing a Bash script to use Exiftool to extract the shot date and turn the result into my file naming convention.

So, hello Linux on Mac has meant goodbye Adobe. And anyway, I can do fine tuning of photos in Snapseed on my iPad.

The final adjustment I needed was a way to easily enter occasional French accented characters from the keyboard. When you live in Canada, it’s common to want to write something like Trois Rivières in accented fashion, to respect the French spelling. MacOS handles this brilliantly but I couldn’t find any Linux keystrokes that worked like a language Compose key.

I found an app called “Characters” that is simply a character map for different languages. It was awkward to use so I did some Googling and discovered that there’s a deeply-buried option in the keyboard settings that allows you to assign a Compose key. I took the default Right-Alt key, better known as Right-Option on the Mac.

It works just as expected. If you hold down Compose and type a backtick(` ) then a vowel, you get à, è, ì, ò, ù. Same for the other accents. Perfect for when the need is occasional. If I were typing a lot of French I’d switch over to a French keyboard layout, but my use is casual.

As mentioned, I use Dropbox to coordinate my files between Linux, MacOS, and iOS machines. It’s also my most immediate backup.

The rest is pretty standard. I use Firefox as my browser, just as I do under MacOS, and I use the browser version of Gmail so I don’t have to fiddle with email client programs. Besides, I’ve never liked Thunderbird.

For writing, the activity I do the most, I use Gedit, a basic text editor that comes with most Linux distros. It has useful plugins, like one for Markdown support. All my writing files are in plain text, marked up with bits of Markdown when I need italics, bold, or some minor formatting like indented passages. I use Pandoc to convert my Markdown files into HTML files when needed.

I tried using Emacs to write with, but as much as I admire it, I don’t care for it as a writing tool. Besides, its line oriented text files don’t mesh well with my Mac editors, which are paragraph oriented. Gedit works perfectly for my needs, including inline spell checking.

Occasionally I do some programming and lately I’ve been studying a little C++. I could do this on MacOS too, but open-source languages feel more at home in Linux, more complete and up to date. Apple keeps its own development tools up to date, but lags behind on open-source releases like the gcc compiler, Perl, Python, and the rest.

I originally thought I’d pop into MacOS more often — don’t get me wrong, MacOS is an elegant and very modern operating system (far superior to Windows in my opinion) — but now that I’ve eliminated Adobe from my life, there’s not much that’s available for the Mac that I don’t already have an equivalent for in Linux. As a result, the only time I find myself booting into MacOS is when I want to update it, to keep it current.

Linux on Mac is one of the nicest surprises I’ve had this year. While nothing is perfect, this is as close to perfection as I’ve yet experienced.

Linux on Mac — an elegant way to run Linux for the technically inclined.

Why Use Linux?

Why Use Linux?

By Gene Wilburn

I’m astonished at how seldom anyone asks me “Why use Linux?” It’s as if, outside the realm of computer techies, Linux is unknown or feared. So let me start with an introduction.

Think of your computing device operating system as a vehicle of transit, say a car that takes you to where you want to go. Now think Smart Car. Now think driverless Smart Car where you simply sit inside and tell Siri, or James, or Hobnob where to take you. This is the model of modern operating systems, especially those for tablets, such as iOS from Apple and Android from everyone else except Microsoft. They are attempts to make your trip devoid of challenges or problems and both Windows 10 and MacOS try to do this, not entirely successfully. The design goal of user friendliness and ease of use is good, but it’s only one way of looking at operating systems. The problem with this model is that some of us like to do our own driving, and we like a standard gear shift so we can control the ride ourselves. If you’re like this, then there some things about Linux that might appeal to you.

The standard way to introduce Linux is to say something like “Linux, or GNU/Linux as it’s sometimes known, is a multiuser, multitasking operating system that runs on a broad variety of Intel and AMD processors.” That’s a mouthful and it doesn’t do much to tell you what Linux is. So, think DOS, or if you back go far enough, CP/M. You got around and did work by typing commands directly into your computer. Before Windows (and Mac and OS/2) that’s how you communicated with your computer and launched programs. Like driving a stick shift.

Now, lest I misrepresent it, Linux too has a graphical, windowed interface — several of them to choose from actually — and they’re very nice and modern and you can set up a Linux computer for a non-techie and they can work it just fine that way. I use it that way myself most of the time. But the real draw of Linux lies under the hood, or behind the command line prompt, which is usually a plain, little dollar sign: $. From here you can do just about anything, including driving yourself into a brick wall at high speed, if you’re not careful. But then, you’re a careful driver, right? And behind that dollar sign lies a computer techie’s dream.

So what’s so special about Linux, then? Two things: it’s based on Unix, and it’s free.

Unix

Linux derives, ultimately, from Unix, an operating system that emerged from the Bell Labs in New Jersey and launched on January 1, 19701. Unix pioneered many of the modern operating system concepts, like hierarchical directories, utilities that did one thing, and one thing well, and a way to string the utilities together using pipes and redirection. You may remember DOS commands such as mkdir for “make a directory” (today most people call them “folders”) and cd for “change directory.” These commands were “borrowed” from Unix but were a pale imitation of the real deal.

Furthermore, Unix was the proving ground for the mouse, the graphical interface (before the Macintosh), and before that, and more importantly, the Internet. Email was invented and standardized in Unix, as was the TCP/IP network protocol that the Internet runs on. The Web was invented on Unix too. To put it mildly, Unix has been a foundational technology in the history of computing. The problem with Unix was that it only ran on mainframes and minicomputers, as shared multiuser systems. The techie’s dream was to have a personal Unix that could run on an inexpensive Intel and AMD PCs. But Unix required expensive licensing and was not built for the Intel architecture.

FSF, GNU, and BSD

There were three or four projects that were begun in the hopes of creating a free Unix workalike, free from licensing fees, and free from corporate rule. An influential programmer, Richard Stallman, set up a project to recreate all the Unix utilities with no reference to the original source code so it could be used and legally distributed for free. He called it the Free Software Foundation (FSF) and later, GNU (GNU’s not Unix — a recursive acronym). GNU was delaying building a kernel (or auto engine) for the last piece of work.

Meanwhile another group was striving to release a BSD (Berkeley Systems Division) Unix derivative using both the GNU and the Berkeley utilities to create a Unix-like OS for the Intel 386 processor. They actually did a smashing job at this, but ran into a licensing dispute with the University of California, Berkeley, about free distribution. FreeBSD, as it came to be called, was, and still is, an excellent Unix-like OS and if they hadn’t been forced to hold back until the dispute was settled, I might now be advocating FreeBSD instead of Linux. Unfortunately, it missed its prime window of opportunity. Nonetheless, there are a lot of web sites today running on FreeBSD which is admired for its dependability and stability.

Linux

But fate intervened, and a young computer science student in Helsinki, Finland — Linus Torvalds — took another project called MINIX (an experimental Unix-like OS for the Intel 286) and started rewriting the kernel to work on the 386, the first genuinely 32-bit CPU from Intel. To say the least, he succeeded, then he and his colleagues around the world added the GNU Unix utilities and his friends dubbed the package “Linux” in his honour. Linus is still the head of Linux kernel development, though he now does it from sunny Silicon Valley.

The early days of Linux were typified mostly by character-based consoles, like logging in to a PDP-11 Unix computer except right on your own PC. There were several “Linux distributions” (flavours) like Slackware (still available), Debian (still available and the progenitor of all the Ubuntu distributions), Red Hat (before it went commercial), Caldera (no longer with us), and SUSE (still popular in Europe). In addition the “little Linuxes” began to appear—distributions like Damned Small Linux that ran on minimal or even embedded systems.

As Intel processors became faster and more powerful, Linux added windowing interfaces based on another free project, the X Window Consortium. From this sprang most of the modern Linux graphical interfaces that have names like Gnome3, Mate, Cinnamon, KDE, IceWM — there are literally a few dozen graphical interfaces to choose from, some of which are designed to run on minimal (e.g., old) hardware.

Because it was developed for the PC, Linux quickly acquired device drivers for most of the peripherals of the day: network cards, printers, faxes, external hard disks, scanners, mice, trackpads, speakers, and, more recently, Bluetooth and WiFi adapters. In other words Linux had all the joy of Unix plus all the practicality of a personal computer. A personal Unix. What is most notable about all of this is that it is the result of programmers who cared enough to devote their free time to working on Linux drivers and other free software projects. This was the birth of what is now called the Open Source model.

ASCII (Text) Files

I think it’s fair to say that no other operating system uses ASCII2, or text, files to the extent that Linux/Unix does. Perhaps you remember the early days of DOS and Windows when you might have an autoexec.bat and a config.sys file in your boot directory to customize your system for your use when you started your PC. And when Windows programs frequently had a corresponding .ini text initialization file to create a profile for how a Windows program should start and run.

This is the Unix style, and Linux is set up with all manner of text files that instruct the system how to boot and what to run when it does. And many programs, such as the vi or emacs editors have startup files that are “hidden” files with names like .vimrc or .emacs. The dot at the beginning of the file name makes them invisible unless you invoke a list command that displays them, e.g. ls -a.

The beauty of ASCII files is that they are easily readable, easily edited, and, perhaps as importantly, easily searched. Linux/Unix has excellent, time-honoured facilities for searching text files either for file name or contents. Linux editors abound, from the traditional vi and emacs editors to simple editors like nano or writing-oriented editors like Focus Writer. There’s an editor for any style or personality. Many are oriented to programming, with syntax colouring and parenthesis, brace, and bracket matching to assist programmers, but there are authors who use these editors for writing articles and books. The SF author Neal Stephenson, for instance, mentioned in an interview that he uses Emacs on Linux for all his writing and I believe I’ve heard that Cory Doctorow uses Emacs as well.

Linux currently sports a sophisticated office suite called Libre Office (also available for Windows and Mac), but the true heart of Linux lies in its text files. For things like advanced formatting of print material, PDFs, or ebooks, the traditional Unix approach has been to put instructions on what to do right inside the text file, totally visible with nothing hidden. Think permanent Reveal Codes if you recall WordPerfect 5 for DOS. This is called a markup scheme, and is used for traditional typesetting programs such as troff or LaTeX. This has also led to the development of a simple writer’s markup scheme called Markdown and is the scheme I use for all my writing, including this essay3.

When your files are text files, some things become much easy to do in Linux. For instance, to keep my essay writing in some semblance of order, I internally title my essays as Essay001.md, Essay002.md, Essay003.md, etc. (.md for Markdown) and to see what they’re about I know that each essay has a title line as its first line. To get a snapshot of my work I can use the Linux utility head that shows only the first x lines of a file, 10 by default. (There is a corresponding tail command.) I only need one line, so my command in my Essay directory is:

$ head -1 Essay*.md

Which produces:

==> Essay001.md <== 
# Paradoxes and Temporal Displacement

==> Essay002.md <== 
# Flowers from Algernon

==> Essay003.md <== 
# Where's Walden?

==> Essay004.md <== 
# A Musical Interlude

==> Essay005.md <== 
# Whatever Happened to Ecology?

==> Essay006.md <== 
# Of Melancholy I Sing

[etc.]

Slick, no? It’s a trivial example of what you can do from the command line, but it illustrates the principle of Linux tool use. It starts out with, hey, I’ve got a problem to solve. How do I see the first line of all my essay files? Then I think about what tools are available. Well, head should be able to do that and a quick check on the manual (man) page tells me how to limit the display to one line. This is a form of computing, using the tools for something you want to solve.

There’s much more I could do with my essay files from the command line. Using sed (stream editor) I could make global changes to all the files with one command, say substituting the word real for actual, for example, or removing the spaces around em-dashes. If I were a novelist, I could change a character’s name globally if I decided to rename a character after several chapters into the work. There is nearly always a solution, often more than one, to solve a problem. Of course you need to know what the tools can do before you will think of using them, but that comes with the territory of learning the environment, and if you’re technically inclined, it’ a fun study.

Development Tools

Linux is also the home of server applications, such as Postfix for an email server, Apache or Nginx for a web server, not to mention database servers, repository servers, FTP servers, firewalls, and the like. You can create a test website on a Linux box then test it from other PCs and tablets on your home network before committing your work to a live, external web server. Want to work with a content server like WordPress? You can set this up to work in your Apache web server and get to know it and its plugins and do your testing locally rather than risk fiddling with a live website. Linux is a web developer’s friend.

But the jewels in the crown are the programming environments Linux provides, from the amazingly able Bash shell and interpreted scripting languages such as Perl and Python all of which are normally a part of every distribution. To that you can easily add C, C++, Java, LISP, Haskell, and any of a few dozen specialty languages. Naturally this might not appeal to a casual user, but think kids. The more exposure to Linux and its programming environments they get, the more prepared they will be to pursue technical training and study.

Scalable Knowledge

One of the side benefits to learning Linux is that you can log into just about any Unix or Unix-like computer on the planet and feel at home with the environment. This includes machines as tiny as a Raspberry Pi that might be used in a robotic installation, or a supercomputer cluster at a research centre. A survey in 2017 indicated that the top 15 supercomputers in the world were all Linux clusters. Most of the Cloud is based on Linux as well. You can switch easily between your personal Linux PC and a remote console for a Linux system located in Amazon Web Services (AWS) or another cloud provider.

And if you should end up working in the financial sector, as I did for a few years, you’re already right at home in IBM AIX, HP/UX, and Solaris systems that might be operating as Oracle servers. In other words, Linux knowledge is extensible and scalable — you only need to learn the basics once and you’re set for life. Command-line knowledge is stable and enduring.

Rescuing Old PCs

Most of us enjoy using the latest and fastest computers we can acquire and, in an age of graphical programs and the increased demand they make on resources, fast and powerful is good. However, in a text oriented environment, say writing, you don’t really need all that speed and power. The world is full of abandoned PCs and laptops that have quite a bit of life in them if turned into Linux machines.

For instance, I rescued a Dell Mini system with an Atom processor this year. It only has 1GB of memory and a slow HD, but it’s a nice little portable unit for a writer, and a great system for a kid to learn Python on. While most of the major distributions of Linux run best on fast gear, there are distributions created specifically for machines with fewer resources. On the Dell Mini I installed Xubuntu, a stripped-down, lightweight version of the popular Ubuntu Linux distribution. The Mini runs surprisingly well on it. Another friend had a low-resource laptop that was totally swamped by Windows 10, so I installed Lubuntu on it, an even lighter version of Ubuntu and it fuctions well as a browser for the Internet and it runs Libre Office well enough for occasional use.

Even if you’re not a writer, you can use a rescue PC to serve as a music and multimedia server for the house. Or, of course, a development web server. Or just as a machine for learning about computing, from the command line up.

Modern Applications

What I’ve sketched out here in very brief detail is the use of Linux as a traditional Unix box, with command-line richness and tools galore. For a tech-savvy person, this aspect of Linux is like owning a filled treasure chest. But there are also many modern, graphical open-source programs, or applications, available, from sound recording to animation to photo editing. They’re often not quite as slick as the commercial programs available for Mac or Windows, but they’re free of cost and you’re free (that is, it’s legal) to share them with others. These applications tend to be very good, with constant updates and improvements. Above all, Linux gives you choices. If you don’t want to pay Adobe $10US a month to use the current versions of Photoshop and Lightroom, you can use the free Gimp or Darktable apps that provide at least 80% of the same functionality, if not more.

Here’s maybe a surprise. If you’re not an Apple or Windows camp follower, you may already be using Linux without even realizing it. The Android operating system for smartphones and tablets is a Linux variant. If you have a Roku or similar device, it’s probably running Linux under the hood. The same goes for your router. Embedded Linux is widely used in commercial products. Linux may be used in your fridge, your car, or your TV set.

So let me conclude by saying that there are many reasons for wanting to use Linux, though I’ll be the first to admit it’s a best fit for people with a technical bent. If you’re so inclined, you’ll find it puts the computing back into computing. And I’m just geeky enough to think that it’s way more fun than Windows or even MacOS4. And did I mention? It’s free.


  1. uppercase UNIX is a trademark name. The computer industry usually uses the spelling Unix to include both UNIX and all UNIX-workalike operating systems such as HP/UX, Solaris, AIX, FreeBSD, Linux, etc.
  2. ASCII is short for American Standard Code for Information Interchange. Today it’s more accurate to say UTF8 as part of Unicode encoding but it doesn’t come as trippingly on the tongue.
  3. If you’d like to know more about using Markdown, I have written a free small e-monograph on the subject called Markdown for Writers.
  4. Technically, MacOS is a BSD Unix derivative OS but has been modified in untraditional ways by Apple. It’s still a Unix system at the command prompt, but is never as up to date on utilities as Linux or FreeBSD.