Sunday, September 30, 2007

Troublesome mod_rewrite

To enable the rewrite_moddule in apache is easy just do this

a2enmod rewrite

to disable it is

a2dismod rewrite

in command line after that you have to restart apache by /etc/init.d/apache2 restart. But... wait a second here ... I did all these but my Habari install was still not OK.   I have the blog and first entry correctly displayed but none of the links in the blog was working.   It must be a rewrite_rule issue, i.e. rewrite module wasn't working.    phpinfo() doesn't tell me the correct fact as well.   It was a particular apache issue with ubuntu.

I googled this (a good post here and there) and eventually found that file 000-default in /etc/apache2/sites-enabled has to be edited to set AllowOverride All    The proper way I think is to add below lines between Directory tags.

[Directory /var/www/habari/ ]
AllowOverride All

where 'habari' is the subfolder where you want the mod_rewrite magic to work. I guess there are still a lot of Apache I need to know.

Another domain name is going

I have emailed my first class classmates and received no response as to whether I should be keeping this domain name

I did get an email back asking me cost of keeping the name as he is considering using the name to polish his web authoring skill.

This name will be going in few weeks time. I really don't have time in the near future to upkeep so many sites. I have reduced mine to basically this site and another one solely about programming.

Thursday, September 27, 2007

3rd attempt works

In the last few days I had to do 3rd installation of ubuntu.    It was too greedy of me attempting to change screen resolution again.   It was simply not possible because if the VIA/S3 display couldn't display 1440x900 in Windows it won't do it in ubuntu.

Anyway it was good to have another practice of installing LAMP stack.   The only new experience was the installation of phpmyadmin who took me a while.

I checked that mod_rewrite and PDO driver for mysql were there before I attempted installation of Habari.    It didn't work to my surprise.    Later found that it was a broken revision, I updated mine to r940 then it was OK.    I also installed the latest svn r6173 of WordPress.   This is pretty new for WordPress.

Monday, September 24, 2007

Install subversion

In order to check out source code I need to install subversion, this is done by

apt-get install subversion

Follow instruction in here to check out the latest revision.

Running MySQL server

I thought I have my MySQL server installed by Synaptic Package Manager but in fact I haven't.   I was trying to log into the sever via phpmyadmin but couldn't.  Tried again via command line using

/etc/init.d/mysql start

but failed.   Decided to install it again by command line

apt-get install mysql-server mysql-client php5-mysql

Bingo, I got it finally I could login by username = 'root' and password = 'nothing'.

Wubi - Easiest Way

I have a Toshiba R100 notebook which doesn't have CDROM drive.   It'll be troublesome to try Ubuntu in it using methods in Pendrivelinux via USB thumb drive so I might try Wubi which is called Easiest Way to Linux.

Wubi enables you to install and try Ubuntu like a typical Application in Windows, i.e. you can see it in Add/Remove program in Windows Control Panel.   If I'm happy it then I could transfer the installation using LVPM thereby without the use of a CDROM drive.

Saturday, September 22, 2007

The domain name is gone

I planned the house move a while ago and as of today the domain name I once used for this site has gone so I'm here for good I hope.

Friday, September 21, 2007

Problem with switching display

I took the PC home and connected it up to my new ViewSonic 19" widescreen which requires best resolution at 1440x900.   Too bad I don't have that choice so it was looking bad.

I then switched back to another even older CRT EIZO F35 at home.   I could get 1024x768 so that is barely OK for my eyes.

I just don't understand why every time I switched display the set of resolution choices will change.    The may be due to the autodetect feature of xserver which doesn't offer choices if the display doesn't support it.

Updates are now done, am now wondering if I should upgrade to 7.04 Feisty Fawn.   Next step would be enabling mod_rewrite at the apache and making sure if I have the PHP PDO driver (according to this article I should have it already) for mysql before I attempt installing WordPress and Habari.

Thursday, September 20, 2007

I got Ubuntu Running at last

Tried the FixVideoResolutionHowto, run the Autodetect script again by below lines

sudo cp /etc/X11/xorg.conf /etc/X11/xorg.conf.custom
sudo sh -c 'md5sum /etc/X11/xorg.conf
sudo dpkg-reconfigure xserver-xorg

didn't work even made things worse GNOME can't even show.   I have a black screen.   Tried also restarting xserver by pressing CTRL-ALT-Backspace, didn't work either.

Found that my display card is VIA/S3G with 64M and it's not too old.

At the end I loaded the LiveCD again and found that it could detect the correct display resolution for the LCD HP L1706 I used.   May be the SONY Multiscan E200 is really too old.

I have now reinstalled Ubuntu on the same partition, for the 2nd time, and got Apache2, mysql-server and phpmyadmin etc installed using Synaptic Package Manager.   The server is running fine.   I took awhile to locate the document root as it isn't under the apache2 folder.    It was a bit difficult to locate it under /var/www/

Now I have trouble downloading 184 updates, I see what I can do next.

Wednesday, September 19, 2007

Installing Software

Installing software in Linux or Ubuntu is not as straight forward as in Windows first of all I have to read this.

There are comments in the forum that running development environment using XAMPP is a bad idea and since it's a Linux box I should be installing LAMP from the Ubuntu distro.

Linux here I come

I brought books that stay on shelf that never get read, Linux is one of them.   My RedHat 7.0 book was published in 2000.

7 years is a very long time, today I have installed ubuntu on a slow PC.    The installation was smooth and the boot manager like start page is a good design.   It doesn't fear newbie from Windows away and my old XP SP2 is still intact I think.

One problem was that I immediately regretted to have installed desktop 6.06.1 LTS instead of the server version.   What I really wanted is LAMP to test run Habari.

Another issue is the screen resolution.   I'm using an very old SONY multiscan E200.   No matter what I do the resolution stays at 1600x1200 I can't get it switched to 1024x768.   I'll have to try this Fix Video Resolution Howto later.    May be that CRT monitor is too old to be detected correctly during installation.

Monday, September 17, 2007

We are the Champions

Champions we were at that lucky number table last night.

Technology was the sector that hosted that 58th National Day Gala dinner last night and we were thrilled, as usual, not at the food but the lucky draw.   There were only 12 grand prizes and out of nearly 50 tables (didn't count at least this many I think) we grabbed 3 prizes, that was 25% of all.

I went to this dinner for 4 straight years and this was the best. The sound level was still intolerable but the joy and laugh have surpassed it.

I can't post any photos for obvious reason, i.e. I didn't take any prize home.

Sunday, September 16, 2007

Plugin activation issue, improvement on publish.php

I have posted issue 408 about plugin activation/deactivation problem.    One other user has indicated experience of similar behavior on some plugins.

I did a quick mod to admin/publish.php such that I could easily get back to the entry I just edited, here it is

if ( isset( $result ) ) {
switch( $result ) {
case 'success':
echo '[p class="update"]' . _t('Your post has been saved.') . '[br /]';
if ( isset( $slug ) ) {
$post= Post::get( array( 'slug' => $slug, 'status' => Post::status( 'any' ) ) );
echo [a href="'.site::get_url('habari').'/'.$post->slug.'">Return to post[/a][/p]';

Skippy confirmed that this isn't a bad idea but at present user/classes only overrides files in system/classes but not those in admin/.

It would be ideal for user to have, after the entry is saved successfully, to have links going back to the entry or the page when it was first directed from.   Perhaps something like a hidden field.

[input type='hidden' name='redirect_to' value='$_SERVER['REQUEST_URI']' /]

Haven't tried this out but this may work.

Friday, September 14, 2007

The customers that haven't showed up are more important

I took a day off just to submit few more tenders to this, this and that school.   It was a pleasant day with blue sky and mild breeze.     The route was specially designed by my dear so after that we went to the peak for a relaxed lunch.

We went to the Chinese dim sum restaurant at the top floor, not too surprised it was empty.    We were taken to a little corner at the highest level I have no doubt that must be the best place with the best view.    The corner there has 4 x 4 persons table and 2 x 2 persons table.    There were already 2 persons occupied one of the table.    We were told to occupy the other 2 persons table.

What do they have in mind?    It's a norm here, from my experience, that captains in restaurant would train staff to reserve tables to customers yet to come, e.g. if we have taken a 4 persons table what if there are few 4 people groups coming after us?    This doesn't appear to be a wrong concept.    Have they ever thought of what we were expecting in such circumstance?     Do they expect us to sit elbow to elbow with 2 strangers at the best corner at the peak of Hong Kong that we have to pay good dollars on a sunny relaxed afternoon accepting the idiot's decision to have our privacy sacrificed?

What they should have done is the opposite, i.e. assuming every customer that arrives at the doorstep to be their last VIP that working day.   At the end there were only 1 more couple arrived at that little corner who happened to be someone I know.    It was OK to eat in that empty place if not because of the wrong sitting at the beginning.

Isn't this normal?    We also believe that the parking space that we didn't get is better, the school that didn't enroll my boy could have been better, the rice cooked next door smells nicer (saying here), the customers yet to come are more important...!

There was a parent sharing session at my boy's kindergarten yesterday evening.   A lot of parents warned us not to push kids to a school which is reputable instead put them in a school which is suitable.    Reputable school is what you see from the outside.   A suitable school is something that fits the inside of your kids.

4,000 download

The 3,000 download was dated June 29, 2007 today there are 4,015 downloads.

As usual a summary

Barebones series templates = 1,288 (125%)

ezLogin plugin = 1,541 (132%)

Sunrise/Sunset templates = 552 (127%)

ezCount plugin = 326 (129%)

Habari plugin/template = 308 (226%)

I have added this time a % increase since last report.    I can see that downloads for Habari are increasing sharply.

Theme DarkHalf is done, sort of

I have now used the DarkHalf 0.35 theme at Not So Wise so this site is returning back to 'Round Box 0.45'.

The Feedburner subscription has the wrong address I still have to fix that. I have done a couple of themes now so I said at the user-group that I hope someone would do theme switcher plugin such that I could easily preserve the themes I did.

I lost count actually I think I have done these

  1. Barebones

  2. Classical

  3. Roundbox

  4. DarkHalf

Wednesday, September 12, 2007

Training vs Education

I'll be sending my boy to Primary school next year so there is a lot of preparation work this year.    To name a few I have to do market research, run around to all these schools attending seminars, fill up forms and possibly interviews.

I don't really know if effort is worthy for my boy.

I have attended seminars here and there so far.    These seminars are just marketing show by the headmaster, nothing more than that.    The good thing about it was that I now have a feel from their speech, gesture, answers to questions as to how they run their school and most importantly their 'value system'.   That is better than reading their prospectus and comments from other parents.

I don't think my boy could ever get into any of these so called top schools which probably doesn't matter much to me.

To me primary schools provide training rather than education due to very restrictive syllabus and the general perception that examination grades are only yardstick of achievement.

Albert Einstein once said

The only thing that interferes with my learning is my education

I can't agree more and would add " can only learn outside the schools...".

Tuesday, September 11, 2007

Function to show recently posts

The little template function that I wrote here turns out to be wrong.    I was trying to improve it by showing entries say a year ago.    This blog is too young so I tested that in my main blog.    I got wrong results displayed.

I found that the parameter I used in the Posts class was wrong hence I wasn't getting all the posts in the database.    It's now working here as I could check if this function is giving correct results.

There are actually 2 functions one for recent 2 weeks and another for 'a year ago'.   May be I'll merge them together as a single one to make theme files easier to manage.

Monday, September 10, 2007

Not So Wise

It's amazing that how ideas come to my mind.    I read books and in most cases I read them to kill time.

I was actually deliberating about dropping my domain name in my bed one morning then I decided I need a new blog title once I have moved my content.    This name "Not So Wise" came to my mind.    We are at all time in search of wisdom and until the end of time I don't think we'll find all the answers.    I read this somewhere that to seek one has to admit deficiency.    I want to say here "I'm really Not So Wise...".

I later found the origin of "Not So Wise" after a little search in my bookshelf.    I found this book "Why I am So Wise" by Friedrich Nietzsche.    I have to say this little book is the hardest English writing that I have ever read.    It's translated of course because the original was in German.

I think it would have been easier if I knew German.    Nietzsche was originally a philologist therefore it could be fun reading his original German words.    I'm far too old to learn a new language.    Even my sister has given up learning after she married to a German born American.

Friday, September 7, 2007

Now I can post from a desktop client

One of the important feature of any blogware is to allow users to post from a desktop client.   Now Habari can do that by a plugin.

This post is sent from Windows Live Writer.

Wednesday, September 5, 2007

Moving site, again?

Yes, I'll be giving up this domain name very soon.

Content of this site has been moved to Not So Wise so bookmark this one from now on. I suggest you subscribe by email such that new post, when there is one, will be delivered to your inbox.

Why am I moving again? Well partly because of the new blogware Habari that I'm using. Also this domain name is expiring in few weeks so I could save a few dollars, don't believe this right?

I think I'm also in search of an identify, this could be a long story. I'm stuck with this is the domain name that I firstly signed up with Site5 some 2 years ago so unless I'm quitting them I can't change this name. I owned a name for a while and I have used this as the blog title for nearly 2 years. Then finally I got this which I thought this is my real identity but is it?

I'm obviously still searching, for the moment my new site is named "Not So Wise". More writing about this name at the new location.

See you there!

Move content between domain names

Following Tinyau's advice I have now moved content from my main site to a new subdomain Not So Wise.

Here are steps that I have taken

  1. check out latest r821 to desktop

  2. move existing installation folders at old site to ...\old\

  3. upload r821 files and folders to old site, kept just config.php and .htaccess
  4. empty rewrite_rules tables

  5. point browser to old site, let the scripts do the job making sure it's running OK at r821
  6. create new subdomain at Site5 backstage

  7. upload r821 folders and files to new site installation folder

  8. create a new database for the new installation at new site

  9. grant user permission to new database

  10. run habari installation at new site

  11. export database from old site, must check 'DROP TABLES' and 'IF NOT EXISTS' options during export, in my case it was a 1.8Mb zipped file

  12. import database to new r821 installation

  13. new site is now running here

I have also burnt a new FeedBurner feed for it and a new Analytics account.

There are few hiccups when I activated plugins. I kept on getting "...Whooops!..." when I activate or deactivate plugins and I got redirected to .../admin/plugin_toggle.

Tuesday, September 4, 2007

Bear with me

This site will be in a mess for a little while.

I have deactivated all plugins, activated this default theme K2. Further steps will be

  • upgrade this site to the last svn revision, if this is still healthy then

  • export the database

  • move content to another domain name

If everything is smooth I may consider giving up this domain name which is expiring soon.

Saturday, September 1, 2007

Improved DarkHalf layout

The dark part has 3 columns. I have now made 2 of them fluid, the middle and the right hand columns.

To do that I need an additional box wrapping these 3 columns. This box is placed inside the existing 'darkhalf' id, it's like

.inside {
margin:0 auto;

In the footer.php the new class is added

Now below is the modified CSS for the columns

#right {
width: 32%;
margin:0 1% 0 1%;
#left {
width: 23%;
margin:0 0% 0 0%;

Note that all of them are 'floated' left whereas in the last design I have the right column floated right. The trick is the 'min-width' and 'max-width' of the class 'inside'. This allows the middle and right columns to expand to the right while you drag the browser edge to the right. The left column which I have put static information is left more or less unchanged visually due to its relatively smaller % (23 vs 32+32) even if broswer is dragged.

This is a much better design originally found in the famous WP theme Hemingway.