How to solve ‘Can’t locate DBD/mysql.pm’
As simple as:
yum install perl-DBD-mysql
As simple as:
yum install perl-DBD-mysql
1. Download the repository packages:
wget https://repo.percona.com/apt/percona-release_0.1-3.$(lsb_release -sc)_all.deb
2. Install it:
dpkg -i percona-release_0.1-3.$(lsb_release -sc)_all.deb
3. Update the packages list:
apt-get update
4. Install
apt-get install percona-nagios-plugins
5. Grant the privileges:
GRANT USAGE, SELECT, REPLICATION CLIENT on *.* to 'test'@'localhost' IDENTIFIED BY 'password';
6. Test:
/usr/lib64/nagios/plugins/pmp-check-mysql-status -x wsrep_cluster_status -C == -T str -c non-Primary -l test -p password
curl -H "Origin: https://www.pydelion.com" \ https://static.pydelion.com/style/all.css -I -v
fallocate -l 512M /mnt/swap ; \ dd if=/dev/zero of=/mnt/swap bs=512 count=1048576 \ ; mkswap /mnt/swap ; swapon /mnt/swap ; swapon -s ; free -m
ansible MySQL replication fails to change master with the following error: ‘Sending passwords in plain text without SSL/TLS is extremely insecure.’
To fix the problem open /usr/lib64/python2.6/site-packages/MySQLdb/cursors.py and change:
defer_warnings = False
to
defer_warnings = True
This is ugly but it works.
Fire:
postmap /etc/postfix/virtual
Once done :
service restart postfix
That’s it.
Sometimes it’s needed to get only packages names only using rpm. This is how it can be done:
rpm -qa --qf "%{NAME}\n"
As simple as:
sed -e '/^$/N;/^\n$/D' <file>
openssl x509 -noout -modulus -in example.crt | openssl md5 openssl rsa -noout -modulus -in example.key | openssl md5
Should be equal.
WordPress provides handy way to get all queries and to debug them easily.
To enable queries collecting add the following in your wp-config.php:
define('SAVEQUERIES', true);
Next should be added to your theme footer (wp-content/themes/<your_theme>/footer.php)
<?php echo get_num_queries(); ?> queries in <?php timer_stop(1); ?> seconds. <?php if (current_user_can('administrator')){ global $wpdb; echo "<pre>"; print_r($wpdb->queries); echo "</pre>"; } ?>
At the end you should be able to get something like:
134 queries in 0.301 seconds.
and a bunch of SQL queries.