Tuesday, November 11, 2008

Get started with mysql command line

"Command line" has always been a nightmare to me. Bumping into it and you'll find no clue to get out. Well then, we must make things run smoothly before we can see any of its good points over GUI.

You've been in Windows for years, writing, running, even swimming... so you can easily start and master SQL Server in no time. But those were the days. Having Mysql Server installed, I'm now sailing without a working compass. Haizz... Take it easy, we'll get through it, one day... ^_^

If you have SQL servered installed typically, all the things will roll out before your eyes as long as you have the administrative access. USER databases, and SYSTEM databases that store information about the data storage. Well, then, 1st question, where is system information stored in Mysql Server?

Be satisfied by the SYSTEM VARIABLES for the time being. System varaiables indicate how mysql is configured, each has a default value. These values can be set using
- cmd line
- option file

Try this

mysql> show variables;

and this is the results



So it is better that you know what you are looking for, using this syntax:

mysql> show variables like "%datadir%";


Are you wondering how can we know what exactly we are looking for? :D Here, here, some names, for using in another day...

auto_increment_offset
automatic_sp_privileges
character_set_client
character_set_connection
character_set_database
character_set_server
connect_timeout
datadir
date_format
datetime_format
default_week_format
have_csv : YES if mysqld supports CSV tables, NO if not

Mysql Manual is an official (and thus reliable) source to clarify what these names mean. Or just 'show' them and guess, if you like (in fact, i love that 'type-and-see' method rather than looking-it-up in a km-long documentation!)

Thursday, November 6, 2008

Upgrading Perl

Prior to upgrading Perl, it is a good idea to ensure that each module gets carried over to the update Perl version using the "autobundle" CPAN feature. You will need to execute this command via root in SSH:

perl -MCPAN -e 'autobundle'

Once this is complete, you should have the the following outputted before returning to the shell:

'Wrote bundle file /home/.cpan/Bundle/Snapshot_2007_08_16_00.pm'

Make a note of the filename before proceeding with the update.  

- To update to Perl 5.8.8 on Linux based servers:

cd /root
wget http://layer1.cpanel.net/perl588installer.tar.gz 
tar -zxf perl588installer.tar.gz
cd perl588installer
./install

- To update to Perl 5.8.8 on FreeBSD based servers:

cd /usr/ports/lang/perl5
make && make install

Once the update is complete, you can restore all the previously installed modules from the CPAN bundle that was created by executing:

perl -MCPAN -e 'install Bundle::Snapshot_2007_08_16_00'

Make sure that you replace the bundle name with the one that was generated earlier.

We should now make sure that all modules required by cPanel 11 are installed and restart cPanel:

/usr/local/cpanel/bin/checkperlmodules
/usr/local/cpanel/startup

Ten Things You (Probably) Didn't Know About Perl

http://www.ddj.com/architect/184416222

Tuesday, September 9, 2008

PC-using Guidelines

^_^

Well, messing up a PC is easy while making it clean can be a laborious task. I myself has thought about some principles in using a PC and keeping it clean and easy-for-maintaning. These are somehow like guidelines in official papers. ^_^ In fact, they're just some notes for myself. Don't try any one that you feel unreasonable. I won't take any responsibility. Hehe...

All recommendations (with reason) on alternative strategies are welcome.

1. Setting up a system

1.1. Windows system

3-partition-stategy is recommended:

C:
The first partition on your hard disk should be reserved for hard working wares. The reason for that is this part locates at the center of the disk and accessment time greatly reduces as you go further to the peripheral region.
Unarguably most PCs leave this 'plateau' for Windows to run. Then, our plan for the 1st partition:

system files
space for windows to work properly. The necessary space varies due to RAM and Windows version. Recommended: > (total RAM x 2)
programs that need a lot of interactions with the system, suggested:

- internet browsers
- firewall, denfender, antivirus
- IDEs such as visual studio*
- interpeters, compilers (ActivePerl, C compilers...)
- java virtual machines, .net framework or any of that kind

At this point, the space estimated is 15 GB. 20GB should be fine. ^_^

As for the file system, what should we chose? FAT32 or NTFS. NTFS is well-known for its capability of management, faster and more security. I don't have chance to try, 'cos I need to access data on this windows partition in Linux, and the only way is FAT32. Linux won't regconize NTFS system. (I'm using fedora 6, hope that newer version would help.)

D: for large programs (games...), portable ones, misc..., suggested
- text editors
- Games\...
- java-dependent programs*
- IM programs

(* Eclipse IDE is java-dependent, but I think it should be on system hard disk, for its heavy work)

E: surely for our data: images, ebooks, documents... and million of unamed garbages... ^_^
Be careful, 'cos your data will expands unhauntingly.

As much as possible.

1.2. Linux system: I do not have enough experience yet. ^_^


2. Maintaining system

2.1 Windows sytem

Tuesday, August 5, 2008

Tình ơi

Một câu hát buồn sao thấu được lòng sâu
Mà ta vẫn hát tàn hơi


-------oOo-------












Tình ơi

Quốc Bảo

Người xa mấy rừng xa mấy ngàn vực sâu
Người xa mấy mùa không thấy nhau buồn rầu
Người xa cách người khi cất lời hẹn sai
Người chưa biết khóc mộng bay

Người chưa biết tình đang hát gọi mùa đông
Tình đang hát dài như chút hơi cầm lòng
Là ta nhớ tình ta dấu đi hàm oan
Tình yên ấm nhé đừng tan

Tình yên ấm rồi em sẽ nghe
Tự nhiên khóc oà khi có nhau
Lệ rơi sáng loà không dấu nữa tình đau
Tình đau miễn là em sẽ về
Về ta nối lại tơ tóc xưa
Để khi có tình ta đón đưa
Và em sẽ gần ta chút nữa tình ơi
Vì ta sẽ cần em suốt đời

Gần nhau vẫn là xa cách ngàn lần đau
Một manh áo nhàu ta cố lau giận hờn
Một câu hát buồn sao thấu được lòng sâu
Mà ta vẫn hát tàn hơi

Mà em vẫn chờ vẫn chờ mùa đông
Mà ta vẫn còn thao thức chong đèn ngồi
Vì em sẽ về cho ngỡ ngàng rồi đi
Mùa theo gót ấy mùa ơi...

Monday, June 30, 2008

Háhá...

Xong 1 trận chiến...

Còn n trận nữa. Háhá...

Chiến với thầy thì mỏi mắt, chiến với quái vật thì mỏi tay. Hôhô... Cần phải rèn luyện sức bền.

Giao có đọc được cái này thì...

"Bon courage" ^_^

Cố lên! Cuộc sống là một chuỗi ngày chiến đấu không ngừng nghỉ.

"Tiến lên chiến sĩ đồng bào...!" ^_^

À, "bonne chance" nữa chứ. Cũng cần 1 chút... Hehe...

Thursday, June 26, 2008

Xả xì-chét

Kinh dị. Ngồi một buổi chiều với tụi bây mà tao muốn bịn luôn. Trời đất ơi, muốn kiếm cái gối nào quýnh cho vài nhát xịt bông gòn ra. Muốn đi tiêu diệt quái vật, muốn lên level... HUHUHU...

Chữ ơi là chữ! Trời sinh ta sao còn sinh chữ?

HAHA... Vỉ trời sinh chữ nên phải sinh ta. Không thì lấy ai mà rủa...

Nhân dịp này đề ra một kế hoạch cho mùa hè: luyện đọc nhanh, mục tiêu: 100 trang sách/ngày.

ACK!

<để coi>

Thursday, June 19, 2008

Speedtest

http://www.speedtest.net/index.php

It's fun. Hehe...

Dọn 'nhà'

Viết cái entry này ko có liên quan gì tới căn nhà của tui hết, tự dưng nhớ lại cái entry cũ của bà Giao... ^_^

Nhà cũ quen rồi. Tồi tàn, xập xệ, đúng với cái kiểu sống của mình, bê bết, lông bông. Lại thoải mái hơn. Chẳng có phòng ngủ, phòng khách, phòng ăn, nhà bếp... Tất tần tật mọi thứ diễn ra trong một căn nhà, gọi là 'My Page'. Giờ chuyển qua nhà mới, nhà đó vốn đâu có để "sống". "Nhà" gì mà toàn là giấy tờ, tài liệu, đâu ra đó: ăn, ngủ, chơi, thậm chí quậy phá cũng có phòng riêng. Đúng là có tổ chức. Nhưng như vậy mất nhiều năng lượng quá. Không kham nổi.

Quay về nhà cũ. Vậy mà nhà cũ lại sắp sập. Hơhơ... Vài ngày trước còn bạo miệng nói "360 tới ngày tàn" với cái tâm trạng rất ư là vô tư. Dĩ nhiên rồi, trong cái thế giới này, cứ một giây chậm trễ là mất cả tỉ. Huống hồ cái 360 xập xệ này, nó trì trệ không biết bao nhiêu mà nói... Không sập mới lạ...

Giờ thì thấy mình thiên vị. Giờ thì hiểu thêm chút chút tại sao có những người chẳng muốn 360 dẹp tiệm...

Chao ôi, đời!