Wednesday, 22 April 2020

Python code to remove blank lines and duplicate whitespaces

This Python program is a simple yet powerful code snippet that removes blank lines and duplicate whitespaces from a given text file. The program reads a file named "filename" and removes any blank lines in the file. It also removes any duplicate whitespaces that may exist in the file. The final result is written back to the same file, overwriting the original contents. This program can be extremely useful for anyone working with text files, especially when it comes to cleaning up the contents of the file for further processing or analysis.

Read more »

Labels: ,

Tuesday, 21 April 2020

Top 10 example of using Vim or VI editor in UNIX and Linux

Vim or VI is a popular text editor used in UNIX and Linux systems. It is a powerful tool that allows users to edit and manipulate text files efficiently. In this article, we will discuss 10 examples of using Vim or VI editor in UNIX and Linux.

1. Opening a file

To open a file in Vim or VI editor, we can use the following command:

vim filename.txt

This command will open the file named filename.txt in Vim or VI editor.

Read more »

Labels: , ,

Wednesday, 8 April 2020

perl nagios tutorial

Nagios is a popular open-source monitoring system used to monitor hosts, services, and network devices. In Perl, you can use the Nagios::Plugin module to develop custom plugins to monitor various aspects of your system. Here's a basic tutorial on developing Nagios plugins in Perl:


1.Install Nagios::Plugin module: 

You can install the Nagios::Plugin module using the CPAN shell or your system's package manager.

2.Create a Perl script: 

Create a new Perl script and include the Nagios::Plugin module:

#!/usr/bin/perl

use Nagios::Plugin;

Read more »

Labels: