Tag: Tips

UPDATE 2: A lot has changed to WordPress since 2.x so I don’t recommend trying this for versions above 4.0. I can’t confirm it’s operation.

UPDATE: This also works with WP 2.7.1. If editing wp-db.php is too daunting, you can download my version, which will work as long as the prefix of your main blog is wp_.

While developing new themes for the blog, I needed a place to preview a theme that includes all the current posts, comments and categories. Thanks to a blog post from United States of Martin, I was able to set up the blog in a subdomain that only uses a different options database.

Basically the method is to tell the main blog to allow users in the slave blog to access the posts. You do that by accessing your web host’s MySQL database admin panel and entering this text as two separate queries:

INSERT INTO main_wp_usermeta (user_id, meta_key, meta_value) VALUES (1, 'slave_wp_user_level', 10)
INSERT INTO main_wp_usermeta (user_id, meta_key, meta_value) VALUES (1, 'slave_wp_capabilities', 'a:1:{s:13:"administrator";b:1;}')

where slave_wp is the prefix of your second blog, and main_wp is the prefix of your original blog.

The second task is to change the file /wp-includes/wp-db.php by adding a few lines of new code. The reason I’m posting this is because even with the original instructions, I could not get it working with WordPress 2.6 for some time, even after having it work properly under 2.5.

Find this text in wp-db.php

foreach ( $this->tables as $table )
$this->$table = $this->prefix . $table;

which is likely on line 383 – 384. Immediately after this text, insert these lines:

$this->posts = 'wp_' . 'posts';
$this->users = 'wp_' . 'users';
$this->categories = 'wp_' . 'categories';
$this->post2cat = 'wp_' . 'post2cat';
$this->links = 'wp_' . 'links';
$this->postmeta = 'wp_' . 'postmeta';
$this->usermeta = 'wp_' . 'usermeta';
$this->terms = 'wp_' . 'terms';
$this->term_taxonomy = 'wp_' . 'term_taxonomy';
$this->term_relationships = 'wp_' . 'term_relationships';
$this->comments = 'wp_' . 'comments';

where wp_ is the prefix of your main blog as set up in wp-config.php.

This immediately fixed my setup, and now I can enjoy 2 different themes, with one set of posts, comments, categories and pages.

[tags]Wordpres, 2.6, database, MySQL, blog[/tags]

Tagged with: , , ,

It’s 8 AM. You’re just about to email the TPS reports you’ve been working on since 1 o’clock this morning when suddenly your computer stops responding to your inputs. In a panic, you shut down the system by holding the power button, but on the next startup, the screen doesn’t even reach the desktop. Before starting to pull your hair out, you suddenly realize that you’ve prepared for an event like this — you’ve made a backup drive.

By and large, Macs are very stable systems. Even with little or no maintenance, they’ll run for years without a problem. Unfortunately, they do occasionally decide to take a vacation, which most often comes at a very unlucky time. To protect yourself from such problems, you should have a bootable drive that contains only the bare minimum of applications, hopefully allowing you to remain productive in desperate times.

Important note: There is an important difference between making a drive for Intel-based systems versus PowerPC-based computers. Intel systems can be booted from cases using the cheaper USB 2 standard, while PowerPC computers can only use FireWire drives. Be sure to use the correct case for your computer, as well as the right partition scheme: GUID for Intel, Apple Partition Map for PPC.
Read More »

Tagged with: , , , ,

In 2001, Apple introduced the 5GB iPod. At first it wasn’t the amazing success it is today, but soon people realized that Apple’s hardware/software integration made the MP3 player experience that much better. Soon Apple came out with different models, and today there are 4 models to choose from. Each model has benefits and drawbacks that make it best for a specific type of user.

Continuing on from my Pick the right Mac post, here is a guide to pick the right iPod for your music listening needs.
Read More »

Tagged with: , , , , , ,

Whenever a new operating system comes out, many people enjoy peeking around the internals to see what sort of treasures lie beneath the shiny exterior. Nerdy, yes, but in the case of Leopard, that searching yielded some very cool results.

You may notice from browsing around the site that I like to use illustrated icons with posts. These icons were all found in a single folder hidden among the Leopard system files. The folder contains high-quality 512×512 pixel icons of computers and nearly any image used in the OS itself.

I learned about this trick from MacOSXHints, and if you’re interested in checking out the icons yourself, here is where you can go.


This location can be copy and pasted into the Go to Folder window under the Finder Go menu, or can be navigated manually. CoreTypes.bundle actually appears as an application, so you need to right click it and choose Show File Contents. Open any of the icons in Preview and you can save them in any format you wish.

[tags]Mac OS X, Leopard, Preview[/tags]

Tagged with: , , ,

This was going to be a post about how to move your iTunes library from one drive to another (maybe after upgrading it) and have iTunes recognize it properly. I thought it was going to include XML editing to trick iTunes into thinking the media was somewhere it wasn’t before.

Turns out the solution is much, much easier than that.

Before I upgraded my MacBook’s hard drive, I imported iTunes TV Shows by storing them on an external drive and told iTunes not to copy media into the library. That of course meant that whenever I wanted to watch a show, I had to have the drive connected. Once I upgraded the drive, I had plenty of space to move the TV shows over, but I didn’t want to ruin my metadata (play count, playlists, etc).

On a whim, I tried importing the media again after changing the setting in iTunes that says Copy media to library. iTunes took over and copied the file into the library, and simply updated the existing record. That meant that instead of the file pointing to

/Volumes/External 1/TV SHOWS/Season 1

it pointed to

/Volumes/Macintosh HD/iTunes Music/TV Shows

and I could watch the media as before.

So if you ever have to move media from one drive to another and maintain the existing iTunes data, just import it normally and watch iTunes work it’s magic.

[tags]iTunes, Mac OS X, iPod, Apple, Mac[/tags]

Tagged with: , , , ,