2011/06/24

phpmyadmin cannot import - ubuntu 11.04

"No data was received to import. Either no file name was submitted, or the file size exceeded the maximum size permitted by your PHP configuration. See FAQ 1.16."

Most of time when you see this error, you can just follow the instruction in FAQ1.16 to make some changes in php.ini, such as file_uploads, upload_max_filesize, memory_limit, upload_tmp_dir, max_input_time and post_max_size.
If all of these does not work for you, then it could be the file/directory permission problem. Check the files under /var/lib/phpmyadmin, there are two files, config.inc.php, blowfish_secret.inc.php, and one folder, tmp. Make sure tmp is writeable by APACHE RUN USER, which can be set at /var/apache2/envvars.

Good luck!

2011/06/23

how to install two firefoxs in ubuntu 11.04

Firefox 5 is out now. My ubuntu has updated Firefox Browser to 5, and it works fine, and I do feel it's faster, but the problem is that some add-ons does not work in the new Firefox. If this is a case for you too, or you just like to have old Firefox in your machine, here is how I did it. 1. Go to Mozilla Old download page at http://www.mozilla.com/en-US/firefox/all-older.html, and pick one and download it. 2. Unzip the file and save it to somewhere, says, /home/adam/firefox. 3. Close the existing firefox, and at your command line, change directory to firefox folder, and then enter the following command
./firefox &

Note that you have close exiting Firefox, otherwise, it will trigger the Firefox 5 not Firefox 3. And you can click the file named firefox to open it, but you have to select RUN, not open it in the text editor.

2011/06/17

Order of ClassPath

You can define multiple ClassPath, like

CLASSPATH=$CLASSPATH:/usr/local/apache/lucene/lucene-core-2.0.0.jar:/usr/local/apache/lucene/src/:/usr/local/apache/lucene/src/lucene-classes.jar:.
export CLASSPATH


But the order of ClassPath is important. Basically it is first come first server, if Java Interpreter find the class in the first class path, then it will ignore the the one in the later class path. See the detail from Oracle java doc

The order in which you specify multiple class path entries is important. The Java interpreter will look for classes in the directories in the order they appear in the class path variable. In the example above, the Java interpreter will first look for a needed class in the directory C:\java\MyClasses. Only if it doesn't find a class with the proper name in that directory will the interpreter look in the C:\java\OtherClasses directory.

2011/06/10

remotely connect from Windows - ubuntu 11.04

Here I would like to introduce two ways to connect to Ubuntu from Windows PC.

1. Remote desktop connection.
You need to enable Remote Desktop in Ubuntu, just open application named "Remote Desktop" and change some preference, which is straight forward. And then you need install a VNC viewer software in your windows pc. I use TightVNC and it works just fine.

2. SSH
You need to install ssh server in Ubuntu by running the following command,

sudo apt-get install ssh

And then you can use putty in Windows PC.

2011/06/03

Change archive date format - wordpress 3.1.2

Cannot believe it, but I could not find it in the dashboard to change archive date format. The wordpress I have installed is English version 3.1.2, and date format of archive is "mY", like "June 2011". If you like to show it as 2011 June, beside writing your own get archive function, only thing you can do I think is change source code. I know it is very bad idea, but anyway, if you have to change the formate, here is the solution, Go to "/wp-include/general-template.php", find this line,
$text = sprintf(__('%1$s %2$d'), $wp_locale->get_month($arcresult->month), $arcresult->year);
And change it to
$text = sprintf(__('%2$d %1$s'), $wp_locale->get_month($arcresult->month), $arcresult->year);
 
If you also want to change the date formate on archive page title, then find this line,
$result = $prefix . $my_month . $prefix . $my_year;
And change it to
$result = $prefix . $my_year . $prefix . $my_month;