Find Brand of Hard disk in Linux server

Want to fine the find the band name or serial number of the hard disk in Linux sever ?           You just need one package called  hdparm which can be installed using below command

#yum -y install hdparm                                                                                                                  To check hard disk specification run below command

# hdparm -I /dev/sda

Below is the result shown
/dev/sda:

ATA device, with non-removable media
Model Number:       ST1000DM003-9YN162
Serial Number:      S1D55TYB
Firmware Revision:  CC4H
Transport:          Serial, SATA Rev 3.0

Fine spammer account in cpanel server

Getting sick of spammers in server and IP blacklisting ?  To find the spammer account in server you need to SSH to server and run below command

awk ‘$3 ~ /^cwd/{print $3}’ /var/log/exim_mainlog | sort | uniq -c | sed “s|^ *||g” | sort -nr

This will show the the path of the user account from where max email was sent  in sorted order.

You can suspended the user and also check if any malicious file in the directory shown.

 

 

File Manager Permission in cPanel

Having issues with cpanel Filemanager where you can write on a file with 444 permissions ? The issue is with X3 theme
. You need to modify below line in file

vi  /usr/local/cpanel/base/frontend/x/files/changeperm.html

And see if you see the line:
cpanelFileman=

change it to  without space
cpanelFileman=

 

 

 

Error from Park wrapper: Sorry, you do not control the domain

Are you getting below error ??

Unable to remove add-on domain from cPanel – Error from Park wrapper: Sorry, you do not control the domain

Remove the entries for the domain from the following files.
====================
/var/cpanel/users/username                                                                                        Run Script — /scripts/updateuserdomains
/scripts/killdns  domain.db
/usr/local/apache/conf/httpd.conf
/etc/localdomains
/etc/userdomains
/etc/trueuserdomains
/etc/trueuserowners
/etc/valiases/domain.com
/etc/vdomainaliases/domain.com
/etc/vfilters/domain.com
 /var/cpanel/userdata/username – Remove the parked domain folders                                               /var/cpanel/userdate/username/main

 

 

 

Change the time zone for my webmail?

If you want to change the timezone for your webmail as per your region onn your server, please follow the below steps:

1. Log into SquirrelMail/Horde/Roundcube webmail client with the user that you would like to change the time zone for.

2. Access the following option:

In SquirrelMail:
Click on “Options” ->  “Personal Information”
In Horde:
Click on “Options” -> “Global Options” -> on”Locale and Time”

In Roundcube:

Click on “Settings” -> “User Interface”

3. Select the timezone you need.

 

 

/bin/rm invalid number of arguments

Getting error in invalid number of arguments when deleting large number of files in directory ?

The error is due to bash shell has a limit of 2621440 to the number of arguments you can pass to a command.  This can be verified by,

[root@hostab ~]# getconf ARG_MAX
2621440

Solution to this problem is to use the find command along with xargs,

cd  to the directory where you want to delete files and run below command

find . -name ‘*’ |xargs rm

 

Repair table in Virtualizor

Facing issues in Virtualizor for database crash ? The mysql library is not located in normal  /var/lib/mysql it located in /usr/local/emps/bin/

To repair database you need to use below command

[root@hostabc.virtualizor]# /usr/local/emps/bin/myisamchk -r *.MYI

Once completed all things should back to normal 🙂