UpFront

diff -u: What's New in Kernel Development

Zack Brown

Issue #280, August 2017

Arnd Bergmann has recommended that the minimum supported GCC version be raised to 4.3 and the recommended version to 4.9. However, he plans to document the fact that folks like Geert Uytterhoeven and others were still using GCC 4.1 to compile recent Linux kernels with success.

According to Arnd's analysis, testing older and older GCC versions initially would produce more and more unnecessary warnings, making it more and more difficult to spot legitimate bugs. And beyond a certain GCC version, linker errors and build failures would begin to appear for certain architectures, notably ARM.

He posted a series of kernel patches that grew increasingly ugly as they had to accommodate older and older GCC versions. Some of these, he acknowledged, probably would be too ugly to make it into the kernel.

Protecting the kernel's ability to compile with ancient GCC versions is valuable work. A lot of enterprise systems can't really be upgraded without risking massive breakage, and so they just sit there unchanged for years, chugging along, bringing in revenue. But, the business has no choice but to upgrade its kernel in order to keep the system secure. As long as the company can still use all its old tools to do that, it won't have to worry about the large expenditures needed to retool the entire system and possibly discover that it can't be done within the available budget.

The oldest supported version of GNU Make is being raised from 3.80 to 3.81. Masahiro Yamada inadvertently broke Linux support for Make 3.80 in 2014 with a cleanup patch that made it into the kernel without anyone noticing the compatibility issue.

In fact, in the intervening three years, no one else has noticed the issue either. Instead, Masahiro himself discovered what had happened and recently suggested updating the documentation to list Make version 3.81 as the official minimum version.

There were no objections of any kind. Being broken for three years with no one noticing is a fairly good argument in favor of dropping support for a given version of a tool. Even Linus Torvalds, in his comment to the thread, seemed to indicate that this time period was enough to claim there were no active users of a given version.

As in the case of GCC, if even a single active user can be found for an old version of a tool, the Linux folks will make a big effort to continue to support that version. But as shown in the case of Make, with no such users standing forth, no such effort will be made.

The filesystem mounting API has been needing an update to help distinguish between a variety of actions that user code might take. But, it's also been needing new features to support modern ideas like containers for virtualization. Recently, David Howells addressed the latter, posting some patches to implement mount contexts. These would hold various binary data, along with the mount options, for use by the code performing the mount or by the filesystem itself.

This is valuable because it allows more detailed error reporting, which is useful for something like filesystem mounting that can fail in many different ways. But as Miklos Szeredi put it, David's code didn't go far enough to clean up the overall mount API.

Miklos wanted the mount API to have sharp distinctions between creating a filesystem instance, attaching a filesystem within an existing mounted directory, editing the superblock and adjusting the mount properties. David's work did this a little, but not enough, said Miklos.

But, David wasn't convinced of the necessity of having such extremely sharp distinctions between actions that were, after all, very closely related.

Ultimately, Miklos agreed that “everything that works now should work the same way on the old as well as the new interfaces.” This way at least, there would be no breakage, and other developers could pick up where David's work left off.

Android Candy: Clip-on Lenses

Shawn Powers

Issue #280, August 2017

My Sony Xperia phone takes fairly nice photos. You can see in Figure 1 that it's pretty clear, with nice color. The thing is, I want to livestream my daughters' volleyball and basketball games this year, and my phone just doesn't have a wide enough angle to capture the entire court. So, I figured I'd try some of the clip-on wide angle lenses for phones. But honestly, the results are a bit disappointing.

Figure 1. This is my backyard taken with my Sony Xperia.

The first lens I tried (the larger one on the left of Figure 2) is the $10 Zomei 0.6x lens (a.co/3b3AdGC). This lens feels solid and heavy with good-looking glass and a metal lens case. The “clippy” part attaches with plastic threads, but still, it feels solid. Unfortunately, it didn't provide very much more coverage, and the wideness it did give made for a pretty ugly image (Figure 3).

Figure 2. Oddly, the cheaper lens felt nicer but performed worse, and the more expensive lens felt cheaper but performed better.

Figure 3. This lens felt so solid, I expected much better results.

The other lens I tried was a $12 Amir, 140° wide angle lens that does 0.4x (a.co/2Ozkc5d). This is a much smaller lens, and it feels much cheaper. The coverage and photo are actually fairly similar to the Zomei, but it's actually a bit nicer. Plus, the smaller size makes the phone less unwieldy when taking a photo. As you can tell in Figure 4, it's still not a great picture, but it is wider than the phone can do natively.

Figure 4. This has a wider angle and a clearer picture, but both were disappointments.

My advice? If you have to take a wide angle shot with a phone, step back a bit to get a wider angle the old-fashioned way. Clip-on lenses are a great idea, and they do technically work, but if you're expecting the same quality photo your phone can take natively, you'll be sadly disappointed.

My Quest for Inbox Zero

Shawn Powers

Issue #280, August 2017

I've never been able to accomplish “inbox zero” for more than a couple hours. Part of it is due to poor organization on my part, and part of it is due to being too busy. The problem isn't that I get more email than I can handle (although that's probably true, I get a couple hundred messages a day), it's that most messages require a followup that I can't accomplish immediately. I've tried to move items I need to handle later quickly into a to-do list like Wunderlist, but it's an extra step that takes more time, so I just let things pile up in my inbox.

For some reason, I recently decided to try Google Inbox. It's not a new offering from Google, but I think it's matured since I originally tried it years ago. See, Google Inbox allows me to keep inbox zero with minimal effort and zero guilt. Here's the premise:

  1. When an email comes in, a quick swipe to the right will archive it. It's not even a click—just a swipe and it's gone.

  2. If I need to open it, I can tap it, then click a check box to archive it if I don't need to follow up.

  3. Here's the beauty. If I need to follow up on a message, even if it's just something interesting I want to read later at my leisure, I can snooze it. In the screenshot, you can see the options for snoozing, and they work perfectly.

The idea of snoozing email isn't new. I remember using “boomerang” for such a thing a few years ago. But Google Inbox has integrated the snooze and archive features so well that I can clear my inbox completely in moments and not worry that I've forgotten something. In fact, the snooze feature works much better than just leaving stuff in my inbox, because it actually comes back to my attention after the snooze period instead of falling off the end of my inbox.

Thanks to a fast, minimalist take on achieving inbox zero, I'm giving Google Inbox this month's Editors' Choice award. It's not a new product, but it has revolutionized my life. You can check it out without messing up your regular Gmail inbox by logging in at inbox.google.com in a web browser or by downloading the mobile app. You won't regret it!

Litebook

Shawn Powers

Issue #280, August 2017

Linux Journal reader Kevin Bruce dropped me an email about a too-good-to-be-true laptop from the folks at Alpha Store (https://alpha.store). The laptop is a 14", quad core, 1080p laptop with a 512GB hard drive for $249. My old Dell D420 has finally given up, so I was in the market for a fairly inexpensive laptop. I decided to order one. I opted for the $269 model with a hybrid drive, but everything else is the same as the base model. Rather than a full review, here are my quick takeaways:

  • The screen is amazing. Really. It's bright, vibrant and has incredible colors. The screen makes my D420 look like garbage, and upon first boot, I was giddy to see how amazing it looked.

  • The keyboard is a little springy, but tolerable. The plastic keys feel a little cheap, but the action is fine. It reminds me of typing on a Macbook Pro, but with looser, cheaper plastic for the actual keys.

  • The trackpad is horrible—and not just the sort of horrible that is annoying, but the sort of horrible that makes you unwilling to use the computer for anything other than typing or watching movies. It has an unpredictable scrolling feature, poor response and a cheap feel, and its complementing buttons are just as bad. The trackpad makes the entire experience unpleasant, and unless you're okay using an external mouse, I'd abandon ship.

There are also a few strange quirks, but none of them would have been a showstopper for me. The included Wi-Fi driver has weird issues with sleeping, so I found myself rebooting occasionally when the laptop lost connectivity. This isn't uncommon when you're trying to run Linux on a laptop that obviously was made for Windows, and I'm fairly certain finding the right driver would help.

The hybrid hard drive was really just a 32GB SSD device with the entire Elementary OS installed and a 512GB device that had four NTFS partitions on it. I could delete the partitions and reclaim the space, but it was a strange “out of the box” experience.

Finally, you can see two things in the photo. One, I have a really awesome cat. Two, the “red” model I bought is clearly pink. Not just pink, but hot pink. The white label even says it's pink, but the Alpha Store insists I bought a red laptop. The forums show other people with the same issue, so apparently to the Alpha folks, pink and red are the same thing. Honestly, I think the pink looks cooler than red anyway, but it was odd.

My advice to Kevin? Unless you want to use an external mouse, avoid this computer. The display is absolutely gorgeous, but the trackpad makes it almost unusable. The whole computer feels cheap, but that's not surprising for such an inexpensive model. If you're looking for a cheap laptop computer, I think the best option is to get a used one like the Lenovo Yoga 11e or something. They're nice machines, have better hardware (apart from maybe the screen), and you can get them for about the same price.

Microsoft Office on a Linux Machine?!

Shawn Powers

Issue #280, August 2017

My middle child is headed to college this fall, and although the college doesn't require a specific type of computer, it does require students to have Microsoft Office. Not Microsoft Office-compatible, but specifically Microsoft Office. That bums me out, but I figured Office 365 might be just the answer for a daughter who doesn't want to get a Windows laptop.

The coolest part about Office 365 is that college students can get it free if they have a college email account. The free subscription doesn't include a downloadable, installable version of Office, but for Linux users, that doesn't matter. The online version is all we'd be able to use anyway, so for a college student, Microsoft Office doesn't actually include a Microsoft tax.

The surprising part? Office 365 works great on Linux. No really. I opened a few native Microsoft files and created a few of my own. The OneDrive storage worked wonderfully from the web browser, and even printing worked well. You can see in the screenshot that Microsoft converts the document into a PDF file so it can be printed natively on whatever system you're using.

I'm surprised to report that Office 365 works so well on Linux, but it honestly does. For a college student, the online offering might be enough to meet all the requirements most colleges have for software. Even if you aren't a fan of Microsoft and its products, I recommend at least trying Office 365 if you're in a position that requires Microsoft Office, because it sure beats installing Windows 10!

Emacs for Science

Joey Bernard

Issue #280, August 2017

I typically cover software packages that do actual calculations to advance scientific knowledge. But for this article, I am covering a slightly stranger tool in the arsenal of scientific computation.

Emacs is a text editor that has almost all the functionality of an operating system. A collection of enhancements and configuration settings are available bundled under the name of scimax. Being an Emacs user myself, I was surprised I'd never heard of it before now. This project has been in development for some time, but it recently has started to find wider attention.

Before installing it, however, you need to install the latest version of Emacs to get all of the needed functionality. As with most of my articles, I am assuming that you are using a Debian-based distribution. You can install Emacs by using the daily snapshot package, available at the official launchpad archive. Install it with the following commands:

sudo add-apt-repository ppa:ubuntu-elisp/ppa
sudo update
sudo install emacs-snapshot

This will ensure that you have the latest and greatest version.

Once this is installed, go ahead and install the scimax code itself. You can get it from the main GitHub repository with the command:

git clone https://github.com/jkitchin/scimax.git

Start it with the command:

emacs-snapshot -q -l path/to/scimax/init.el

The first time you do this, there will be a lot of activity while Emacs downloads and installs the full suite of extra packages you need in order for the scimax code to have all of the required dependencies.

When you finally have everything installed and start scimax, you will see several new menu items in your Emacs session.

Figure 1. You will see several new menu item entries at the top of your Emacs window.

The real driving need behind all of the work that has gone into scimax is to make research more easily reproducible and to handle documentation of your research with minimal extra overhead.

Since you want to work with organized documents within Emacs, the base of scimax is built on top of org-mode. Org-mode, by itself, is probably something you will want to look into as a potent tool. Scimax takes this powerful core and makes it easier to use with a series of shortcuts.

Because of org-mode's power, it would be time well spent if you learned at least the basics of how to use the main parts of this package. Org-mode has a markup syntax of its own, and scimax adds a layer of shortcuts that make it easier to write.

Along with the regular org-mode markup syntax, scimax makes it easier to include LaTeX sections for more advanced textual layout. Many people in scientific fields are familiar with LaTeX. For those who aren't, LaTeX is document layout program where you write your text and include layout instructions for the LaTeX engine. The idea is that you separate out the text from the formatting of that text.

If you have graphical images as part of your research, scimax has added some extra functionality to make image rescaling and presentation better than the org-mode defaults by using external programs from the imagemagick package.

Because org-mode is designed to be a document structuring package for Emacs, it allows for exporting your text into a great many other formats. Also, since it separates out the formatting from the actual text, it can be applied to many different document structures, such as articles, books or web pages.

Scimax uses the ox-manuscript Emacs package to handle exporting to high-quality document formats. This is useful when you need to produce final versions of your scientific reports or articles in a format like PDF.

Bibliographic references within your document are handled through bibtex entries.

So far, I've covered a quick overview of the document management, organization and formatting tools that are provided through scimax, but Emacs and org-mode have much more functionality. You can interact with the outside world in a few different ways. The first is through email. You can grab selections of your text, or an entire buffer, and issue an org-mime command within Emacs to tell it to send an HTML-based email. Depending on your system, you may need additional configuration in order for this to work as expected.

The other way to interact with the outside world is through Google searches. As someone who writes a fair bit myself, I cannot understate the need for a Google window to be open to be able to verify some fact or statement as I am writing. With scimax, the google-this Emacs package gets installed and is available as you are working. This allows you to fire up Google searches based on either specific text selections or the contents of entire buffers immediately from the document that you are working on.

Along with communicating with the outside world, the other powerful interaction with external tools is through org-mode's ability to run external programs and have their output inserted into sections of your document. This one piece of functionality makes the dream of reproducible research a real possibility. You do need to be diligent and put it into practice, but you no longer have the excuse of saying that it isn't possible. The idea is that, from within your org-mode document, you can define a block of code that makes some calculation or generates some graph. You then can have org-mode fire this block so that it can be run through an external engine and have the results pulled back in and inserted as the displayed text in the original location.

The default engine configured in scimax is Python, which is definitely a good starting point. With more configuration, you can add support for several other languages. The powerful idea here is that you always can go back to the original code that generated some result or some graph and re-create it. More and more scientific journals are demanding this level of reproducibility, so having it as part of your article contents directly means you never will lose track of it.

The last thing I want to cover is how to organize all of the work that scimax is helping you do. The highest level of organization is the ability to set up projects. A project is essentially a directory with all of the associated files for that given project. These projects are handled by the Emacs projectile package. This package allows you to move between projects, find files within projects or do full searches through a given project.

Projectile assumes that these project directories are under some kind of version control system, such as Git. Luckily, scimax includes the magit Emacs package, which adds lots of extra functions that allow you to interact with the Git repository that the current file belongs to directly from Emacs. You can create or clone repositories, stage and commit changes, manage diffs between versions, and even handle pushes to and pulls from remote repositories. Along with the explicit control over a Git repository, scimax includes extensions to org-mode to handle track changes, as well as to insert edit marks within your org-mode document.

Putting all of this organizational work together, scimax provides the ability to create and use scientific notebooks. A series of commands starting with nb- allow you to wrap all of the organizational functionality to create, manage and archive these notebooks. Now, you have no reason not to start documenting all of your scientific research in a reproducible way—except maybe the learning curve. But, as the old saying goes, nothing worth doing is easy, and I think this is definitely worth doing, at least for some people.

Resources

They Said It

The shoe that fits one person pinches another; there is no recipe for living that suits all cases.

—Carl Jung

Courage is the ladder on which all the other virtues mount.

—Clare Booth Luce

The thing women have got to learn is that nobody gives you power. You just take it.

—Roseanne Barr

One man practicing sportsmanship is better than a hundred teaching it.

—Knute Rockne

The man who is swimming against the stream knows the strength of it.

—Woodrow Wilson