How to use parallel ssh (PSSH) for executing ssh in parallel on a number of Linux/Unix/BSD servers

Posted on in Categories Cloud Computing, Command Line Hacks, Howto last updated April 21, 2017

Recently I come across a nice little nifty tool called pssh to run a single command on multiple Linux / UNIX / BSD servers. You can easily increase your productivy with this SSH tool.

More about pssh

pssh is a command line tool for executing ssh in parallel on some hosts. It provides specialties includes:

  1. Sending input to all of the processes
  2. Inputting a password to ssh
  3. Saving output to files
  4. IT/sysadmin taks automation such as patching servers
  5. Timing out and more

Let us see how to install and use pssh on Linux and Unix-like system.

pssh-welcome

How to protects Linux and Unix machines from accidental shutdowns/reboots with molly-guard

Posted on in Categories Command Line Hacks, Debian Linux, Hardware last updated February 19, 2017

Oops! I did it again. I thought I was logged into my home server. Turns out I rebooted the db server. Another my not so favorite is typing “shutdown -h 0” into the wrong terminal. I know a few people who have admitted to doing that here.

My anger that can't be contained
Is there any end to the madness? Do I need to suffer from accidentally random reboots and shutdowns? After all, it is human nature to make mistakes, but one should not keep on making the same mistakes again and again.

15 Useful Linux and Unix Tape Managements Commands For Sysadmins

Posted on in Categories Command Line Hacks, Hardware, Howto, Storage last updated March 28, 2016

Tape devices should be used on a regular basis only for archiving files or for transferring data from one server to another. Usually, tape devices are all hooked up to Unix boxes, and controlled with mt or mtx. In this tutorial you will learn about:

  • Tape device names
  • Basic commands to manage tape drive
  • Basic backup and restore commands

Linux Server See the Historical and Statistical Uptime of System With tuptime Utility

Posted on in Categories Command Line Hacks, Hardware last updated September 6, 2015

You can use the following tools to see how long system has been running on a Linux or Unix-like system:

  • uptime : Tell how long the server has been running.
  • lastt : Show the reboot and shutdown time.
  • tuptime : Report the historical and statistical running time of system, keeping it between restarts. Like uptime command but with more interesting output.

Collecting Ubuntu Linux System Information

Posted on in Categories Command Line Hacks, Hardware, Howto last updated September 2, 2015

For new computer or Laptop or server, I need to collect the information about its hardware. This is also useful when you need to replace a disk or memory with a vendor. In order to replace hardware you need all information in advance. In this post, I’m going to list commands that you can use to collect the hardware information.
Ubuntu Linux Server Collecting System Information

Learning bash scripting for beginners

Posted on in Categories Command Line Hacks, Howto, Open Source last updated January 6, 2017

Bash (Bourne-Again SHell) is a Linux and Unix-like system shell or command language interpreter. It is a default shell on many operating systems including Linux and Apple MacOS X. Shell scripts are a fundamental part of the Unix programming environment.

If you have always used a graphic user interface like KDE or Gnome or MS-Windows or Apple OS X, you are likely to find bash shell confusing. If you spend some time with the bash shell prompt and it will be difficult for you to go back.

Learn bash

Here are a list of tutorials and helpful resources to help you learn bash scripting and bash shell itself. You should read the following documents if you are interested in learning the basics of shell scripting.

A Shell Primer: Master Your Linux, OS X, Unix Shell Environment

Posted on in Categories Command Line Hacks, Howto last updated November 9, 2016

On a Linux or Unix-like systems each user and process runs in a specific environment. An environment includes variables, settings, aliases, functions and more. Following is a very brief introduction to some useful shell environment commands, including examples of how to use each command and setup your own environment to increase productivity in the command prompt.