Wordpress database clean up

April 15th, 2008 Computing 1 Comment »

I tried to upgrade my blog to Wordpress 2.5 days ago so I had the chance to check my MySQL database closely in PhpMyadmin. And I was astonished because the size of my database is over 4MB! That’s huge for a small scale blog. When I checked the tables in the database, I found there are two tables were uncommonly large: wp_comments and wp_options, both are over 1MB or more. When I checked them out by browsing their contents, I found that in the wp_comments table, there are tons of spam comments (marked “spam” in the “comment_approved” field). In the wp_options table, there are lots of unused options from uninstalled plugins left and there are lots of items begin with rss_. With a simple search on the net, I learned those spam comments and trackbacks are stored in the wp_comments table even though they are marked as spam and not posted to the blog. And for those options with rss_ prefix, they are RSS feeds contents used in Wordpress dashboard, etc. So basically I don’t need them, especially when they make the database so fat and make the blog significantly slow.

To clean them, I just simply delete the spam comments and trackbacks in wp_comments table and rss_ items in wp_options table. The SQL query is like this:

DELETE FROM `wp_comments` WHERE `comment_approved` = 'spam'

After the clean up, my database is just about 900KB, what a difference! If you are not comfortable to edit in PhpMyadmin directly (like regedit in Windows), fortunately there are some plugins out there do the job well. CJD Spam Nuke and Clear Options are two of them and very easy to use. The latest Akismet plugin also can delete the spams from database manually or automatically.

Share This

Related Posts

Wordpress and .htaccess problem

April 10th, 2008 Computing No Comments »

This is an old problem has existed for years, but I just encountered it days ago. In short, the symptom is that access to all password protected regular folders will be directed to the 404 page of Wordpress, where “regular” means it’s not a Wordpress page. I played around with both .htaccess files in my www root directory and in the protected directory, and found it should be caused by something within the Apache itself but I don’t know what exactly the reason is.

Finally I worked it out by asking on Site5’s forum and got the solution from this site. Because I installed Wordpress in a sub-directory /blog under my root, so the solution is to modify the index.php file under the root folder from

< ?php
/* Short and sweet */
define('WP_USE_THEMES', true);
require('./blog/wp-blog-header.php');
?>

to

< ?php
/* fix password protected folder access */
$request_filename = $_SERVER['DOCUMENT_ROOT'].$_SERVER['REQUEST_URI'];
$this_dir = dirname(__FILE__).'/';
if($request_filename!=$this_dir && $request_filename!=__FILE__ && (is_file($request_filename) || is_dir($request_filename))) {
  // we are not supposed be here!
    die;
                    }
/* Short and sweet */
define('WP_USE_THEMES', true);
require('./blog/wp-blog-header.php');
?>

After this modification, everything works well now.

Share This

Related Posts

Secure USB key on the go

March 19th, 2008 Computing No Comments »

It’s very convenient to have your favorite programs and data at hand when you are away form your own computer. With a large capacity USB flash drive, it’s very easy to store lots of files as well as portable applications in the tiny key drive. But it’s so tiny and it’s really easy to get lost and your sensitive data will be at risk. Here’s my solution to build a very well secured USB flash drive with all my favorite programs with settings, my frequently used documents and even all my easy-to-forget passwords.

  • Use TrueCrypt to protect all data on the drive. Though most space on the USB key is encrypted, I still reserve a small mount of space to put TrueCrypt executable files for self-decrypt and autorun.
  • Intall (copy) portable applications. I installed portable web browser (Firefox), email client (Thunderbird), office suite (OpenOffice), antivirus (ClamWin), IM client (Pidgin), media player (VLC), game (Sudoku) etc. Most of them can be downloaded from PortableApps.com. You can use their PortableApps Suite as well, but I just found a better alternative, PStart, it’s more flexible and quicker.
  • Install KeePass for password management. Because it’s inside the encrypted part, which needs a password to decrypt, so your passwords will be double-secured.
  • Have a copy of TiddlyWiki for notes. My favorite notebook utility so far. You can easily turn it into an address book by Twab plugin. There are many plugins out there that can enhance TiddlyWiki, but I prefer to keep it simple and quick, and most importantly, get things done.
Share This

Related Posts

Five reasons to use TiddlyWiki as a notebook

November 10th, 2007 Computing No Comments »

TiddlyWiki is an innovative, intuitive and versatile tool can be extended to many useful applications. Besides personal WiKi, I found it’s very handy to be a personal notebook. It can be used to record your random thoughts, wild ideas, notes and anything you want to write down on a notepad with a pen. I ever used ATnotes as a notebook as well as an alarm reminder. But it supports plain text only and it’s for local only. Then I used Google Notebook to save materials from the web during research. But it’s saved online so you cannot retrieve it when you are offline. And finally I realized TiddlyWiki is the best tool for me to take notes the other day, when I opened the file that has been saved on my hard drive for couple years.

I think there are several reasons why I think it’s the best notebook tool, at least for myself.

  1. It’s powerful yet simple. Everything is included in a single HTML file and it gets things done. No those fancy bells and whistles, only your content and necessary controls there and they really do the job. It supports all general text formattings, images, links, tables, lists, etc and even inline HTML and custom CSS.
  2. It’s portable. Because everything is in a single HTML file, you can put it either on local computer or remote web server to access from everywhere. You can even put in on a flash drive and bring it with you. As long as there’s a computer with a USB port and a web browser with JavaScript support (actually you can install one on the very same flash drive!), you are ready to go.
  3. It’s versatile. The limit is your imagination. It can be used as a personal WiKi, a weblog, a diary, a project presentation, and yes, a notebook. By changing the main menu and default tiddlers, it can be turned into a nice looking homepage too.
  4. It’s very handy. It supports tags and full text search, that means you can find your old notes very quickly. I just put a link on the Firefox bookmarks bar so I can open the notebook by one click. And after another click, I am ready to input. I also put a copy on my web server in case I want to look it up when I am away from my desk. Handy enough for me.
  5. It’s open source and free. Do I need to say anything more?

Go and grab your copy now.

Resources:

Share This

Related Posts

Flickr widget

September 27th, 2007 Computing 1 Comment »

Flickr widget, one of Yahoo! Widgets (formerly Konfabulator Widgets), is a handy tool to display your or others’ Flickr photos on your desktop in a very elegant manner, and more. Besides your own photos, it can also display photos from your favorites, your sets, your groups and your contacts. What’s more, it’s also a very powerful tool to upload photos to Flickr and this is what I like the best. First of all, it is capable of batch upload by drag-and-drop. Though Flickr provides a fancy AJAX-ized upload form, I think what this widget provides is much better and intuitive. And, it also allows you to edit basic information such as title, description, tags, privacy, etc. You can even post photos to your sets, groups, or even your blog directly. All these are in a very beautiful interface right on your desktop.

To give it a try, you need:

  • have Yahoo! Widgets engine installed;
  • have Flickr widget installed, and
  • a Flickr account.
Share This

Related Posts



WordPress Theme by Just Skins | Modified by GQSHEN | Hosted by Site5
| 0.323
Copyright © 2005 - 2010 Gradual Quietness. All rights reserved.
Close
E-mail It