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.
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.
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
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.
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.
Tuesday, December 22, 2009
Use iSCSI disk on Windows 2008
The iSCSI Initiator is part of Windows 2008, and it is located in the Control Panel. To
1. From iSCSI Initiator Properties, select Discovery tab, Click Add Portal, then enter the IP address with the default port number 3260 unchanged and click OK.
2. Select Target tab, click Log on, the target name has been picked up, so just select automatically restore this connection when the computer starts, then click OK. If the configuration is right, the status of the Properties should indicate Connected. Click OK to exit the properties.
3. From the Administrative Tools-> Computer Management->Disk Management. There should be a new disk without a drive letter. From the property of the new disk it displays something like OPENFILER VIRTUAL-DISK SCSI Disk Device on my system.
4. To use the new disk, right click on the disk, highlight Convert to Dynamic Disk, select the disk number, and then click OK. Select a drive letter, and then format the disk. After the format is completed, the new disk can be used as a normal disk for the system.
Subscribe to:
Posts (Atom)