Categories
Red Hat Enterprise Linux / CentOS

One liner command to insert IP and hostname in /etc/hosts

This a very useful One liner command to insert IP and hostname into /etc/hosts file and is particularly useful when it comes to kickstart scripts wherein you need to have /etc/hosts entry for the newly provisioned VM and get it enrolled to various applications that include Red Hat IDM/ FreeIPA and Puppet to start with.

Categories
Linux Red Hat Enterprise Linux / CentOS

Using awk in Alias Command – CentOS & Red Hat

Its possible to use awk in Alias command. I did that by simply just modifying some parenthesis and there you go, had a working awk command.

All that it required was closing awk in double quotes as opposed to single quotes and forward slash before the “$” variable. This alias command is for printing the default Gateway for an interface.

 alias eth0-gw='route -n | grep eth0 | awk "NR==1{ print \$2 }"'
Categories
Red Hat Enterprise Linux / CentOS

Run a script via Alias Command – CentOS & Red HAT

Its possible to run a script via Alias command. All you need is to modify the .bashrc and then source the script in the required user profile. Alias commands are very useful when it comes to running shortened versions of commands or a complex script to be run using just a single line of command. Currently I use this to run 2 of my custom scripts for waking up a ESXi server via WOL (Wake-ON-LAN).

Categories
Red Hat Enterprise Linux / CentOS

Create Self Signed SSL Certificate – CentOS and RHEL

This article will guide you on creating a custom Self-signed SSL Certificate in no time. For creating one you would need top have Root access to the host. SSL Certificate is used for securing the access to a website or any apache based WebUI you use and that includes Nagios and Cacti.

Categories
Red Hat Enterprise Linux / CentOS

Dual Instance of SSH – CentOS and RHEL

This guide is for configuring dual instances of ssh on a single server and bind them to seprate NIC’s/Interfaces/Ethernet ports. Usually this is required in DEV and Prod environments wherein you need additional security and separation of bandwidth and keep DEV and Prod users access limited.

Categories
Red Hat Enterprise Linux / CentOS

How to Telnet via BASH Script

This article will show you how to Telnet via BASH script and return the status as open or close. This has been tested on CentOS/RedHat and hopefully should work on all other Linux distributions as well.

Categories
Linux

How to create home LAB using ESXi,RaspberryPi and CiscoVPN for Remote access

I wanted to share my experience building a ESXi HOME LAB with VPN access that can be used for development and testing purposes and also making sure its the most energy efficient setup and light on your pocket coupled with good performance and negligible noise.
This article is aimed at Home users and Small & Medium business users who don’t have huge needs to running resource hungry applications/databases instead just running some WEB applications, NAS, Windows AD or RedHat Infra and media sharing across the network for multiple users.

Categories
Linux

How to Show Line Numbers in Vi / Vim editor

Showing Line numbers in Vi /Vim Text editor would be very helpful when it comes to troubleshooting code errors in a file. This works on almost all Linux/UNIX distributions. Once you are in the edit file mode, Type while in edit mode “:set nu” OR “:set number” and then it will show you the Line numbers and  then you can jump to a specific line by typing “:number” or any line number you require.

Categories
Red Hat Enterprise Linux / CentOS

How to reduce LVM size & reuse free space on the fly

Reducing LVM disk size is possible using lvreduce on the fly without a reboot. Make sure that data is backed up for the disk to be resized so that FREE space can be reused. LVM (Logical Volume Management) is very efficient when it comes to mounting/partitioning disks in Linux. You need to be ROOT to carry out this process.

Categories
Red Hat Enterprise Linux / CentOS

Extend LVM partition to >2TB. No need for GPT, Parted or Kernel editing

Its now possible to extend LVM disk/partition to more than 2TB that too without using Parted, GPT or Kernel editing.After doing lots of Googling and not a single article explaining about extending LVM volume without GPT, I came up with this article which has been fully tested and working. It was tested on a 4TB disk with a single partition of 3.5TB. The LVM extension can be done without loosing any data although I would still recommend backing up the data as a precautionary measure.

NOTE: This has been tested in a DEV environment and assume no responsibility with regards to performance effect on the disk/volume in Production although the disk tested has been in a perfect condition and working for more than 2 years now.