Mikko Kortelainen

Temporarily Disable PostgreSQL Triggers

To temporarily disable all triggers in a PostgreSQL session, use this:

SET session_replication_role = replica;

That disables all triggers for the current database session only. Useful for bulk operations, but remember to be careful to keep your database consistent.

To re-enable:

SET session_replication_role = DEFAULT;

Disable a Single Trigger

To disable just …

read more

Checking PostgreSQL Disk Usage

This query sums total disk space used by the table including indexes and toasted data for the 20 largest tables:

SELECT nspname || '.' || relname AS "relation",
    pg_size_pretty(pg_total_relation_size(C.oid)) AS "total_size"
  FROM pg_class C
  LEFT JOIN pg_namespace N ON (N.oid = C.relnamespace)
  WHERE nspname NOT IN ('pg_catalog', 'information_schema')
    AND …
read more

Apache HTTP authentication against WordPress password database

The stock mod_auth_mysql package in Ubuntu is not able to authenticate against the phpass password hashes stored in the WordPress database.

There seems to be a patch lying around to enable phpass authentication in mod_auth_mysql. Its inclusion in mod_auth_mysql has been requested a long time ago, and again more recently …

read more

Make WordPress Twenty Eleven theme post pages full wide

I wanted to make the indivitual post pages 100% wide, and also the headings a bit bigger. Here's the CSS to do it:

/* Make individual posts full-width */
.singular.page .hentry {padding:1em;}
.singular .entry-header,
.singular .entry-content,
.singular footer.entry-meta,
.singular #comments-title {
 width: 100%;
}
/* Fix the edit button placement */
.singular …
read more

AVH First Defense Against Spam « WordPress Plugins

I added the AVH First Defence Against Spam plugin to my site. Please report to me If you can't post comments:

AWStats Multi-Site Setup

Here's how to install and configure AWStats to compile separate statistics about multiple Apache sites or virtual hosts running on a single server. This can be done when you configure each Apache site or virtual host to use a different access log file.

The following instructions have been tested on …

read more
<< Page 4 of 9 >>