Location of Cpanel main configuration file
Here is the location of the main Cpanel configuration file. You can configure many of it’s various components, such adding more cpu’s to cpuwatch: /var/cpanel/cpanel.config
Here is the location of the main Cpanel configuration file. You can configure many of it’s various components, such adding more cpu’s to cpuwatch: /var/cpanel/cpanel.config
Sometimes you might need to add one or more lines of text to the top of an existing text file. Let ‘sed’ rescue you: sed -i ‘1iSTUFF TO ADD’ file.txt You can add multiple lines (separated by \n) to multiple files at once: sed -i ‘1iSTUFF TO ADD\nMORE STUFF’ *.txt
Right here: /usr/lib/courier-imap/etc/…
This proved to be useful in cleaning up a compromised site. List all the files created or modified within a certain time frame — in this case we are looking 30 days in the past: find . -mtime -30 -type f -print If you want to delete all files created/modified n days ago, you can […]
When cloning a Debian system, be sure to remove everything in: /etc/udev/rules.d/*persistent-net.rules This will allow the new hardware to detect properly.
Normally you would use something like this: du -k | sort -nr > sorted.txt But the output is not pretty since we don’t like counting bytes. This will sort it in human readable format: du -k | sort -nr | awk ‘ BEGIN { split(“KB,MB,GB,TB”, Units, “,”); } { u = 1; while ($1 >= […]
Determine the nature of the attack (SYN, GET, ect): netstat -nat | awk ‘{print $6}’ | sort | uniq -c The following will list all the IPs connecting to the server in order of most connections. netstat -plan|grep :80|awk {‘print $5’}|cut -d: -f 1|sort|uniq -c|sort -nk 1 We can see which domains are most active […]
If you are using a cpanel/WHM server then the MTA will be Exim by default. Enable Mailheaders by running /scripts/easyapache script. After that, check the mail header using: exim -Mvh <message id> From that you will able to find the source of spam.
Adaptec RAID cards have huge performance gains over other cards, but the management features in Linux stink. Really bad. If you don’t have a GUI installed, you cannot set up monitoring or alerts, but thankfully you can use a Windows machine to set this up remotely. Additionally, there are no .deb packages so we have […]
A very large disk array (hardware RAID) combined with LVM (Logical Volume Management) will give you a vast amount of flexibility. Without LVM, you’ll have to reboot the entire machine to realize the new space when adding RAID members. Using LVM, you can take advantage of OLE (On Line Expansion) and expand your existing volumes […]