Hosting Tips & Tricks

Posts Tagged ‘linux’

Linux (centos) binary prelink issues

Today on a Cpanel server after nightly upgrade , our firewall (csf) detected some changed files. Then I run bellow verify command : #rpm -qfV /bin/bash prelink: /bin/bash: at least one of file’s dependencies has changed since prelinking S.?…..    /bin/bash I had never seen this before, but apparently rpm is doing something different now that [...]


MySQL Tip: MySQL Server Has Gone Away Or Lost connection to server during query

A much dreaded MySQL error message during queries is “MySQL server has gone away”. An alternative message is “Lost connection to server during query”. This is a strange problem which afflicts a wide variety of PHP software including but not limited to WordPress. There are several causes for it. Let’s look at the common and [...]


Verify installed rpm’s

For those who don’t like to RTFM, bellow can find codes for verifying rpm’s: for e.g. rpm -qfV /usr/sbin/sshd S.5….T  c /etc/pam.d/sshd S.5….T  c /etc/ssh/sshd_config explains into: S file Size differs M Mode differs (includes permissions and file type) 5 MD5 sum differs D Device major/minor number mismatch L readLink(2) path mismatch U User ownership [...]


Bash tips & tricks

I know that bash is not really a scripting language (I like perl ) but there are times when you just want to do things on a single command line. So, if you want for example drop some databases from a folder list: ls /var/lib/mysql | grep dbmatch* | while read i; do echo “drop [...]


How to identify high load apache processes

just paste to shell (cpanel server): ps -axo “%C %p” |sort -nr |head -5 |while read i p; do echo -n $i; /usr/local/apache/bin/apachectl fullstatus |grep -A 1 $p; done there is also a python script for that : apache-top.py . you can donwload it from: http://www.fr3nd.net/projects/apache-top/. it’s a nice tool but still need some customization.


/usr/bin/find: argument list too long

I kept running into this error when searching for a certain string, so I came up with a different way of searching: find . -name *\* -exec grep -i -H -n ’string’ {} \; Problem solved.