Monday, May 9, 2011

Javascript Mouse Moveover

<html>
<head>
<script type="text/javascript">
function writeText(txt)
{
document.getElementById("desc").innerHTML=txt;
}
</script>
</head>

<body>
<img src ="planets.gif" width ="145" height ="126" alt="Planets" usemap="#planetmap" />

<map name="planetmap">
<area shape ="rect" coords ="0,0,82,126"
onmouseover="writeText('The Sun and the gas giant planets like Jupiter are by far the largest objects in our Solar System.')"
href ="sun.htm" target ="_blank" alt="Sun" />

<area shape ="circle" coords ="90,58,3"
onmouseover="writeText('The planet Mercury is very difficult to study from the Earth because it is always so close to the Sun.')"
href ="mercur.htm" target ="_blank" alt="Mercury" />

<area shape ="circle" coords ="124,58,8"
onmouseover="writeText('Until the 1960s, Venus was often considered a twin sister to the Earth because Venus is the nearest planet to us, and because the two planets seem to share many characteristics.')"
href ="venus.htm" target ="_blank" alt="Venus" />
</map>

<p id="desc">Mouse over the sun and the planets and see the different descriptions.</p>

</body>
</html>

How To Create Linux LVM

Create Linux LVM

  1. Login with root user ID and try to avoid using sudo command for simplicity reason.
     
  2. fdisk /dev/hdb

    At the Linux fdisk command prompt,
    1. press n to create a new disk partition,
    2. press p to create a primary disk partition,
    3. press 1 to denote it as 1st disk partition,
    4. press ENTER twice to accept the default of 1st and last cylinder – to convert the whole secondary hard disk to a single disk partition,
    5. press t (will automatically select the only partition – partition 1) to change the default Linux partition type (0×83) to LVM partition type (0x8e),
    6. press L to list all the currently supported partition type,
    7. press 8e (as per the L listing) to change partition 1 to 8e, i.e. Linux LVM partition type,
    8. press p to display the secondary hard disk partition setup. Please take note that the first partition is denoted as /dev/hdb1 in Linux,
    9. press w to write the partition table and exit fdisk upon completion.

     
  3. pvcreate /dev/hdb1 
  4. vgcreate -s 1024M vg0 /dev/hdb1
  5. lvcreate -L 1024M -n lvol0 vg0 or lvcreate -l 100%FREE -n MWLV MWVG
  6. mkfs -t ext3 -v /dev/vg0/lvol0 
  7. mkdir /apps
  8. mount -t ext3 /dev/vg0/lvol0 /mnt/vfs
  9. change /etc/fstab to mount the file system automatically
  10. df -h

Thursday, May 5, 2011

GSK_ERROR_BAD_CERT error configuring SSL between Plug-in and WebSphere Application Server V6.1

ERROR: lib_stream: openStream: Failed in r_gsk_secure_soc_init:
GSK_ERROR_BAD_CERT(gsk rc = 414)

To fix this error:

Extract the default Personal Certificate
1. Login to the WebSphere Application Server Administrative Console
2. Select Security > SSL certificate and key management > Key Stores and certificates
3. Select NodeDefaultKeyStore for a stand-alone deployment or
CellDefaultKeyStore for a network deployment.
4. Click Personal Certificates, select the default check box, and then click Extract.
5. Give the extracted file a path and name, such as: /root/defaultCert.ARM.
Note: The convention is to give the file a .ARM extension.
6. Leave encoding set to Base64.
7. Click OK.

Locate your *.kdb file
1. In the httpd.conf file, find the directory in which the plugin-cfg.xml file is
stored by searching for the WebSpherePluginConfig line. It should look something like this:
WebSpherePluginConfig "/opt/IBM/HTTPServer/Plugins1/config/webserver1/plugin-cfg.xml"
2. Find the directory in which the key database file (*.kdb) is stored by searching
for the term "keyring" in the plugin-cfg.xml file. For example:
<Property Name="keyring" Value="/opt/IBM/HTTPServer/Plugins1/config/webserver1/plugin-key.kdb"/>
Note this location as you will need to use it later.

Add the extracted certificate to your key database file
1. Go to the directory for ikeyman and start it:
cd /opt/IBM/HTTPServer/bin
./ikeyman
2. Click Key Database File > Open, and then select a key database type of CMS.
3. Specify the filename and loacation you found above. For example: plugin-key.kdb and
/opt/IBM/HTTPServer/Plugins1/config/webserver1/plugin-key.kdb
4. Click OK, and then enter the password. Note: If you have not given this file another password,
the default password from WebSphere Application Server is WebAS (case sensitive).
5. Click Personal Certificates drop down and then select Signer Certificates.
6. Click Add.
7. Browse to the file you exported with the extension *.ARM, Select it, then Open and click OK. Supply a name if prompted.
8. Select Key Database File > Save As and save to the original location.
9. Select Key Database File > Exit.
10. Restart the IBM HTTP Server.

Tuesday, May 3, 2011

Regular Expression

if [[ "${versionNumber}" =~ [0-9]+\.[0-9]+\.[0-9]+\.[0-9]+ ]]
then
  echo "Version Number Format is right."
else
  echo "Wrong Version Number Format(Field Number), it should be like 7.0.1.15"
  exit $LINENO
fi

Monday, May 2, 2011

Reset WAS Admin Password

Reset WAS Admin Password

 

First, you can use wsadmin.

  • \bin\wsadmin -conntype NONE
  • securityoff
  • Then, recycle or start server.
Secondly, you can find the security.xml file
  • Make a copy of the file
  • Find the first "enabled" string and change the "true" string to "false".
  • Then, restart the server without the username and password.
Both work well.