Friday, December 24, 2010

Reset root password on Rad Hat Enterrpise 5

  1. Insert install CD #1 into the CD drive, then reboot system.
  2. At boot: prompt, enter linux rescue, then wait until Choose a Language screen shows up.
  3. Select the language, press tab to highlight OK, then press enter.
  4. Select the keyboard type, press tab to highlight OK, then press enter.
  5. Select Yes or No for Setup Networkign screen, then press enter. Press enter again for Continue.
  6. Press enter at Your system has been mounted under /mnt/sysimage screen.
  7. At command prompt sh-3.2#, type in chroot /mnt/sysimage, then passwd to reset the root pass word.
  8. Enter the the same password twice at New UNIX password and Retype new UNIX password prompts.
  9. Type reboot at the command prompt to restart the server.

Monday, November 15, 2010

Use PSP to play You Tube videos

PSP can be used to watch You Tube video when you travel with train or bus. For a student, this can be a great tool for study. Following is how to do it in a few steps.

1. Download and install Free You Tube to iPod Converter from http://www.dvdvideosoft.com/guides/free-youtube-to-ipod-converter.htm.

2. Start the program and set the Devices to Sony PSP and the output folder, then paste the URL of video file from You Tube one by one. Down load file or files to the your PC.

2. Connect USB cable between PSP and your PC, and select USB connection in settings. The PSP will be named as Memory Stick on you PC like a hard drive.

3. Copy the video file to Video folder at Memory Stick.

4. Select Video->Memory Stick, then select the video to watch.

Saturday, November 13, 2010

Change Windows XP to a Multi Language System

Download Windows XP Multilingual User Interface Pack (Multi-Language) which has 5 CDs. This demo installs Traditional Chinese from the first CD which contains Chinese, Korean, Japanese, French, and German.

1. Double click mui_wxm_cd1.exe to extract all files for installation.
2. Double click muisetup.exe.
3. Accept the license agreement, then select the languages (Traditional Chinese) to install.
4. Reboot the system once the installation is completed, then start the Control Panel->Regional and Language Options. Select Hong Kong for location. Select Traditional Chinese for Language Used in Menus and Dialogs under the Language tab, then click OK.
5. Log off then log in again, the user interface has been changed from English to Traditional Chinese.

Tuesday, October 19, 2010

NAnt with Windows 7

In order to use either NAnt 0.85-cr2 or 0.91-alpha2 on Windows 7, you need to download and install Microsoft .NET Framework 4, dotNetFx40_Full_setup.exe, from Microsoft at

Monday, October 18, 2010

IIS 7.0 Configuration Backup

The configurations of IIS on Windows 2008 server or Windows 7 can be backup/restored with appcmd.exe.

1. Backup

C:\Windows\system32\inetsrv\appcmd add backup my-backup

It will create C:\Windows\system32\inetsrv\backup\my-backup with following files:

2010-10-06 11:17 PM 18,258 administration.config
2010-10-18 02:50 PM 62,750 applicationHost.config
2010-10-06 11:16 PM 490 redirection.config
2010-10-18 10:44 PM <DIR> schema

Please note that if no backup name is given, a name with date and time is used for the backup object as show below:

C:\Windows\system32\inetsrv\appcmd add backup
BACKUP object "20101018T224909" added

2. Delete

C:\Windows\system32\inetsrv\appcmd delete backup my-backup

3. Restore

C:\Windows\system32\inetsrv\appcmd restore backup my-backup

4. List

C:\Windows\system32\inetsrv\appcmd list backup

Monday, June 21, 2010

Install Broadcom driver for VMware ESXi

1. Download Broadcom NetXtreme II Ethernet network card driver CD from http://www.vmware.com/support/vsphere4/doc/drivercd/esx40-net-bnx2x_400.1.48.107-1.0.4.html. Burn a CD from the file just downloaded.

2. Because the Perl script vihostupdate.pl is used for the installation, download vSphere client CLI from VMware site http://www.vmware.com/downloads/eula.do.

3. Install the vSphere client CLI which is a bundle of Active Perl and some admin tools on the administration PC. It is better to include the tools in the %PATH% before using the them.

4. Switch the host to the maintenance mode before the installation. Key in the following one by one from the console:
press alt+F1, type: unsupported, enter the root password. Run following command to switch to the maintenance mode.

vim-cmd /hostsvc/maintenance_mode_enter

Please note that enable ssh login is alternative way to run above command remotely.

5. After the host is in the maintenance mode, following command can be used to install the driver from vSphere client command line.

vihostupdate.pl --server 192.168.1.100 --install --bundle E:\offline-bundle\BCM-bnx2x-1.48.107.v40.2-offline_bundle-181332.zip

6. Reboot ESXi.

Sunday, June 20, 2010

Run VMware ESXi 4.0 on USB devices

There are many posts in how to run VMware ESXi on USB flash in the Internet. However, the method can be applied to the USB portable disk as well.

This is one of the links for running ESXi 3.5 on USB flash drive, http://www.atomicsub.net/2009/01/vmware-esxi-usb-flash/. Be very careful to select the correct disk. The image uses entire disk space, so all data on the disk will be wiped out.

The steps to run ESXi 4.0 are the same as the above except the image dd file is in image.tgz instead of install.tgz.

Saturday, May 1, 2010

Install VirtualBox Guest Addition for Backtrack 4

1. mount /dev/hdc /mnt

2. cd /mnt

3. ./VBoxLinuxAddition-x86.run

Thursday, April 1, 2010

Simple Debug tips for PHP&MySQL Program

1. Use PHP command to check if there is any syntax error. If no complains, an html file created by the script should be dumped to the screen. Because the script is check from the command line, it is quick and handy.

php -l report.php

2. Always use <?php codes... ?> instead of <? codes... ?> to make sure the PHP code will run in different environment. Especially for those whom cannot modify the file php.ini to enable the short tags for PHP codes.

3. In the php script, always check the return value of a function such as sql_connect or sql_query with "or die(sql_error())" to make sure the function is executed as expected. Following are examples:

mysql_connect("localhost", "root", "password") or die(mysql_error());
mysql_query($sql) or die(mysql_error());

4. Check web server error log such as error_log for Apache server. For example, the Apache error log is /var/log/httpd/error_log for RedHatd, CentOS, and Fedora.