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.

Wednesday, December 16, 2009

Don't use test as the name of your program in Unix/Linux

Remember, test itself is the internal shell command in Unix/Linux OS.

When you type in test, the name of the program you just wrote, you may realize your program doesn't work at all. You may spend lots of time in your program for debugging or struggle with your environment. Please don't waste your time; the puzzle is not in your program or your environment but the name, test.

The trick is that when test is entered from the command prompt, shell always run its test command instead. The only way you can start up your program is either to start your program with the full path "/PATH/test" or "bash test" if it is in the current directory.

The simple solution for this problem is NOT to use test as your program name.

Connect Ubuntu 9.10 to Remote systems with Window XP SP2 VPN Server

1. Setup Windows VPN server.

Open Network and Internet Connections in the Control panel. In the open window, click Network connections. Under Network Tasks, click Create New Connection to bring up the New Connection Wizard. Click Next, select Set up an advanced connection, and then click Next. Select Accept incoming connections, and then click Next then Next. Select Allow virtual private connection, then Next. From the User Permissions window, select or add the users allow to make the connections, and then click Next. At the Networking Software, highlight Internet Protocol (TCP/IP), and then click Properties. Either select Specify TCP/IP address, enter the address range or select to use DHCP, then click OK.Finally click Next and Finish completing the setup.

2. Enable Remote desktop Access. Forget this; Ubuntu won't be able to make connection to Windows XP system.

From Control panel, click Performance and Maintenance, then System. Select Remote tab, Select Allow users to connect remotely to this computer, and then click OK.

3. Setup VPN client on Ubuntu.

From Applications-> Ubuntu Software Centre, enter pptp in the search box, select and install PPTP VPN Connection Manager package. Reboot Ubuntu. Click the Network Manager in the system tray, select VPN connection-> Configure VPN… then makeup a connection name and enter the IP address of the VPN server with user name and pass word, then click Apply and Close.

To make VPN connection, from the Network Manager-> VPN Connections, then double click the connection name just created. When a lock logo showed at the upper-left corner of the Network manager, the Windows XP VPN server is connected.

4. Startup remote desktop

Bring up Application->Internet->Terminal Server Client. Enter the Computer IP address or hostname, select Protocol to RDP, and then click Connect. The Terminal Server Client will display the Windows XP login screen. Enter the user name and pass word to start the remote desktop session on the Windows system.

Friday, December 4, 2009

Setup CruiseControl on CentOS 5.4

1. Install Java:
yum install java java-1.6.0-openjdk-devel

2. Install Junit:
yum install junit

3. Install CVS
yum install cvs

4. Install CruiseControl/ANT
Download the current CruiseControl, cruisecontrol-bin-2.8.2.zip, from http://cruisecontrol.sourceforge.net/download.html, then unzip the file to /usr/share/cruisecontrol-bin-2.8.2. Set $ANT_HOME to /usr/share/cruisecontrol-bin-2.8.2/apache-ant-1.7.0, and PATH to include $ANT_HOME/bin and /usr/share/cruisecontrol-bin-2.8.2. Run 'ant -diagnostics' to make sure ANT is installed properly.

After above software get installed, follow the step-by-step instructions in http://cruisecontrol.sourceforge.net/download.html to create a simple CruiseControl build environment should be pretty easy.

Remove the CR character with sed or tr

Following command will redirect the content of dosfile except the CR characters to newfile:

sed 's/^V^M//' dosfile > newfile

Note: ^ is the control key.

tr -d '\015' < dosfile > newfile

Solaris Disk Cloning with dd and cpio

For the disk cloning, power off the system, connect the target disk, then boot the system into single user mode. After the cloning, power off the system, disconnect the target disk which can be used as usual.

A. To clone a similar disk, assume the source disk is at /dev/rdsk/c0t0d0 and the target disk is at /dev/rdsk/c0t3d0 in the following example.

1. Clone the root partitial:

dd if=/dev/rdsk/c0t0d0s0 0f=/dev/rdsk/c0t3d0s0 bs=2048k count=1
dd if=/dev/rdsk/c0t0d0s0 of=/dev/rdsk/c0t3d0s0 bs=2048k

2. Clone the entire disk:

dd if=/dev/rdsk/c0t0d0s2 of=/dev/rdsk/c0t3d0s2 bs=2048k

B. To clone a disimilar disk, assume the source is at /dev/dsk/c1t3d0s0 and the target is at /dev/dsk/c1t0d0s0.

mount /dev/dsk/c1t3d0s0 /mnt/old
mount /dev/dsk/c1t0d0s0 /mnt/new
cd /mnt/old
find . -print | cpio -oac | (cd /mnt/new; cpio -imduc)

Continue to perform the similar operation for the rest of partitions.

If cloning is for the root disk, you may need to run installboot to fix the boot problem. Follow is the example to install the boot block on /dev/rdsk/cotodoso.

installboot /usr/platform/`uname -i`/lib/fs/ufs/bootblk /dev/rdsk/c0t0d0s0