Skip to Content

Category Archives: Linux

Simple command to generate a random password in linux terminal

Written on April 28, 2019 at 12:51 AM, by

We can use the below command to generate a random alpha-numeric strong password from a linux terminal (bash/sh) < /dev/urandom tr -dc A-Za-z0-9 | head -c14; echo -c  –> specifies the length of the random string generated.

OpenSSL commands to extract private key and cert from pfx/p12 file

Written on February 26, 2018 at 8:55 AM, by

Export the private key file from the pfx file: #openssl pkcs12 -in filename.pfx -nocerts -out key.pem Remove the passphrase from the private key: #openssl rsa -in key.pem -out server.key Export the certificate file from the pfx file: #openssl pkcs12 -in filename.pfx -clcerts -nokeys -out cert.pem

Placing custom Nagios NRPE script to monitor NFS Client

Written on March 24, 2017 at 1:39 AM, by

Changes in the Nagios server:   First of all enable NRPE plugin for the client host in Nagios server:   Make sure check_nrpe command is defined inside commands.cfg file. If not, add it (assuming nrpe plugin is installed along with Nagios ):   define command{ command_name check_nrpe command_line $USER1$/check_nrpe -H $HOSTADDRESS$ -c $ARG1$ }   […]

Enabling session persistence (stickiness) for nginx (open source)

Written on March 17, 2017 at 12:03 AM, by

For those who are not willing to spend some bucks on purchasing nginx plus but your manager insist upon enabling session persistence in nginx, the best option would be check the nginx approved set of modules here –> Nginx 3rd party modules There is a 3rd party module in that list by the name : Sticky […]

keepalived setup for application high availability in centos7

Written on March 14, 2017 at 8:08 AM, by

The requirement was to setup a HA application environment. We had two tomcat servers as backend nodes (application hosting servers). An nginx server was put in front of these two servers to give two functinalities: load-balancing and reverse proxy. Two Nginx servers were setup. One would be acting as a backup node if the primary […]

Learn to Docker (Basic referral commands)

Written on September 29, 2016 at 1:53 AM, by

Install Docker: curl -fsSL https://get.docker.com/ | sh Test docker : docker run hello-world – The docker daemon binds to a Unix socket instead of a TCP port. By default that Unix socket is owned by the user root and other users can access it with sudo. For this reason, docker daemon always runs as the […]

script to change cpanel password for many users in server

Written on April 2, 2013 at 5:13 AM, by

First get all the users name in a file : users.txt then touch a file script.sh chmod 755 script.sh copy the following code to that file:   ——————————————————- #!/bin/bash for i in `more users.txt` do randstring=`tr -dc _#$%^\&*\(\)\=A-Za-z0-9\~\[email protected]! < /dev/urandom | head -c 8` echo “$i $randstring” >> newpass.txt /usr/local/cpanel/scripts/realchpass $i $randstring /scripts/mysqlpasswd $i $randstring […]

fix for packet loss issues in high traffic servers

Written on November 11, 2012 at 5:51 PM, by

Recently there was a high packet loss issue in one of our servers and I implemented the following changes to get this fixed: check the value of following parameter in the server: net.ipv4.netfilter.ip_conntrack_max check this using the following command: /sbin/sysctl net.netfilter.nf_conntrack_max See how connection tracking table is already full can be like this: /sbin/sysctl net.netfilter.nf_conntrack_count […]

add comment when denying and ip using csf

Written on October 22, 2012 at 2:24 PM, by

This can be done easily as follows: csf -d <ip> <comment> for example: csf -d 11.22.33.44 too many connections This will automatically add the comment “too many connections” to csf.deny file: ——————————————————- # grep 11.22.33.44 /etc/csf/csf.deny 11.22.33.44 # too many connections – Mon Oct 22 12:10:13 2012 ——————————————————– This will help us to keep track […]

find all php release download links

Written on October 17, 2012 at 6:28 PM, by

find all php release download links from the location: http://php.net/releases/index.php