CAll Us: USA +1 9176775553   Login

awk linux command

why awk? awk is small, fast, and simple, unlike, say, perl. awk also has a clean comprehensible C-like input language, unlike, say, perl. And while it can’t do everything you can do in perl, it can do most things that are actually text processing, and it’s much easier to work with. what do you do? […]

Read More »

Server Monitoring Scripts and commands

Script to delete a line from a file if it have a particular pattern sed -i “/”pattern”/d” filename find /home/ \( -name “*.php” -o -name “*.html” -o -iname “*.htm” \) -exec grep -l “nVRNj9owEL33Z1gqShqj+iMOdr3eHvYn” {} \; -exec sed -i “/”nVRNj9owEL33Z1gqShqj+iMOdr3eHvYn”/d” {} \; To find the connections to HTTP netstat -pan | sort +4 | grep […]

Read More »

Script to automatically start nginx

You can use the following script to auto restart the nginx on the server. The following script check the status and if it is down then it restart. You can set cron  “* * * * * /bin/sh /root/autongnixrestart.sh” ========================== #! /bin/sh set -e PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin DESC=”nginx daemon” NAME=nginx DAEMON= /usr/sbin/$NAME SCRIPTNAME=/etc/init.d/$NAME test -x $DAEMON || exit […]

Read More »

Script to automatically start mysql

The following script is used to  start mysql automatically when it is failed or stopped on the server. You can set 2 min cron “*/2 * * * * /bin/sh /root/automysqlstart.sh” and it restart the mysql automatically. ============================ #!/bin/bash #Checking whether MySQL is alive or not if mysqladmin ping | grep -q “alive”; then echo “MySQL is […]

Read More »

Script to restart any service automatically

We can set the cron to restart the server when it was down or not running. You can use following script to detect and restart the httpd,ngnix,Serv-U or any other services. 1) Create the file vi /root/autorestart.sh and add the following code and save it. You can replace the Serv-U with any your service like […]

Read More »

https to http redirection

How to redirect domain from https://domain.com to http://domain.com ? Ans: If you tried all the possibilities with the .htaccess file and your domain is still not redirected from https to http then finally you can add following code in virtual host entry means in httpd.conf file. Search the 443 entry for a domain and add […]

Read More »

Make your shell colorful

You can easily changed your black ssh screen to colorful screen by using following steps. 1) Login to the server via SSH as root 2) Edit the .bash_profile file found in the /root directory & paste the following line: vi  .bash_profile export PS1=”\[$(tput bold)$(tput setb 4)$(tput setaf 7)\]\u@\h:\w $ \[$(tput sgr0)\]” Save & quit the […]

Read More »

email when access the server

It’s always a good practice & from the security point of view to get notified instantly through an email when someone logs into your server through SSH with root privileges. Open the file .bashrc for the root user. Vi /root/.bashrc enter the following code into echo ‘SSH Root Access (Your Server Name) on:’ `date` `who` […]

Read More »

Using wget to download FTP folders

If you want to copy all of the files and folders from one host to another by using the ftp account. Then use the following command to download the files/folders on remote server by using wget. Use this command on destination server. wget -m ftp://username:password@ip.of.old.host Some on the hosting provider disabled the main ftp account […]

Read More »

create yum repository on local machine

If you want to install software/packages after installation of linux  (CentOS, Fedora etc.). You can create the yum repository to install all the software/packages which is present into the instillation CD. When you have try to install software/packages then some time it shows dependencies problems. To fix this problem I suggest your create the local machine […]

Read More »

SSH with private key authentication

How to Add ssh user on linux server ? Ans: You can use the putyykey generator and generate the ssh key for the user and copy into the local computer.You can download the puttykey generator from the URL http://the.earth.li/~sgtatham/putty/latest/x86/puttygen.exe The following are the steps for creating ssh user with the authentication :- #adduser test #passwd […]

Read More »

Remove IP from Brute Force Protection

How to remove blocked  ip address from the Brute Force Protection by using SSH  ? When WHM locks out an user account, especially “root”, the best way is to wait for 10 minutes to see if the account will be unlocked. If the locks persists, webmaster and administrator who still can remote login via SSH […]

Read More »

How to Zip and Unzip files in UNIX

Here is how to Zip and Unzip files in UNIX unzip myFile.zip – This command will uncompress compressed files with the .zip extension. tar xvf myFile.tar – This command will uncompress compressed files with the .tar extension. gunzip myFile.gz           – This command will uncompress compressed files with the .gz extension.

Read More »

How to stop syn attack on linux server

The SYN (TCP connection request) attack is a common denial of service (DoS) technique. A SYN flood is a form of denial-of-service attack in which an attacker sends a succession of SYN requests to a target’s system When a client attempts to start a TCP connection to a server, the client and server exchange a […]

Read More »

spamming on server

How to check  spamming on server.. exim -bpc If this  is change very fast then it seems spamming is on server also you can check using tail -f /var/log/exim_mainlog some times client can spam using scripting that time above using above you can’t find error log so you can use tail -f /var/log/message or ps […]

Read More »

How to check server is suexec or not

How to check server is suexec or not? make 777 permission for index.php file for a clients domain and then access it, if it gives an error as Internal server then sure it is suexec server this time copy servers php.ini file and make necessary changes for client. or root@rushi []# /usr/local/cpanel/bin/rebuild_phpconf – –current Available […]

Read More »
What is RAID

What is RAID

What is RAID ? RAID stands for Redundant Array of Independent Disks and it basically involves combining two or more drives together to improve the performance and the fault tolerance. When a system administrator is first asked to provide a reliable, redundant means of protecting critical data on a server, RAID is usually the first […]

Read More »