|
| [HTTPS] Everywhere Preferences window |
It took me some time and several deactivations and reactivations of my add-ons while trying to find the culprit and I found it. Visit The Light of the LAMP blog for more...
Περισσότερα... »
skip to content
Kavala Blogs » The light of the LAMP » July 2011 | |||
|
Τα επιλεγμένα blogs του νομού Καβάλας με μια ματιά |
|||
38104 άρθρα από 85 πηγές
Aa - Zz
(23213)
Αα - Ωω
(14891)
|
| [HTTPS] Everywhere Preferences window |
<?php
// initialize variables [you have to change them to their proper values]
$dbhost = "localhost";
$dbuser = "dbuser";
$dbpass = "dbpassword";
// connect to MySQL and get all database names
$db = mysql_connect( $dbhost, $dbuser, $dbpass)
or die( "MySQL connection problem: " . mysql_error());
mysql_set_charset( "utf8");
mysql_select_db( "information_schema", $db) or die( mysql_error());
$sql = "SELECT SCHEMA_NAME FROM SCHEMATA";
$u0 = mysql_query( $sql, $db) or die( mysql_error());
$alldb = array();
while ($u1 = mysql_fetch_row( $u0)) { $alldb[] = $u1[ 0]; }
// select each database found and check for active plugins
foreach( $alldb as $adb) {
$conn = mysql_select_db( $adb, $db);
// get *_options table name
$sql = "SHOW TABLES FROM $adb LIKE '%_options'";
$u0 = mysql_query( $sql, $db); // or continue;
while ($u1 = mysql_fetch_row( $u0)) {
if ($opt = $u1[0]) {
// get active plugins list
$sql = "SELECT * FROM $opt WHERE option_name='active_plugins'";
$u00 = mysql_query( $sql, $db);
if ($u01 = mysql_fetch_array( $u00)) {
$apj = $u01[ 'option_value'];
if ($apj) {
$ap = unserialize( $apj);
foreach( $ap as $apv)
echo "Database: $adb >>> $apv\n";
}
}
}
}
}
mysql_close( $db);
?>
The output of this script is a list of all active plugins, one for each line, so it can be used in a shell script, for example one can find out how many of them are active:
php show_all_active_plugins.php | wc -l
or find out which blogs are using a certain plugin:
php show_all_active_plugins.php | grep akismet
Disclaimer: as usual, this script works for my setup and, for this reason, I'm sharing it here for everyone interested. I hope it will work for anyone else who tries it, but I cannot guarantee it for every possible situation. Visit The Light of the LAMP blog for more...
Visit The Light of the LAMP blog for more...Jul 5 13:40:01 agriope2 CRON[971]: (CRON) error (grandchild #974 failed with exit status 1)
Jul 5 13:50:01 agriope2 CRON[7775]: (CRON) error (grandchild #7778 failed with exit status 1)
Jul 5 14:00:01 agriope2 CRON[14520]: (CRON) error (grandchild #14526 failed with exit status 1)
Jul 5 14:00:01 agriope2 CRON[14521]: (CRON) error (grandchild #14531 failed with exit status 1)/etc/cron.d/update-motd, which was scheduled to run every 10 minutes and tried to run /usr/sbin/update-motd. The problem is that /usr/sbin/update-motd was not present any more at its whereabouts, probably because "the functionality formerly provided by update-motd package is now integrated into pam_motd, in libpam-modules" (as the description of update-motd package says)./etc/cron.d/update-motd to another location, just in case I will need it again some time in the future.If you do not want "no mail" to be an error condition (for instance, for cron jobs), use a POSIX-compliant shell and addVisit The Light of the LAMP blog for more...
|| [ $? -eq 1 ]
to the end of the fetchmail command line, note that this leaves 0 untouched, maps 1 to 0, and maps all other codes to 1. See also item #C8 in the FAQ.
|
Hellas Blogs: Rhodes Blogs (Ρόδος) Fokida Blogs (Φωκίδα) Evia Blogs (Εύβοια) Preveza Blogs (Πρέβεζα) Pella Blogs (Πέλλα) Kilkis Blogs (Κιλκίς) |