Posted on Leave a comment

An Introduction to the Machine Learning Platform as a Service

Machine-Learning-Platform-as-a-Service (ML PaaS) is one of the fastest growing services in the public cloud. It delivers efficient lifecycle management of machine learning models.

At a high level, there are three phases involved in training and deploying a machine learning model. These phases remain the same from classic ML models to advanced models built using sophisticated neural network architecture.

Provision and Configure Environment

Before the actual training takes place, developers and data scientists need a fully configured environment with the right hardware and software configuration.

Read more at The New Stack

Click Here!

Posted on Leave a comment

Linux Tools: The Meaning of Dot

Let’s face it: writing one-liners and scripts using shell commands can be confusing. Many of the names of the tools at your disposal are far from obvious in terms of what they do (grep, tee and awk, anyone?) and, when you combine two or more, the resulting “sentence” looks like some kind of alien gobbledygook.

None of the above is helped by the fact that many of the symbols you use to build a chain of instructions can mean different things depending on their context.

Location, location, location

Take the humble dot (.) for example. Used with instructions that are expecting the name of a directory, it means “this directory” so this:

find . -name "*.jpg"

translates to “find in this directory (and all its subdirectories) files that have names that end in .jpg“.

Both ls . and cd . act as expected, so they list and “change” to the current directory, respectively, although including the dot in these two cases is not necessary.

Two dots, one after the other, in the same context (i.e., when your instruction is expecting a directory path) means “the directory immediately above the current one“. If you are in /home/your_directory and run

cd ..

you will be taken to /home. So, you may think this still kind of fits into the “dots represent nearby directories” narrative and is not complicated at all, right?

How about this, then? If you use a dot at the beginning of a directory or file, it means the directory or file will be hidden:

$ touch somedir/file01.txt somedir/file02.txt somedir/.secretfile.txt
$ ls -l somedir/
total 0 -rw-r--r-- 1 paul paul 0 Jan 13 19:57 file01.txt -rw-r--r-- 1 paul paul 0 Jan 13 19:57 file02.txt $ # Note how there is no .secretfile.txt in the listing above
$ ls -la somedir/
total 8 drwxr-xr-x 2 paul paul 4096 Jan 13 19:57 . drwx------ 48 paul paul 4096 Jan 13 19:57 .. -rw-r--r-- 1 paul paul 0 Jan 13 19:57 file01.txt -rw-r--r-- 1 paul paul 0 Jan 13 19:57 file02.txt -rw-r--r-- 1 paul paul 0 Jan 13 19:57 .secretfile.txt
$ # The -a option tells ls to show "all" files, including the hidden ones

And then there’s when you use . as a command. Yep! You heard me: . is a full-fledged command. It is a synonym of source and you use that to execute a file in the current shell, as opposed to running a script some other way (which usually mean Bash will spawn a new shell in which to run it).

Confused? Don’t worry — try this: Create a script called myscript that contains the line

myvar="Hello"

and execute it the regular way, that is, with sh myscript (or by making the script executable with chmod a+x myscript and then running ./myscript). Now try and see the contents of myvar with echo $myvar (spoiler: You will get nothing). This is because, when your script plunks “Hello” into myvar, it does so in a separate bash shell instance. When the script ends, the spawned instance disappears and control returns to the original shell, where myvar never even existed.

However, if you run myscript like this:

. myscript

echo $myvar will print Hello to the command line.

You will often use the . (or source) command after making changes to your .bashrc file, like when you need to expand your PATH variable. You use . to make the changes available immediately in your current shell instance.

Double Trouble

Just like the seemingly insignificant single dot has more than one meaning, so has the double dot. Apart from pointing to the parent of the current directory, the double dot (..) is also used to build sequences.

Try this:

echo {1..10}

It will print out the list of numbers from 1 to 10. In this context, .. means “starting with the value on my left, count up to the value on my right“.

Now try this:

echo {1..10..2}

You’ll get 1 3 5 7 9. The ..2 part of the command tells Bash to print the sequence, but not one by one, but two by two. In other words, you’ll get all the odd numbers from 1 to 10.

It works backwards, too:

echo {10..1..2}

You can also pad your numbers with 0s. Doing:

echo {000..121..2}

will print out every even number from 0 to 121 like this:

000 002 004 006 ... 050 052 054 ... 116 118 120 

But how is this sequence-generating construct useful? Well, suppose one of your New Year’s resolutions is to be more careful with your accounts. As part of that, you want to create directories in which to classify your digital invoices of the last 10 years:

mkdir {2009..2019}_Invoices

Job done.

Or maybe you have a hundreds of numbered files, say, frames extracted from a video clip, and, for whatever reason, you want to remove only every third frame between the frames 43 and 61:

rm frame_{043..61..3}

It is likely that, if you have more than 100 frames, they will be named with padded 0s and look like this:

frame_000 frame_001 frame_002 ...

That’s why you will use 043 in your command instead of just 43.

Curly~Wurly

Truth be told, the magic of sequences lies not so much in the double dot as in the sorcery of the curly braces ({}). Look how it works for letters, too. Doing:

touch file_{a..z}.txt

creates the files file_a.txt through file_z.txt.

You must be careful, however. Using a sequence like {Z..a} will run through a bunch of non-alphanumeric characters (glyphs that are neither numbers or letters) that live between the uppercase alphabet and the lowercase one. Some of these glyphs are unprintable or have a special meaning of their own. Using them to generate names of files could lead to a whole bevy of unexpected and potentially unpleasant effects.

One final thing worth pointing out about sequences encased between {...} is that they can also contain lists of strings:

touch {blahg, splurg, mmmf}_file.txt

Creates blahg_file.txt, splurg_file.txt and mmmf_file.txt.

Of course, in other contexts, the curly braces have different meanings (surprise!). But that is the stuff of another article.

Conclusion

Bash and the utilities you can run within it have been shaped over decades by system administrators looking for ways to solve very particular problems. To say that sysadmins and their ways are their own breed of special would be an understatement. Consequently, as opposed to other languages, Bash was not designed to be user-friendly, easy or even logical.

That doesn’t mean it is not powerful — quite the contrary. Bash’s grammar and shell tools may be inconsistent and sprawling, but they also provide a dizzying range of ways to do everything you can possibly imagine. It is like having a toolbox where you can find everything from a power drill to a spoon, as well as a rubber duck, a roll of duct tape, and some nail clippers.

Apart from fascinating, it is also fun to discover all you can achieve directly from within the shell, so next time we will delve ever deeper into how you can build bigger and better Bash command lines.

Until then, have fun!

Posted on Leave a comment

Key Resources for Effective, Professional Open Source Management

At organizations everywhere, managing the use of open source software well requires the participation of business executives, the legal team, software architecture, software development and maintenance staff and product managers. One of the most significant challenges is integrating all of these functions with their very different points of view into a coherent and efficient set of practices.

More than ever, it makes sense to investigate the many free and inexpensive resources for open source management that are available, and observe the practices of professional open source offices that have been launched within companies ranging from Microsoft to Oath to Red Hat.

Fundamentals

The Linux Foundation’s Fundamentals of Professional Open Source Management (LFC210) course is a good place to start. The course is explicitly designed to help individuals in disparate organizational roles understand the best practices for success.

The course is organized around the key phases of developing a professional open source management program:

  • Open Source Software and Open Source Management Basics
  • Open Source Management Strategy
  • Open Source Policy
  • Open Source Processes
  • Open Source Management Program Implementation

Best Practices

The Linux Foundation also offers a free ebook on open source management: Enterprise Open Source: A Practical Introduction. The 45-page ebook can teach you how to accelerate your company’s open source efforts, based on the experience of hundreds of companies spanning more than two decades of professional enterprise open source management. The ebook covers:

  • Why use open source
  • Various open source business models
  • How to develop your own open source strategy
  • Important open source workflow practices
  • Tools and integration

Official open source programs play an increasingly significant role in how DevOps and open source best practices are adopted by organizations, according to a survey conducted by The New Stack and The Linux Foundation (via the TODO Group). More than half of respondents to the survey (53 percent) across many industries said their organization has an open source software program or has plans to establish one.

“More than anything, open source programs are responsible for fostering open source culture,” the survey’s authors have reported. “By creating an open source culture, companies with open source programs see the benefits we’ve previously reported, including increased speed and agility in the development cycle, better license compliance and more awareness of which open source projects a company’s products depend on.”

Free Guides

How can your organization professionally create and manage a successful open source program, with proper policies and a strong organizational structure? The Linux Foundation offers a complete guide to the process, available here for free. The guide covers an array of topics for open source offices including: roles and responsibilities, corporate structures, elements of an open source management program, how to choose and hire an open source program manager, and more.

The free guide also features contributions from open source leaders. “The open source program office is an essential part of any modern company with a reasonably ambitious plan to influence various sectors of software ecosystems,” notes John Mark Walker, Founder of the Open Source Entrepreneur Network (OSEN) in the guide. “If a company wants to increase its influence, clarify its open source messaging, maximize the clout of its projects, or increase the efficiency of its product development, a multifaceted approach to open source programs is essential.”  

Interested in even more on professional open source management? Don’t miss The Linux Foundation’s other free guides, which delve into tools for open source management, how to measure the success of an open source program, and much more.

This article originally appeared at The Linux Foundation

Posted on Leave a comment

Top 5 Linux Distributions for Productivity

I have to confess, this particular topic is a tough one to address. Why? First off, Linux is a productive operating system by design. Thanks to an incredibly reliable and stable platform, getting work done is easy. Second, to gauge effectiveness, you have to consider what type of work you need a productivity boost for. General office work? Development? School? Data mining? Human resources? You see how this question can get somewhat complicated.

That doesn’t mean, however, that some distributions aren’t able to do a better job of configuring and presenting that underlying operating system into an efficient platform for getting work done. Quite the contrary. Some distributions do a much better job of “getting out of the way,” so you don’t find yourself in a work-related hole, having to dig yourself out and catch up before the end of day. These distributions help strip away the complexity that can be found in Linux, thereby making your workflow painless.

Let’s take a look at the distros I consider to be your best bet for productivity. To help make sense of this, I’ve divided them into categories of productivity. That task itself was challenging, because everyone’s productivity varies. For the purposes of this list, however, I’ll look at:

  • General Productivity: For those who just need to work efficiently on multiple tasks.

  • Graphic Design: For those that work with the creation and manipulation of graphic images.

  • Development: For those who use their Linux desktops for programming.

  • Administration: For those who need a distribution to facilitate their system administration tasks.

  • Education: For those who need a desktop distribution to make them more productive in an educational environment.

Yes, there are more categories to be had, many of which can get very niche-y, but these five should fill most of your needs.

General Productivity

For general productivity, you won’t get much more efficient than Ubuntu. The primary reason for choosing Ubuntu for this category is the seamless integration of apps, services, and desktop. You might be wondering why I didn’t choose Linux Mint for this category? Because Ubuntu now defaults to the GNOME desktop, it gains the added advantage of GNOME Extensions (Figure 1).

These extensions go a very long way to aid in boosting productivity (so Ubuntu gets the nod over Mint). But Ubuntu didn’t just accept a vanilla GNOME desktop. Instead, they tweaked it to make it slightly more efficient and user-friendly, out of the box. And because Ubuntu contains just the right mixture of default, out-of-the-box, apps (that just work), it makes for a nearly perfect platform for productivity.

Whether you need to write a paper, work on a spreadsheet, code a new app, work on your company website, create marketing images, administer a server or network, or manage human resources from within your company HR tool, Ubuntu has you covered. The Ubuntu desktop distribution also doesn’t require the user to jump through many hoops to get things working … it simply works (and quite well). Finally, thanks to it’s Debian base, Ubuntu makes installing third-party apps incredibly easy.

Although Ubuntu tends to be the go-to for nearly every list of “top distributions for X,” it’s very hard to argue against this particular distribution topping the list of general productivity distributions.

Graphic Design

If you’re looking to up your graphic design productivity, you can’t go wrong with Fedora Design Suite. This Fedora respin was created by the team responsible for all Fedora-related art work. Although the default selection of apps isn’t a massive collection of tools, those it does include are geared specifically for the creation and manipulation of images.

With apps like GIMP, Inkscape, Darktable, Krita, Entangle, Blender, Pitivi, Scribus, and more (Figure 2), you’ll find everything you need to get your image editing jobs done and done well. But Fedora Design Suite doesn’t end there. This desktop platform also includes a bevy of tutorials that cover countless subjects for many of the installed applications. For anyone trying to be as productive as possible, this is some seriously handy information to have at the ready. I will say, however, the tutorial entry in the GNOME Favorites is nothing more than a link to this page.

Those that work with a digital camera will certainly appreciate the inclusion of the Entangle app, which allows you to control your DSLR from the desktop.

Development

Nearly all Linux distributions are great platforms for programmers. However, one particular distributions stands out, above the rest, as one of the most productive tools you’ll find for the task. That OS comes from System76 and it’s called Pop!_OS. Pop!_OS is tailored specifically for creators, but not of the artistic type. Instead, Pop!_OS is geared toward creators who specialize in developing, programming, and making. If you need an environment that is not only perfected suited for your development work, but includes a desktop that’s sure to get out of your way, you won’t find a better option than Pop!_OS (Figure 3).

What might surprise you (given how “young” this operating system is), is that Pop!_OS is also one of the single most stable GNOME-based platforms you’ll ever use. This means Pop!_OS isn’t just for creators and makers, but anyone looking for a solid operating system. One thing that many users will greatly appreciate with Pop!_OS, is that you can download an ISO specifically for your video hardware. If you have Intel hardware, download the version for Intel/AMD. If your graphics card is NVIDIA, download that specific release. Either way, you are sure go get a solid platform for which to create your masterpiece.

Interestingly enough, with Pop!_OS, you won’t find much in the way of pre-installed development tools. You won’t find an included IDE, or many other dev tools. You can, however, find all the development tools you need in the Pop Shop.

Administration

If you’re looking to find one of the most productive distributions for admin tasks, look no further than Debian. Why? Because Debian is not only incredibly reliable, it’s one of those distributions that gets out of your way better than most others. Debian is the perfect combination of ease of use and unlimited possibility. On top of which, because this is the distribution for which so many others are based, you can bet if there’s an admin tool you need for a task, it’s available for Debian. Of course, we’re talking about general admin tasks, which means most of the time you’ll be using a terminal window to SSH into your servers (Figure 4) or a browser to work with web-based GUI tools on your network. Why bother making use of a desktop that’s going to add layers of complexity (such as SELinux in Fedora, or YaST in openSUSE)?  Instead, chose simplicity.

And because you can select which desktop you want (from GNOME, Xfce, KDE, Cinnamon, MATE, LXDE), you can be sure to have the interface that best matches your work habits.

Education

If you are a teacher or student, or otherwise involved in education, you need the right tools to be productive. Once upon a time, there existed the likes of Edubuntu. That distribution never failed to be listed in the top of education-related lists. However, that distro hasn’t been updated since it was based on Ubuntu 14.04. Fortunately, there’s a new education-based distribution ready to take that title, based on openSUSE. This spin is called openSUSE:Education-Li-f-e (Linux For Education – Figure 5), and is based on openSUSE Leap 42.1 (so it is slightly out of date).

openSUSE:Education-Li-f-e includes tools like:

  • Brain Workshop – A dual n-back brain exercise

  • GCompris – An educational software suite for young children

  • gElemental – A periodic table viewer

  • iGNUit – A general purpose flash card program

  • Little Wizard – Development environment for children based on Pascal

  • Stellarium – An astronomical sky simulator

  • TuxMath – An math tutor game

  • TuxPaint – A drawing program for young children

  • TuxType – An educational typing tutor for children

  • wxMaxima – A cross platform GUI for the computer algebra system

  • Inkscape – Vector graphics program

  • GIMP – Graphic image manipulation program

  • Pencil – GUI prototyping tool

  • Hugin – Panorama photo stitching and HDR merging program

Also included with openSUSE:Education-Li-f-e is the KIWI-LTSP Server. The KIWI-LTSP Server is a flexible, cost effective solution aimed at empowering schools, businesses, and organizations all over the world to easily install and deploy desktop workstations. Although this might not directly aid the student to be more productive, it certainly enables educational institutions be more productive in deploying desktops for students to use. For more information on setting up KIWI-LTSP, check out the openSUSE KIWI-LTSP quick start guide.

Learn more about Linux through the free “Introduction to Linux” course from The Linux Foundation and edX.

Posted on Leave a comment

Hyundai Joins AGL and Other Automotive News from CES

This week’s Consumer Electronics Show (CES) in Las Vegas has been even more dominated by automotive news than last year, with scores of announcements of new in-vehicle development platforms, automotive 5G services, self-driving concept cars, automotive cockpit UIs, assisted driving systems, and a host of electric vehicles. We’ve also seen numerous systems that provide Google Assistant or Alexa-driven in-vehicle interfaces such as Anker’s Google Assistant based Roav Bolt.

Here we take a brief look at some of the major development-focused CES automotive announcements to date. The mostly Linux-focused developments range from Hyundai joining the Automotive Grade Linux project to major self-driving or assisted ADAS platforms from Baidu, Intel, and Nvidia.

Hyundai jumps on AGL bandwagon

Just prior to the launch of CES, the Linux Foundation’s Automotive Grade Linux (AGL) project announced that South Korean automotive giant Hyundai has joined the group as a Bronze member. The news follows last month’s addition of BearingPoint, BedRock Systems, Big Lake Software, Cognomotiv, and Dellfer to the AGL project. In October, AGL announced seven other new members, including its first Chinese car manufacturer — Sitech Electric Automotive. 

Hyundai’s membership does not commit it to using the group’s Unified Code Base (UCB) reference distribution for automotive in-vehicle infotainment, but it’s another example of the growing support for the open source, Linux-based IVI stack. Several major carmakers are members, including Honda, Mazda, Mitsubishi Electric, and Suzuki, yet Toyota is the only AGL automotive manufacturer to ship IVI systems based on UCB in most of its major models, from the Camry to its Lexus luxury cars. In June, AGL announced that Mercedes-Benz Vans was using UCB for upcoming vans, and we can expect more AGL commitments in 2019.

At the Westgate Hotel Pavilion (booth 1614) in Las Vegas this week, AGL is showing off a 2019 Toyota RAV4 equipped with AGL systems, and AGL members are offering demonstrations of AGL-based connected car services, audio innovations, instrument cluster, and security solutions.

Baidu releases open source Apollo 3.5 self-driving software

AGL is not the only automotive project offering an open source solution. For the past year, Chinese search and cloud giant Baidu has been developing its Linux-driven Apollo stack for self-driving cars. At CES, it announced Apollo 3.5, with new support for “complex urban and suburban driving scenarios.” A hardware platform is available with an Intel Core based Neousys industrial computer equipped with an Nvidia graphics card, among other components including Baidu’s own sensor fusion unit.

Baidu also announced an Apollo Enterprise platform built on top of Apollo designed for autonomous fleet operations. In addition, it revealed an open source OpenEdge cloud-enabled edge computing platform with development boards based on NXP and Intel technologies. The latter is designed for in-car video analytics and incorporates Intel’s Mobileye technology. Details were sketchy, however.

Intel AV

At CES, Intel unveiled an Intel AV compute platform aimed at autonomous cars. It features a pair of Mobileye EyeQ5 sensor processing chips and a new Intel Atom 3xx4 CPU.

The Intel AV system provides 60 percent greater performance at the same 30W consumption as Nvidia’s automotive focused Jetson Xavier processor, claims Intel, The Mobileye EyeQ5 processors are each claimed to generate 24 trillion deep learning operations per second (TOPS) at 10W each. Volkswagen and Nissan have announced plans to use the earlier EyeQ4 processors when it launches later this year. The new EyeQ5 chips are due in 2020.

The Atom 3xx4 chip, meanwhile, borrows high-end multi-threading and virtualization technologies from Intel’s Xeon processors for running different tasks simultaneously on different systems around the car. We saw no mention of OS support, but we would be surprised if Linux was not supported.

Nvidia Drive Autopilot

Intel is playing catchup with Nvidia in the autonomous vehicle computer contest. In recent years, Nvidia has increasingly focused on the automotive business, launching one of the first independent self-driving car computers with its Drive PX Pegasus based on its newly shipping, octa-core Arm-based Jetson AGX Xavier module. At CES, it followed up with a Xavier-based Nvidia Drive Autopilot system.

Unlike the fully autonomous, “Level 5” Drive PX Pegasus, the Drive Autopilot is designed for Level 2 assisted ADAS systems. Due to ship in vehicles in 2020, the system features a claimed 30 TOPS AI performance and provides “complete surround camera sensor data from outside the vehicle and inside the cabin.”
Drive Autopilot integrates a new Drive IX software stack that can map and memorize typical routes to improve performance in the future. It also provides driverless highway merge, lane change, lane splits, and as well as driver monitoring and AI copilot capabilities. We saw no OS details, but presumably Drive Autopilot runs the Tegra4Linux stack used on other Xavier based systems.

Posted on Leave a comment

Industry-Scale Collaboration at The Linux Foundation

Linux and open source have changed the computer industry (among many others) forever.  Today, there are tens of millions of open source projects. A valid question is “Why?” How can it possibly make sense to hire developers that work on code that is given away for free to anyone who cares to take it?  I know of many answers to this question, but for the communities that I work in, I’ve come to recognize the following as the common thread.

An Industry Pivot

Software has become the most important component in many industries, and it is needed in very large quantities. When an entire industry needs to make a technology “pivot,” they often do as much of that as possible in software. For example, the telecommunications industry must make such a pivot in order to support 5G, the next generation of mobile phone network.  Not only will the bandwidth and throughput be increased with 5G, but an entirely new set of services will be enabled, including autonomous cars, billions of Internet-connected sensors and other devices (aka IoT), etc.  To do that, telecom operators need to entirely redo their networks distributing millions of compute and storage instances very, very close to those devices/users.

Read more at The Linux Foundation

Posted on Leave a comment

Migrating to Linux: Network and System Settings

Learn how to transition to Linux in this tutorial series from our archives.

In this series, we provide an overview of fundamentals to help you successfully make the transition to Linux from another operating system. If you missed the earlier articles in the series, you can find them here:

Part 1 – An Introduction

Part 2 – Disks, Files, and Filesystems

Part 3 – Graphical Environments

Part 4 – The Command Line

Part 5 – Using sudo

Part 6 – Installing Software

Linux gives you a lot of control over network and system settings. On your desktop, Linux lets you tweak just about anything on the system. Most of these settings are exposed in plain text files under the /etc directory. Here I describe some of the most common settings you’ll use on your desktop Linux system.

A lot of settings can be found in the Settings program, and the available options will vary by Linux distribution. Usually, you can change the background, tweak sound volume, connect to printers, set up displays, and more. While I won’t talk about all of the settings here, you can certainly explore what’s in there.

Connect to the Internet

Connecting to the Internet in Linux is often fairly straightforward. If you are wired through an Ethernet cable, Linux will usually get an IP address and connect automatically when the cable is plugged in or at startup if the cable is already connected.

If you are using wireless, in most distributions there is a menu, either in the indicator panel or in settings (depending on your distribution), where you can select the SSID for your wireless network. If the network is password protected, it will usually prompt you for the password. Afterward, it connects, and the process is fairly smooth.

You can adjust network settings in the graphical environment by going into settings. Sometimes this is called System Settings or just Settings. Often you can easily spot the settings program because its icon is a gear or a picture of tools (Figure 1).

Network Interface Names

Under Linux, network devices have names. Historically, these are given names like eth0 and wlan0 — or Ethernet and wireless, respectively. Newer Linux systems have been using different names that appear more esoteric, like enp4s0 and wlp5s0. If the name starts with en, it’s a wired Ethernet interface. If it starts with wl, it’s a wireless interface. The rest of the letters and numbers reflect how the device is connected to hardware.

Network Management from the Command Line

If you want more control over your network settings, or if you are managing network connections without a graphical desktop, you can also manage the network from the command line.

Note that the most common service used to manage networks in a graphical desktop is the Network Manager, and Network Manager will often override setting changes made on the command line. If you are using the Network Manager, it’s best to change your settings in its interface so it doesn’t undo the changes you make from the command line or someplace else.

Changing settings in the graphical environment is very likely to be interacting with the Network Manager, and you can also change Network Manager settings from the command line using the tool called nmtui. The nmtui tool provides all the settings that you find in the graphical environment but gives it in a text-based semi-graphical interface that works on the command line (Figure 2).

On the command line, there is an older tool called ifconfig to manage networks and a newer one called ip. On some distributions, ifconfig is considered to be deprecated and is not even installed by default. On other distributions, ifconfig is still in use.

Here are some commands that will allow you to display and change network settings:

Process and System Information

In Windows, you can go into the Task Manager to see a list of the all the programs and services that are running. You can also stop programs from running. And you can view system performance in some of the tabs displayed there.

You can do similar things in Linux both from the command line and from graphical tools. In Linux, there are a few graphical tools available depending on your distribution. The most common ones are System Monitor or KSysGuard. In these tools, you can see system performance, see a list of processes, and even kill processes (Figure 3).

In these tools, you can also view global network traffic on your system (Figure 4).

Managing Process and System Usage

There are also quite a few tools you can use from the command line. The command ps can be used to list processes on your system. By default, it will list processes running in your current terminal session. But you can list other processes by giving it various command line options. You can get more help on ps with the commands info ps, or man ps.

Most folks though want to get a list of processes because they would like to stop the one that is using up too much memory or CPU time. In this case, there are two commands that make this task much easier. These are top and htop (Figure 5).

The top and htop tools work very similarly to each other. These commands update their list every second or two and re-sort the list so that the task using the most CPU is at the top. You can also change the sorting to sort by other resources as well such as memory usage.

In either of these programs (top and htop), you can type ‘?’ to get help, and ‘q’ to quit. With top, you can press ‘k’ to kill a process and then type in the unique PID number for the process to kill it.

With htop, you can highlight a task by pressing down arrow or up arrow to move the highlight bar, and then press F9 to kill the task followed by Enter to confirm.

The information and tools provided in this series will help you get started with Linux. With a little time and patience, you’ll feel right at home.

Learn more about Linux through the free “Introduction to Linux” course from The Linux Foundation and edX.

Posted on Leave a comment

Aliases: To Protect and Serve

Happy 2019! Here in the new year, we’re continuing our series on aliases. By now, you’ve probably read our first article on aliases, and it should be quite clear how they are the easiest way to save yourself a lot of trouble. You already saw, for example, that they helped with muscle-memory, but let’s see several other cases in which aliases come in handy.

Aliases as Shortcuts

One of the most beautiful things about Linux’s shells is how you can use zillions of options and chain commands together to carry out really sophisticated operations in one fell swoop. All right, maybe beauty is in the eye of the beholder, but let’s agree that this feature *is* practical.

The downside is that you often come up with recipes that are often hard to remember or cumbersome to type. Say space on your hard disk is at a premium and you want to do some New Year’s cleaning. Your first step may be to look for stuff to get rid off in you home directory. One criteria you could apply is to look for stuff you don’t use anymore. ls can help with that:

ls -lct

The instruction above shows the details of each file and directory (-l) and also shows when each item was last accessed (-c). It then orders the list from most recently accessed to least recently accessed (-t).

Is this hard to remember? You probably don’t use the -c and -t options every day, so perhaps. In any case, defining an alias like

alias lt='ls -lct'

will make it easier.

Then again, you may want to have the list show the oldest files first:

alias lo='lt -F | tac'

There are a few interesting things going here. First, we are using an alias (lt) to create another alias — which is perfectly okay. Second, we are passing a new parameter to lt (which, in turn gets passed to ls through the definition of the lt alias).

The -F option appends special symbols to the names of items to better differentiate regular files (that get no symbol) from executable files (that get an *), files from directories (end in /), and all of the above from links, symbolic and otherwise (that end in an @ symbol). The -F option is throwback to the days when terminals where monochrome and there was no other way to easily see the difference between items. You use it here because, when you pipe the output from lt through to tac you lose the colors from ls.

The third thing to pay attention to is the use of piping. Piping happens when you pass the output from an instruction to another instruction. The second instruction can then use that output as its own input. In many shells (including Bash), you pipe something using the pipe symbol (|).

In this case, you are piping the output from lt -F into tac. tac‘s name is a bit of a joke. You may have heard of cat, the instruction that was nominally created to concatenate files together, but that in practice is used to print out the contents of a file to the terminal. tac does the same, but prints out the contents it receives in reverse order. Get it? cat and tac. Developers, you so funny!

The thing is both cat and tac can also print out stuff piped over from another instruction, in this case, a list of files ordered chronologically.

So… after that digression, what comes out of the other end is the list of files and directories of the current directory in inverse order of freshness.

The final thing you have to bear in mind is that, while lt will work the current directory and any other directory…

# This will work:
lt
# And so will this:
lt /some/other/directory

lo will only work with the current directory:

# This will work:
lo
# But this won't:
lo /some/other/directory

This is because Bash expands aliases into their components. When you type this:

lt /some/other/directory

Bash REALLY runs this:

ls -lct /some/other/directory

which is a valid Bash command.

However, if you type this:

lo /some/other/directory

Bash tries to run this:

ls -lct -F | tac /some/other/directory

which is not a valid instruction, because tac mainly because /some/other/directory is a directory, and cat and tac don’t do directories.

More Alias Shortcuts

  • alias lll='ls -R' prints out the contents of a directory and then drills down and prints out the contents of its subdirectories and the subdirectories of the subdirectories, and so on and so forth. It is a way of seeing everything you have under a directory.
  • mkdir='mkdir -pv' let’s you make directories within directories all in one go. With the base form of mkdir, to make a new directory containing a subdirectory you have to do this:
    mkdir newdir
    mkdir newdir/subdir
    

    Or this:

    mkdir -p newdir/subdir
    

    while with the alias you would only have to do this:

    mkdir newdir/subdir
    

    Your new mkdir will also tell you what it is doing while is creating new directories.

Aliases as Safeguards

The other thing aliases are good for is as safeguards against erasing or overwriting your files accidentally. At this stage you have probably heard the legendary story about the new Linux user who ran:

rm -rf /

as root, and nuked the whole system. Then there’s the user who decided that:

rm -rf /some/directory/ *

was a good idea and erased the complete contents of their home directory. Notice how easy it is to overlook that space separating the directory path and the *.

Both things can be avoided with the alias rm='rm -i' alias. The -i option makes rm ask the user whether that is what they really want to do and gives you a second chance before wreaking havoc in your file system.

The same goes for cp, which can overwrite a file without telling you anything. Create an alias like alias cp='cp -i' and stay safe!

Next Time

We are moving more and more into scripting territory. Next time, we’ll take the next logical step and see how combining instructions on the command line gives you really interesting and sophisticated solutions to everyday admin problems.

Posted on Leave a comment

Kubernetes Federation Evolution

Deploying applications to a kubernetes cluster is well defined and can in some cases be as simple as kubectl create -f app.yaml. The user’s story to deploy apps across multiple clusters has not been that simple. How should an app workload be distributed? Should the app resources be replicated into all clusters, or replicated into selected clusters or partitioned into clusters? How is the access to clusters managed? What happens if some of the resources, which user wants to distribute pre-exist in all or fewer clusters in some form.

In SIG multicluster, our journey has revealed that there are multiple possible models to solve these problems and there probably is no single best fit all scenario solution. Federation however is the single biggest kubernetes open source sub project which has seen maximum interest and contribution from the community in this problem space. The project initially reused the k8s API to do away with any added usage complexity for an existing k8s user. This became non-viable because of problems best discussed in this community update.

What has evolved further is a federation specific API architecture and a community effort which now continues as Federation V2.

Conceptual Overview

Because federation attempts to address a complex set of problems, it pays to break the different parts of those problems down. Let’s take a look at the different high-level areas involved:

Kubernetes Federation V2 Concepts

Read more at Kubernetes

Click Here!

Posted on Leave a comment

7 Things Desktop Linux Needs in 2019

The new year is upon us, which means yet another year has gone by in which Linux has not found itself dominating the desktop. Linux does many things very well, and in the coming weeks, we’ll be looking at the some of the very best distributions to suit your various needs, but for now, let’s take a step back and revisit this old issue.

For some, the idea of Linux dominance on the desktop has fallen to the wayside; instead, users simply want what works. The Linux operating system, however, does “just work.” And when you stop to realize that the typical user spends the vast majority of their time working (or playing) within a browser, it stands to reason that Linux (with its heightened security and reliability) is primed to become the dominant platform on the desktop market.

And yet it hasn’t. Why?

That’s the question that has confounded so many people for so many years. And, the possible answer five years ago would have been completely different from the answer today. To that end, I’ve come up with seven things that could help Linux gain traction on the desktop space. My suggestions are not necessarily easy or popular. No. What you’ll find here are seven ideas that could seriously help Linux stake its claim as a dominant player on the desktop market.

One Distro to Rule them All

I’ve been saying this for some time, but it’s not quite what you think it is. The distribution fragmentation within the Linux community is doing more harm than good. Consider this: Company X has a piece of software that already runs on Windows and Mac OS, and it’s incredibly popular. When asked to make their software available for Linux, the company says, “We’d love to do that, but it’s just too complicated.” When pressed further, it becomes clear that Company X refuses because there are so many permutations of Linux to consider. Which distribution? Which package manager? Which desktop? Which toolkit? The list goes on.

Because of this, I believe Linux needs to come up with a single “official” distribution — one that all Company X’s can focus their efforts on. Say that official distribution is Debian with the GNOME desktop. All Company X needs to then do is make their software run on that combination. If you, as a user, want to run the software from Company X on Linux, you know you’d have to do so on the official distribution. That doesn’t mean all other distributions go away. Nay, nay. It just means there’s an official distribution that companies can focus their efforts on.

I realize this is not a popular idea, but it’s one that should seriously be considered. Otherwise, Linux will continue to miss out on the likes of Photoshop, Adobe Premier, MS Office, etc.

A Viable X.org Replacement

X.org has served its purpose, but the replacement is long overdue. Canonical tried — and failed — with Mir. Wayland has been under development for quite some time, but it’s not ready for prime time yet. Because X.org has been around for so long, it carries with it a lot of baggage, some of which could be considered a security risk. Think about this: Linux is growing and evolving quite rapidly. How fast can the desktop evolve if it relies on antiquated technology? Instead of continuing to stand on that aging GUI foundation, Linux needs something that can bring much more agility to desktop improvement. Is that solution Wayland, or is there another option available? Who knows. But, Linux software continues to evolve (from the kernel to the user-space apps) at a rapid pace, and the X Window system can no longer keep up. The feasibility of something new coming to fruition and being ready for deployment this year is a pipe dream, but we need to see some solid progress in 2019.

Culling the App Herd

I cannot tell you how many times I’ve opened up a Linux app store and searched for a tool, only to find apps that are no longer being developed, haven’t been updated in a very long time, or have broken or deprecated dependencies. This will not do. Those responsible for the curation of apps in the various app stores need to get rid of the cruft. The last thing Linux needs is out of date, non-functioning, insecure apps for users to install. I realize that one reason many of these apps remain is to keep the numbers high. But saying there are tens of thousands of titles, when a good percentage shouldn’t be there is misleading. Those outdated, deprecated, abandoned apps need to go.

Real-Time Antivirus and Anti-Malware

This is where I might lose some people … but stay with me. I cannot tell you how many times I get asked, “Does Linux need antivirus or antimalware software?” My answer is always, “No, at least not yet.” Why the “not yet”? Because when Linux starts pulling in the numbers that Windows and Mac OS currently enjoy, you can bet the Linux desktop will become a target. But beyond that, what about users who receive email with malicious payloads, who then (unwittingly) send those payloads on to others? Or what about web browser phishing attacks? Linux has tools like ClamAV (and ClamTK), but they don’t do real-time scanning. The Linux community needs to start planning for the future, which means developing a real-time, open source antivirus/anti-malware solution.

Prosumer-Grade Apps

Linux has plenty of apps for the average user. It also has plenty of apps for IT pros. What it doesn’t have is apps for prosumers. For those that don’t know, a prosumer is an amateur who purchases tools that are of professional-grade quality. That’s where the likes of Adobe Premier, Final Cut Pro, Photoshop, Avid Pro Tools, and others come in. Linux doesn’t have the equivalent of any of these. Sure, Linux has an abundance of consumer-grade software (such as Audacity and OpenShot), but those tools are nowhere near prosumer-level. You’re simply not going to be editing a full-length film with OpenShot, or mastering an album with Audacity. Until Linux lands a few serious prosumer-grade tools, it’ll be ignored on that level of usage.

Better Font Rendering

Linux font rendering has come a long way, but it’s still light years behind that of Mac OS. If you use a MacBook Pro or iMac for a while and then come back to Linux, you’ll see the difference. A big part of this has to do with the fact that Linux is still relying upon X.org (see above). And, although this may seem like an afterthought to many, the beauty of a desktop is one of the first things that grabs a user’s attention. If a user looks at a desktop and sees an inferior result, that love affair won’t last long. And, to add injury to that insult, when you stare at a Linux desktop all day, as I do, you may find that poor font rendering can overwork your eyes. Linux needs some serious effort to provide superior font rendering.

More Companies Shipping Quality Products

After visiting System76 (to see the new Thelio factory), I have become convinced the future of the Linux desktop depends on companies like that. System76 is creating a holistic approach to Linux, such that the hardware they ship works seamlessly and beautifully. That’s exactly the experience we need for Linux. Someone who wants to use Linux should be able to purchase a laptop or desktop, connect it to their peripherals, and everything work out of the box… with zero effort. That’s what System76 delivers. Linux needs more companies doing that same thing, with the same level of proficiency. Period.

A Place to Start

Linux doesn’t have to have all seven of these ideas fall into place at once. But if we want to dominate the desktop, this list would be a good place to start. Are there more areas in which Linux can improve? Of course. But let’s begin with the obvious and go from there.