WordPress debugging

To turn on debugging add the following to wp-config.php // Turn debugging on define(‘WP_DEBUG’, true); // Tell WordPress to log everything to /wp-content/debug.log define(‘WP_DEBUG_LOG’, true); // Display error messages define(‘WP_DEBUG_DISPLAY’, true); Write to /wp-content/debug.log error_log(‘logging message here…’);

Backup mysql database via socks tunnel

The following bash script will open a socks tunnel with a remote host and use a local mysqldump cli tool to backup a mysql database. #!/bin/sh DT=$(date ‘+%Y-%m-%dT%H:%M:%S’) SUFFIX= FILENAME=$DT$SUFFIX BACKUPSPATH= USER= IP= PORT= DBUSER= DBPASS= DBNAME= echo “Opening socks tunnel to $IP” echo “Writing $FILENAME” ssh -f -L $PORT:127.0.0.1:$PORT $USER@$IP sleep 10; \ mysqldump… Continue reading Backup mysql database via socks tunnel

Dockerized phpmyadmin

Phpmyadmin is available as a Docker image. The mysql server connection parameters are provided when the container is instantiated. docker run -d –name pma_local \ –network=docker_network \ -e PMA_HOST=db \ -e PMA_PORT=3306 \ -e PMA_USER=root \ -e PMA_PASSWORD=password \ -p 8080:80 phpmyadmin/phpmyadmin –network The docker network the phpmyadmin container will join. PMA_HOST, PMA_PORT Name and… Continue reading Dockerized phpmyadmin

Import Barclays Bank statement

Create a table for the bank statement entries CREATE TABLE `bank_statement_entries` ( `id` int(11) NOT NULL, `cheque_id` varchar(50) DEFAULT NULL, `date` date DEFAULT NULL, `amount` decimal(13,4) DEFAULT NULL, `subcategory` varchar(50) DEFAULT NULL, `memo` varchar(100) DEFAULT NULL, `my_notes` text ) ENGINE=MyISAM DEFAULT CHARSET=latin1; SQL script for importing batch of csv statement entries into table `bank_statement_entries` DELIMITER… Continue reading Import Barclays Bank statement