Markus’ Linux Tips: Pssh – Parallel SSH execution

Honestly, I never spent much effort in automating my home network. No salt or containers involved, only three machines with desktops around. ATM they all run Open SUSE Tumbleweed, simply because I don’t want to re-install or do OS upgrades anymore and I want to have all the new stuff asap. With SUSE’s build service the quality of that “rolling release” Tumbleweed has become overwhelming to me, hardly do I see a problem that prevents me from working and/or stays longer that a few days.

Downside of that is: I get some hundreds of megabytes of updates each week. Event though I made good experience with auto-updates through YaST, I still sometimes feel better with launching the zypper command myself and watching what happens. So I did what my dear lady called “semiautomatic system management” … :-):

I like to play with shell tools, and that’s how I found pssh. I installed the tiny CLI tool that allows running a command on several machines at the same time, and added it to my local aliases. Are you confused already? Ok, here’s the five steps:

Step 1: Install Pssh, e.g. with “zypper in pssh”.

A quick “man pssh” shows you the options the little tool can offer.

Step 2: Create a local file with the list of hosts that you want to update. It’s content should simply be one host(name) or IP per line, like my ~/.pssh:
office
sleepingroom
livingroom
Step 3: Copy your ssh key to the machines involved (“ssh-copy-id” is your friend) and test the login with ssh.
Step 4 (optional): I prefer to have the output of my commands in a separate “log” folder (under ~/Temp) – and that needs to be created.
Step 5: I added “alias zypdup=”pssh -h .pssh -l root -o ~/Temp/pssh ‘zypper dup -y -l –allow-vendor-change'” to my .bashrc file in my home directory. That way, the simple command “zypdup” will update the three machines at home, giving a yes to all answers, accept all licenses and allow vendor change from Packman/VLC and back to open SUSE repositories. To be precise, that “zypdup” will be recognized the next time the shell loads the aliases (like after a “. .bashrc”.

That’s it. But let’s have another quick look at the command: “pssh -h .pssh -l root -o ~/Temp/pssh ” takes the hosts from the file “.pssh”, logs in as “root” and writes its output to files in “~/Temp/pssh” – one file per host, named like the host.

Thus, in a perfect world, all my three systems are on the same patchlevel / upgrade status:

Disclaimer: I know that options like “-y … –allow-vendor-change” may cause trouble, but after five years of Tumbleweed, Build Service, Snapper and SUSE in general, I’ve become pretty daring – there were no problems so far. Your mileage may vary, though. If you’re unsure about the consequences, better don’t follow me. 🙂

UPDATE: After a few weeks I learned that I need to add “-t 0” (or another reasonable timeout value in seconds) to my alias. Updates with zypper usually take some time, and depend heavily on bandwidth and such, thus I can’t or couldn’t make up a reasonable value (yet). 🙂

Nano Editor Cheat Sheet

… : Nano text editor command cheatsheet | Codexpedia … :

File Control in nano

nano index.php Open or create the file “index.php” with nano on command line.

Ctrl-o Y Enter Save changes.

Ctrl-r Alt-f Open a new file with a new buffer within nano.

Alt-> Switch to the next file buffer in nano.

Alt-< Switch to the previous file buffer in nano.

Ctrl-x Quit nano.

GNU Emacs Cheat Sheet for Beginners

… : Absolute Beginner’s Guide to Emacs – Jessica Hamrick … :

This tutorial is mainly for people who have primarily used GUI text editors and coding environments and are not used to a primarily text-based program, running commands in the editor itself, and/or using large amounts of keyboard shortcuts. For reference, here is the list of shortcuts I’ll be introducing in this tutorial:

$34 billion: IBM buys Red Hat, “investment in hybrid cloud”

IBM acquires Red Hat | ZDNet as reported by my old friend Steven:

In an unexpected report, Bloomberg stated IBM is close to announcing that it will be acquiring Red Hat. The news has been confirmed. IBM is acquiring Red Hat for $190.00 per share in cash. This a total enterprise value of approximately $34 billion.”

“Rometty continued,”Most companies today are only 20 percent along their cloud journey, renting compute power to cut costs. The next 80 percent is about unlocking real business value and driving growth. This is the next chapter of the cloud. It requires shifting business applications to hybrid cloud, extracting more data and optimizing every part of the business, from supply chains to sales.”

… and Jim himself on the Red Hat blog

“We have barely scratched the surface of the opportunity that is ahead of us. Open source is the future of enterprise IT. We believe our total addressable market to be $73 billion by 2021. If software is eating the world – and with digital transformation occurring across industries, it truly is – open source is the key ingredient.

Powered by IBM, we can dramatically scale and accelerate what we are doing today. Imagine Red Hat with greater resources to grow into the opportunity ahead of us. Imagine Red Hat with the ability to invest even more and faster to accelerate open source innovation in emerging areas. Imagine Red Hat reaching all corners of the world, with even deeper customer and partner relationships than we have today. Imagine us helping even more customers benefit from the choice and flexibility afforded by hybrid and multi-cloud. Joining forces with IBM offers all of that, years ahead of when we could have achieved it alone. Together we can become the leading hybrid cloud solutions provider.”

Here’s the full press release by Red Hat … 

Collaborative Editing? Not for Professionals…

Documentation is team work, yes – but can you do it collaboratively? Yes, but not in collaborative editing. Git is your friend, a good workflow needs to be chosen, and then everyone on your team may choose the editor he loves. Etherpad, Google Docs and such are tools for short texts, but not for professional editing. In this article for Linux Magazine Germany I explain how we work at SUSE.

Representing OSBA and SUSE at LPI, Kassel

image

Today I had to get up early (in fact I slept four hours,  one at home, one in the train to Nürnberg,  one to Würzburg, one to Kassel), because I was invited to represent open source lobby group OSBA and my employer SUSE at certification Institute LPI. In their board meeting with LPI members interesting news was disclosed. Read it soon in Linux-Magazin.