Monthly Archives: August 2009

According to my readings and tests, MySQL doesn’t support database renaming. Well, at least I didn’t have success with the following:

rename database old_dbname TO new_dbname;

A quick solution is to export the existing database, create a new one with the desired name, and re-import the former into the latter:

mysqldump -u username -p -v old_dbname > old_dbname.sql
mysqladmin -u username -p create new_dbname
mysql -u username -p new_dbname < old_dbname.sql

If you’re not planning to use the old database, don’t forget to drop it.

This morning, while I was testing a bug related to HTTP authentication in Google Chrome, I found an authentication bypass on D-Link 500G.

The original advisory is here.

UPDATE 2009.09.06: Parallels Tools is fully working on Ubuntu 9.04 since 2009.09.01, according to this article.

Today I wrote some RTTI (Run-Time Type Information) tests. After compiling it with Apple’s gcc on Mac, I decided to check how it goes with GNU’s gcc on Linux.
I ran my virtual machine, Ubuntu 9.04 (Jaunty), installed on Parallels Desktop 4.0 (for Mac), and tried to copy’n'paste my source code. I noticed it didn’t work, then I figured out Parallels Tools was missing. At this point, I tried to install it, without success. Checking the generated log at /var/log/parallels-tools-install.log, I found the following messages:

Installation of kernel modules was finished successfully
Start installation of user space modules
X Server: xorg, v1.5.0
Install X modules from directory: .1.6
System X modules are placed in /usr/lib/xorg/modules
Error: there is no X modules for this version of X server
Error: failed to install user space applications and drivers

In short, it says the Parallels Tools couldn’t find the necessary modules for Xorg 1.6.0. So I went to the Parallels website and searched for it. Without success again.
What I found instead, was a forum thread relating this exact problem, started in Apr 17, 2009. I read all the pages quickly, and got surprised it isn’t fixed until now. Let’s count… Aug 22 (today) – Apr 17 = ~4 months.
In addition, there’s a KB article about Parallels Desktop 4 and Ubuntu 9.04 support, showing the last review date as Jul, 22 2009.
But when it’s going to be fixed? No timeline, and no progress updates. Concluding, no idea!
Those customers are very frustrated/disappointed, and many are migrating to VMware Fusion or VirtualBox, declaring it isn’t the first time this kind of problem happens.

A temporary fix would be downgrading Xorg to a prior version, but it is totally unacceptable for me.

Few months ago I wrote a jQuery plugin for AJAX file uploading. It’s based on the idea used by WebToolkit Ajax file upload.

The code is here.

How to use it?

$(document).ready(function() {
	$('#your_form_id').uploadForm('your_upload_script', {
		'onStart': function() {
			alert('Uploading...');
			return true;
		},
		'onComplete': function(data) {
			alert('Complete: '+data);
		},
		'onError': function(cause) {
			alert('Error: '+cause);
		},
		'timeout': 5000
	});
});

How does it work?

  1. Page loads, and the form’s submit event is hooked;
  2. User selects a file, and clicks in the submit button;
  3. The hook function is triggered by the submit event, creates an iframe, and appends it to the document root;
  4. The onStart callback is called;
  5. The form’s target property is set to the iframe element, avoiding the full page reload.
  6. The submit event is executed normally;
  7. The onComplete callback is called after the iframe reload;