Thursday, July 26, 2007

Royal Fight

The blog world now is buzzing with Raja Petra Kamarudin aka RPK's 8 hour interrogation in Dang Wangi and his strong defiance over it. Kisah Malaysia semakin menarik... If you are right, you don't have to be scared, right?

What is more interesting is I found RPK who is royal blood fighting for Malaysia, which is truly uncommon among royals. So far I personally met one Tengku who is also fighting very hard for human rights in Malaysia. Although they are considered 'minor royals', but nevertheless still royal blood. Kudos.

Minor note:-
My office colleague threw me a belated birthday party in KFC today. Thank you very much guys. Tapi, I think I am getting too old for parties. Just give me a BMW would be fine. 

Tuesday, July 10, 2007

Installing PHP 5 & Apache 2 on Windows Vista

I wanted to use IIS 7 with PHP, but just couldn't get it right. I tried all solutions, installed the ISAPI extension, run the mapping script - zitto. After hours of trying I gave up. Screw it. 

So I decided to install Apache. Thinking it was an easy task... but no sir, it was equally time consuming. I just don't understand why. After much tinkering, finally got it to run. 

No, I refuse to use those all-in-one installers. No WAMP, XAMPP and etc for me.

Before you begin, this is a good site to refer to http://wamp.corephp.co.uk/index.php.

Who those who might be in the same predicament, here is the steps that I took:-

Step 1: Download PHP and Apache
Step 2: Install
  • Unzip the PHP zip file. You can store is anywhere, but the usual practise is C:\php. But its up to you. 
  • Once done, now run Apache setup file. For installation steps - http://wamp.corephp.co.uk/step_07.php 
  • For Apache, you can run it as service using port 80 or via console using port 8080. Its up to you. I am using console since I still need the stupid IIS to run .Net. 
Step 3: Configure
  • Now, go open the C:\php folder. Rename the file php.ini-recommended to php.ini. Open the file. Look for the value "doc_root". After the "=" sign, type this "C:\Program Files\Apache Software Foundation\Apache2.2\htdocs". This will tell PHP to look for the web files at the mentioned folder. You can always change the path. 
  • Now save the file. You can do the other tweaking later on.
  • Open your Windows Explorer to "C:\Program Files\Apache Software Foundation\Apache2.2\conf\default". 
  • Rename the file httpd-win.conf to httpd.conf. Open the file in notepad or any editor of your choice.
  • Now comes the part that caused me the most headache. Telling Apache to parse PHP. 
  • Look for within .conf file for DSO. Under it there will be a bunch LoadModule statements. Just on top of the first statement, type this
  • # PHP5
    LoadModule php5_module "c:/php/php5apache2_2.dll"
    PHPIniDir "C:/php"

    AddType application/x-httpd-php .php
    AddType application/x-httpd-php-source .phps
  • Next look for the value DocumentRoot. Make sure it looks like this - DocumentRoot "C:/Program Files/Apache Software Foundation/Apache2.2/htdocs"
  • Now save the file and copy the file out to "C:\Program Files\Apache Software Foundation\Apache2.2\conf" folder level. 
  • Almost there... now depending on your Apache setup earlier, try this http://localhost/ or http://localhost:8080/.  You should be welcomed with "It Works!" message. 
  • Make sure Apache is running. If your running console, use the CMD command and "cd" to "C:\Program Files\Apache Software Foundation\Apache2.2\bin" and type httpd. Don't close the windows, its your web server running!
  • Now the acid test. Create a php file with the following syntax

    <?php

    phpinfo();

    ?>

    Save it as phpinfo.php in C:\Program Files\Apache Software Foundation\Apache2.2\htdocs. 
  • Now run again http://localhost/phpinfo.php or http://localhost:8080/phpinfo.php.
  • You should be able to see all the PHP config information. 
  • If you don't, then probably there is some PHP or Apache config error. Good luck!

Sunday, July 08, 2007

Fitness First Review : Menara Maxis

FF is located on the 3rd floor of Menara Maxis. Menara Maxis is located just beside KLCC. If you live in KL and don't know where is KLCC, I strongly suggest you find out where is it and jump from the top.
  • Parking, you must be either very rich or insane to park in KLCC. For the rest of us, park at Avenue K. Its much cheaper. Weekends its a flat rate of RM 1. I can't remember on weekdays, but its not that expensive.. probably RM 2 for the first hour.
  • Avenue K is connected to KLCC via the tunnel. The tunnel connect the KLCC LRT station to Suria KLCC. Either that, you can cross the street at the zebra crossing.
  • Security is tight, so handover you IC or FF membership card to the security personel for registration purpose. You will get an access card in return. Scan it at the turnstile.
  • There is a dedicated lift for FF here. Its the first one on your right. 3rd floor.
  • Recently FF installed a turnstile, so you gotta swipe your membership card again before entering the gym.
  • Well as you enter, you first hit the receptionist table. I don't want to comment much here, you go yourself and judge.
  • Men changing room is on the left and the ladies on the right as you enter.
  • 2 floor split.
  • Changing room is OK, clean. Lockers look pretty old. The funny thing is the shower room. They have this tall glass shower room and yet, no hooks. How to hang lah?
  • Cardio is fun here, all the machines are facing the window. So you can run, huff and puff while looking at the KL traffic + the construction work of Four Season. Enjoy.
  • Some cardio machine, have this funny 5" LCD monitor. Lots of treadmill.
  • Machines, I would say they have a complete sets of machines. They have those elusive machines such as glutes, calves and etc. Double of lateral pull down, rows, pulldowns... thumbs up!
  • Now for those hardcore guys, your place is upstairs. The freeweights area is not the big, but big enough. 2 bench press machines, 1 smith machine and a 4-5 work bench. However the machines here are like in Manulife. Looks like hardcore Muscle Beach benches.
  • Dumbbells can be limited at some time if there is a crowd.
  • There is a quiet gym room for those looking for solidarity. Quite a large room.
  • Chicks - this one no need to talk so much. Your center of KL, you know there will be hot mamas around.
  • Only one thing I dislike is the abs area is under the staircase. You are like crunching and then you get to see people's ass chugging up and down the stairs. Come to think of it, its not that bad at all...

Ratings?

Check out for more reviews below
FF Island Plaza
FF Manulife
FF IOI Mall Puchong
FF Menara Axis
FF The Curve
FF DU
FF Consplant

Installing Ruby on Rails on Windows Vista

Ruby? Rails? Keretapi Tanah Melayu? Doesn't make sense? http://www.rubyonrails.org for explanation.

If you are new to ROR and want to find out about installing it on Windows, here it goes.

Before that, here are some other tutorials for your reference.
But the above URL uses those all-in-one installers. I hate those all-in-one installers. Where is the fun? So, this tutorial is for those developers who are looking to install each package separately.

Actually the steps are outlined at http://www.rubyonrails.org/down. Just follow them. Also, I didn't thought of screen capturing the installation. So most of the steps here are text based.

Step 1: Downloads all the necessary stuff

Step 2 : Install
  • Run ruby186-25.exe. It will do all the installation. Just sit tight. Once its done, go to your search box and type in cmd. Once the command prompt screen pops up, type this "cd c:\ruby\bin" (I assume you have installed Ruby in C drive). Then type "ruby -v". If you have installed correct, it will show the version. If not, you have to reinstall Ruby again.


  • Excellent. Now lets install RubyGem. Unzip rubygems-0.9.4.zip. Click on setup.rb. The setup will run in command window.
  • Once done, now you need to run post-install.rb. This will create the RUBYOPT environment variable to the value rubygems in Windows. More information at http://docs.rubygems.org/read/chapter/3.
  • Well, we are done with RubyGem, now Rails. Open the command prompt window. Type "c:\ruby\bin ". Now type this "gem install rails --include-dependencies". What happens now that it will fetch the latest Rails framework from http://gems.rubyforge.org/ .
  • Don't worry if its slow and looks like its hanged, its downloading. There is a standalone package, but I haven't tried installing it that way. Once done you will see the screen as below (look at the 3rd last line in the screen):-

Step 3: Create and Run!
  • To create your application, open up the command prompt. Assuming its at D drive, type "D:\", then "mkdir projects", then "cd projects", then "rails myfirstproject". (You can replace the word "myfirstproject" with any words of your choice. Rails will create all the file structure for you.
  • Then type "cd myfirstproject" if you are not in the newly created directory. Then type "ruby script/server". This will boot up WEBrick web server. Btw, don't close this windows as it will shutdown your webserver.
  • Type in http://127.0.0.1:3000. Tada! You have your Ruby application up and running. Well almost....

  • There are additional steps, however you can refer to section IV of http://allaboutruby.wordpress.com/2006/01/09/installing-rails-on-windows-step-by-step-tutorial/.
Enjoy your ROR!