July 2006


I feel that it’s time to get my SQL back gradually after building a Webserver. Again, from the very beginner level — to the geek! (I’M NOT A GEEK AT ALL, TO BE REMEMBERED PLEASE!! Actually I think that everything if I start to addict to, it only takes me several days to ramp up from a beginner level to top level! That’s really true! :)  )

Basically there are three basic categories of SQL Statements:

  • SQL DATA STATEMENTS (query and modify tables and columns)
    • SELECT Statement – query tables and views in the db
    • INSERT Statement – add rows to tables
    • UPDATE Statement – modify columns in table rows
    • DELETE Statement – remove rows from tables
  • SQL TRANSACTION STATEMENTS (control transactions)
    • COMMIT Statement – commit the current transaction
    • ROLLBACK Statement – roll back the current transaction
  • SQL SCHEMA STATEMENTS (maintain schema)
    • CREATE TABLE Statement – create tables
    • CREATE VIEW Statement – create views
    • DROP TABLE Statement - drop tables
    • DROP VIEW Statement – drop views
    • GRANT Statement – grant privileges on tables and views to other users
    • REVOKE Statement – revoke privileges on tables and views from other users

Playing around With the OracleDB10 for a while, I used the following SQL commands:

SQL select, distinct, where, and, or, in, between, like, order by, count, group by, having, alias, join, minus, outer join, arithematic functions such as AVG, COUNT, MAX, MIN, SUM.

Is it deep enough? No…Back to digging…

早上醒来,看到Videotron的工作人员已经把电视调好,HDTV效果不是盖的,尤其是清晰无比的电影台,看来我没有白花时间去选台,当然,把钱交足,你得到的服务和享受也绝对一流!酷毙了!

打开我的笔记本,看到我的博客排名在TopBlogue居然上到第30位,感觉爽呆了!从来没有一种感觉如此美妙!看来我今生不能和blog说再见了!

今天感觉很好,开着HDTV,看着自己的博客排名,觉得自己的状态已经调整得差不多了,伤口基本上愈合,一切从头开始,我决定——放飞在八月!

Présentment, je suis entrain de faire la décision de publier mon premier roman progressive par le biais d’internet parce que je pense que c’est un façôn qui peux l’améliorer peu à peu étant donné que je ne suis pas un écrivain. Par ailleurs, je peux faire le modification facilement et peut-être un jour je vais faire le chois de le publier en papier… :)

Having finished the article about building webserver on Linux. I am back to be in the mist of searching PDA, here they are:

1. HP iPAQ 128MB Pocket PC (HX2410)  (469.99). 520MHz Intel PXA270 Processor, 128MB (64MB SDRAM), Wi-Fi (802.11b), bluetooth, Serial IR, looks cool, but still, I am not satisified with the memory, and I think I like PDA more than Pocket PC (maybe because of Jack Bauer…:))

2. PalmOne LifeDrive 4GB Mobile Manager Handhelo – Multilingual  (448.97$). Intel 416MHZ Xscale Processor, …looks good, but I should make sure if it supports Wi-Fi and Blue tooth.

3. Treo 650  (99.99$ with Telus 3 years contract). Sam told me that this is the one Jack Bauer used in 24 hours. But I think the screen a bit small and I like most is a PURE PDA like Palm TX…and I want to make a phone call by using a PURE CELLPHONE, I think that’s COOL in my mind!  Hmm… anyway, it takes time to find a one fit me in both function and price. However, I won’t let it be long!

PS – Tim has sent me the info about a water park…we’ll go soon…I think I need some water to “clean” myself completely! :) I will get refreshed shortly!

1. Go to /opt/sysconfig (#cd /opt/sysconfig)
2. edit file named i18n (#gedit i18n)
3. This is the original file:

LANG=”en_CA.UTF-8″
SUPPORTED=”zh_HK.UTF-8:zh_HK:zh:zh_CN.GB18030:zh_CN:zh:zh_TW.Big5:zh_TW:zh:en_CA.UTF-8:en_CA:en:en_US.UTF-8:en_US:en:fr_CA.UTF-8:fr_CA:fr:fr_FR.UTF-8:fr_FR:fr”
SYSFONT=”latarcyrheb-sun16″

4. I changed it as follows:

#LANG=”zh_CN.GB18030″
LANG=”en_CA.UTF-8″
LANGUAGE=”en_CA.UTF-8″
LC_CTYPE=”zh_CN.GB18030″
LC_TIME=”en_US.UTF-8″
SUPPORTED=”zh_HK.UTF-8:zh_HK:zh:zh_CN.GB18030:zh_CN:zh:zh_TW.Big5:zh_TW:zh:en_CA.UTF-8:en_CA:en:en_US.UTF-8:en_US:en:fr_CA.UTF-8:fr_CA:fr:fr_FR.UTF-8:fr_FR:fr”
SYSFONT=”latarcyrheb-sun16″

5. Restart the computer.

PS: everything looks good, using ctrl+space I can switch between ENG and CHN. One minor thing is that I wanna get french involved. Well, it’s not that I’m completely fluent in French, but I just wanted to be able to type a few things from time to time, so I had to  get goint and play around with my favorite Linux (I think I have gotten addicted to Red Hat…need a break…) …and Eventually I figured it out and here are my tricks!

Startx in Linux, there is a small tool called “Character Palette” which you can add to the bottom panel. It provides a convenient way to access accented characters, special symbols, etc. Now I can work on Linux freely! C’est tellement cool :) Maybe there is another way to fix it, tell me if you do have.

Après avoir arrivée chez moi, j’ai allumé mon laptop et ouvert mon page de google. J’ai trouvé dans mon “Daily Horoscope of Leo” section:

Unlike typical impatient Leo behavior, you have been waiting for the right moment to push your master plan forward. And even though you might feel that little or no progress has been made in the past few weeks, now it’s time to shift gears and take action. Although you may be past the point of no return, be persistent for it still could take a few days to find your rhythm.

Wow, c’est super! :D  S’accord ma situation parfaitement! Je viens de rencontrer un amie qui me souhaite tout va bien…Peut-être le dieu m’écouté ma prière…Lisant les mot en haut, je n’ai pas le coeur lourd; l’affaire qui me tient à coeur ne m’a pas dérangé beaucoup. Ça souffrance qui ne guérit pas sera été guéri bientôt. Come on…c’est l’été, on doit le profiter! 8)

Dreaming of blogging on my own Web Server, studying for a while, I started to build my own Web Server. The linux distribution being utilized for this tutorial is Red Hat Enterprise Linux 3, however the steps should be very similar across most distribution. Be sured that you have the required development tools loaded for compiling programs from the source, these tools are beyond the scope of this doc and will not be covered here. In addition, it assumes you can use a text editor (e.g.: gedit, vi, emacs, etc) for basic editing tasks. Are you ready? — COOL! Here we go! :)

1. Grab 3 Sourcecode

2. Installation

Beginning now we will be working as root, sitting on a big sofa….with a cigar, ….change to the directory in which you saved your downloaded files and iyou can use su command f you want to become root, okay, then type the following comands:

# tar xzvf httpd-2.2.2.tar.gz (enter)
# tar xzvf mysql-4.0.27.tar.gz (enter)
# tar xzvf php-5.1.4.tar.gz

Having done these, now lets move on to compiling the source into usable programs. We will start with Apache.

3. Compiling Apache – follow these commands by typing:
#cd httpd-2.2.2 (enter)
#./configure –prefix=/usr/local/apache2–enable-mods-shared=most (enter)
(This telles Apache to install in the /usr/local/apache2 directory and to build most of the available loadable modules. Well, of course you have a bunch of options with Apache, but these should work for the most part. Once the configuration is done and the system returns the prompt to you, type the following command)

#make (it takes me several minutes, issue the following command once the prompt comes back again)
#make install
(Me voila Apache is installed! Bravo!)
We still need to make a few minor changes as follows:

# gedit /usr/local/apache2/conf/httpd.conf
or # emacs /usr/local/apache2/conf/httpd.conf
or # vi/usr/local/apache2/conf/httpd.conf

Then check the following line is present in the httpd.conf file at the bottom of the LoadModule list, add it if it is not there;

LoadModule php5_module modules/libphp5.soNote if you download php 4.x.x you should change as:
LoadModule php4_module modules/libphp4.so

Find the DirectoryIndex line and edit it like the following;

DirectoryIndex index.html index.html.var index.php

Find the AddType application section and add the following line;

AddType aplication/x-httpd-php .php

C’est tout! Save the file and we are done with Apache part. Let’s move on to MySQL!

4. Compiling MySQL
#cd mysql-4.0.27 (enter)
# ./configure –prefix=/usr/local/mysql –localstatedir=/usr/local/mysql/data –disable-maintainer-mode –with-mysqld-user=mysql –enbale-large-files-without-debug (enter)
#make
#make install

Note that the above commands you may not need if you have downloaded mysql recently cause the current one is ready-to-run version.
Now let’s create a group for MySQL as follows:
#/usr/sbin/groupadd mysql (enter)
Now let’s creat a user called mysql which belongs to the mysql group;
#/usr/sbin/useradd -g mysql mysql (enter)
Then we install the db files as follows; (you might not need this step if you use the ready-to-run version)
#./scripts/mysql_install_db (enter)Okay, then we make some minor ownership changes;
#chown -R root:mysql /usr/local/mysql (enter)
#chown -R mysql:mysql /usr/local/mysql/data (enter)
still, using emacs/vi to add a line the ld.so.conf file as follows:
#gedit /etc/ld.so.conf
Adding the following line:
/usr/local/mysql/lib/mysql
We are done! MySQL is installed! To run it, just issue the following command:
#/usr/local/mysql/bin/mysqld_safe –user=mysql &

the following command is optional, you can set a root password for MySQL as follows:
#/usr/local/mysql/bin/mysqladmin -u root password new_password
where new_password is the password you wanna use.

Okay, last monster-PHP!
5. Compiling PHP

(To be continued–Après la pause…)

Friday, July 28, 2006

Attention: yesterday I found that PHP 5.1.4 doesn’t fit for my current environment, it needs more high version of xm..stuff  :x . So, I downloaded php 4.4.2 instead. C’est super! :)   Okay, follow me to compile php 4 by typing:

#cd /opt/php4.4.2 (enter)
#./configure –prefix=/usr/local/php –with-apxs2=/usr/local/apache2/bin/apxs –with-mysql=/usr/local/mysql (enter)
#make (enter)
#make install (inter)
Okay, grab a beer for a while till you have the prompt back, then type:
# cp php.ini-recommended /usr/local/php/lib/php.ini (enter)Then edit that file;#gedit /usr/local/php/lib/php.ini (enter)

And change the following: 
Find the doc_root section and enter the correct path for the directory which serves your web content such as:

doc_root= “/usr/local/apache2/htdocd/”

(this is default for apache2) Then find the file_uploads section and change it to reflect the following (for security reasons):

file_uploads=Off

Wonderful! C’est fini! Let’s test!

6. Testing
Use ps command to check if your MySQL process is still running from earlier, if not, start it again! Then we need to start Apache by issuing the following command which starts the Apache web server:

#/usr/local/apache2/bin/apachetl start (enter)

now change into the following directory and using gedit create a file called test.php:

#cd /usr/local/apache2/hotdocs (enter)
#gedit test.php

and add the following line to the file:

<?php phpinfo(); ?>

Save the file, then open a browser (firefox) and point it to /localhost/test.php. You should see a listing of all kinds of cool info about PHP, Apache, etc. Now, I end up my first time fully functioning setup. However, during the whole setup process, I got some problems and I figured them out, so hopefully you don’t have so much troubles, if you do have, then GOOGLE or ask me, I will try my best to help you. :mrgreen:

Okay, let’s do something to celebrate, BBQ, having some champagne…Yeah we made it!

Well, now we have everything running now, the only minor problem is that we have to start Apache and MySQL manually, I’m a bit lazy and I do not want to have to remember to do everytime I reboot, so I wanna fix it. I found a way which is pretty good, but it seems that I need a while to get it done! Hopefully tomorrow I can work it out.

7. Starting Apache and MySQL automatically

July 30, 2006

Finally, I made it. Let’s start with MySQL. Logging in as root and with the mysql directory we set earlier.
#cd /usr/local/mysql/ <enter>

then copy the file mysql.server to the directory /etc/init.d as follows;
#cp support-files/mysql.server /etc/init.d/mysql

Now, let’s create some links in the startup folders fur run level 3 and 5;

#cd /etc/rc3.d <enter>
#ln -s ../init.d/mysql S85mysql <enter>
#ln -s ../init.d/mysql K85mysql <enter>
#cd /etc/rc5.d <enter>
#ln -s ../init.d/mysql S85mysql <enter>
#ln -s ../init.d/mysql K85mysql <enter>
#chmod 755 mysql <enter>
We’re done for MySQL, it should start automatically now when you reboot your machine (use ps -ef | grep to check if you want). Now let’s do the same steps for Apache, still, as root and with the apache2 directory configuration as we did before.

#cd /usr/local/apache2/bin <enter>
#cp apachectl /etc/init.d/httpd <enter>
#cd /etc/rc3.d <enter>
#ln -s ../init.d/httpd S85httpd <enter>
#ln -s ../init.d/httpd K85httpd <enter>
#cd /etc/rc5.d <enter>
#ln -s ../init.d/httpd S85httpd <enter>
#ln -s ../init.d/httpd K85httpd <enter>

Cool! The apache should start automatically along with MySQL the next time you boot your machine.

Well, having done this, I could setup a webserver and to build my WordPress in, and have a powerful blog site later! Yeah! I wrote the whole procedure down because I want to get it noted and hopefully it helps you guys. Ciao.

Reçu un email d’un amie. Elle m’a souhaité Bonne fête (un peu tôt, je pense…)  :razz: et elle a promi qu’on va aller un très très très bon restaurant si je reviendrai à Pekin (trop loin pour moi :evil: ) . Aussi elle m’a demandé quell cadeau je veux et elle va l’acheter. WOW! Nous sommes bon aimes depuis highschool…je me souviens combien de ‘mal’ choses qu’on fait ensemble à cet époque là, comment on fait l’argent ensemble, les joies, les guerres, etc.

Ouais…Ying, mon aime, tu sais combien de fois que je veux te rejoindre!

Pensée mes amis en Chine, J’ai fait un décision: trouver un emploi le temps plein puis travailler fort donc dans mes vacances je pourrai y aller et les fondrai et ferrai les choses CRAZY encore!

偶然间路过一个blog,看到了如下经典语录:

  • 走自己的路,让别人打车去吧。穿别人的鞋,走自己的路,让他们找去吧。
  • 打台湾我捐一个月的生活费,打美国我捐一年的生活费, 打日本我捐他妈的一条命!
  • 我不是随便的人,我随便起来不是人。
  • 骑白马的不一定是王子,可能是唐僧;带翅膀的也不一定是天使,有时候是鸟人。
  • 俺的最低奋斗目标:农妇,山泉,有点田。
  • 日出东海落西山,愁也一天,喜也一天;遇事不钻牛角尖,人也舒坦,心也舒坦
  • 后悔是一种耗费精神的情绪,后悔是比损失更大的损失,比错误更大的错误,所以不要后悔
  • 我不去想是否能够成功,既然选择了远方,便只顾风雨兼程;我不去想,身后会不会袭来寒风冷雨,既然目标是地平线,留给世界的只能是背影
  • 生命中,不断地有人离开或进入。于是,看见的,看不见的;记住的,遗忘了。生命中,不断地有得到和失落。于是,看不见的,看见了;遗忘的,记住了。然而,看不见的,是不是就等于不存在?记住的,是不是永远不会消失
  • 当幻想和现实面对时,总是很痛苦的。要么你被痛苦击倒,要么你把痛苦踩在脚下
  • 鱼对水说你看不到我的眼泪,因为我在水里.水说我能感觉到你的眼泪,因为你在我心里
  • 记住该记住的,忘记该忘记的。改变能改变的,接受不能改变的
  • 读的时候不觉得,有机会体验的时候竟然发现……原来经典也在身边发生

Having seen 24 HOURS (season 5), I expected to get a palm (multilingual) onday. Like Jack Bauer, I can download satellite map to my pda and access somewhere secretly……(dreaming…). Cool! 8) Anyway, I’ve been searching a palm for a while……still cannot find a one fit me. Here I got some products info from palm.com:

  • Palm Z22 (149$) (no email, web access, docs, no expansion slot, no bluetooth, no Wi-Fi, so, GARBAGE!)
  • Tungsten E2  (299$) (Wi-Fi is not built in and just 32 MB memory, maybe a bit out of fashion)
  • Palm TX  (399$) (looks good!support everything, maybe plus a 2GB memory card is perfect! hmm……but look at the price)
  • LifeDrive  (549$) (everything is good but the price)

Bottom line: wait for a second……….. :|

Next Page »