Blog O' Matty


Fixing wordpress blunder

This article was posted by Matty on 2005-09-09 22:30:00 -0400 -0400

While messing around with the URL configuration values in wordpress, I managed to kill my theme and the administrative screens. This unfortunate series of events forced me to call technical support (Clay), who quickly forwarded me one of his blog posts for a fix. I followed Clay’s directions, but inadvertently updated all 72 entries in the wp_config table with the following SQL DML statements:

mysql> update wp_options set option_value 'http://prefetch.net/blog';

Since my BLOG immediately died after this update statement, I started to investigate the layout of the wordpress tables to see how to best recover from this snafu. A quick check of the matty mysql database revealed the following tables:

$ mysql -p

Enter password:

mysql> use matty

mysql> show tables;

+-------------------+
| Tables_in_matty |
+-------------------+
| wp_categories |
| wp_comments |
| wp_linkcategories |
| wp_links |
| wp_options |
| wp_post2cat |
| wp_postmeta |
| wp_posts |
| wp_users |
+-------------------+
9 rows in set (0.00 sec)

Since I didn’t have a backup* of the wp_config table, I couldn’t just use the SQL TRUNCATE, DROP, CREATE and INSERT statements to remove the table and re-create it. Since I wanted to get my BLOG restored quickly, I decided to DROP the wp-config table and backup the “mattyâ€? database with mysqlbackup:

$ mysql -p

Enter password:

mysql> drop table wp_config;

$ mysqldump -u matty -p matty > mattydb.dump

Once I had a good backup with the data I wanted to save, I proceeded to drop all of the remaining tables to allow wp-install.php to work (wp-install.php doesn’t seem to want to run if the wp_* tables are already defined). Once the wp-install.php script initilized the schema and loaded the initial configuration data, I copied (‘grep’ and “»” actually) the pertinent INSERT statements from the dump file to a file called import.sql. Next I fired up mysql and executed all of the INSERT statements I had filtered:

$ mysql -p

Enter password:

mysql> source import.sql

This imported all of the data I had input with the wordpress graphical editor, and my BLOG was restored to a happy state. :) I cannot emphasize enough how important backups are! :) I have since implemented daily backups of the database!

OS X themes

This article was posted by Matty on 2005-09-09 18:35:00 -0400 -0400

If you have been using OS X for any period of time, you will notice that they have shifted themes around a bit. This article provides an amusing take on the latest changes to iTunes! It’s hilarious!

DivX Support in OS X

This article was posted by Matty on 2005-09-09 01:11:00 -0400 -0400

While searching the web tonight, I came across Video LAN. This nifty little media player supports every Operating System under the Sun, and finally allowed me to watch Ben Rockwood’s videos from the opensolaris users group in California. Niiiiiiiiiiiiiiiiiiiiiiiiiice!!!!!!!!!

Enabling and Disabling I/O paths with Veritas

This article was posted by Matty on 2005-09-09 01:05:00 -0400 -0400

Veritas Volume Manager (VxVM) comes with DMP (Dynamic MultiPathing) support. DMP allows VxVM to load-balance IOs across multiple controllers, offline paths when failures are detected, and dynamically disable paths when performing maintenance on a specific controller or path (e.g., ugprading a SAN switch or hot swapping an HBA). The process of manually disabling a path is easily accomplished by invoking VxVM’s vxdmpadm(1m) utility with the “disable” keyword, and the controller to disable:

$ vxdmpadm disable ctlr=c2

Once the controller is disabled you can monitor the number of IOs per path with vxdmpadm(1m)‘s iostat utility:

$ vxdmpadm iostat show dmpnodename=c2t20d1s2 interval=5

cpu usage = 636us per cpu memory = 32768b
OPERATIONS KBYTES AVG TIME(ms)
PATHNAME READS WRITES READS WRITES READS WRITES
c2t20d1s2 1800 0 230400 0 0.016102 0.000000
c3t21d1s2 1799 0 230272 0 0.016858 0.000000
cpu usage = 663us per cpu memory = 32768b
OPERATIONS KBYTES AVG TIME(ms)
PATHNAME READS WRITES READS WRITES READS WRITES
c2t20d1s2 337 0 43136 0 0.014257 0.000000
c3t21d1s2 3007 0 384896 0 0.018631 0.000000
cpu usage = 657us per cpu memory = 32768b
OPERATIONS KBYTES AVG TIME(ms)
PATHNAME READS WRITES READS WRITES READS WRITES
c2t20d1s2 0 0 0 0 0.000000 0.000000
c3t21d1s2 3357 0 429696 0 0.018183 0.000000

Once maintenance is performed, the controller can be brought back online with vxdmpadm(1m)‘s “enable” option, and the controller to enable:

$ vxdmpadm enable ctlr=c2

Once the controller is back up and operational, VxVM will start sending IOs through the controller:

cpu usage = 904us per cpu memory = 32768b
OPERATIONS KBYTES AVG TIME(ms)
PATHNAME READS WRITES READS WRITES READS WRITES
c2t20d1s2 0 0 0 0 0.000000 0.000000
c3t21d1s2 4064 0 520192 0 0.014160 0.000000
cpu usage = 719us per cpu memory = 32768b
OPERATIONS KBYTES AVG TIME(ms)
PATHNAME READS WRITES READS WRITES READS WRITES
c2t20d1s2 1454 0 186112 0 0.013288 0.000000
c3t21d1s2 2720 1 348160 8 0.013732 0.250000
cpu usage = 697us per cpu memory = 32768b
OPERATIONS KBYTES AVG TIME(ms)
PATHNAME READS WRITES READS WRITES READS WRITES
c2t20d1s2 2110 0 270080 0 0.013485 0.000000
c3t21d1s2 2112 0 270336 0 0.013361 0.000000

VxVM is awesome, and makes managing tons of storage a breeze!

Reverse engineering software

This article was posted by Matty on 2005-09-08 13:37:00 -0400 -0400

I found this article on reverse engineering Mac OS X transitions super cool! If you haven’t used desktop manager, you are missing out! I couldn’t work without multiple workspaces.