Monday, August 30, 2010

Useful Certificate Verification Tool

SSL certificate installation on eCommerce site is essential. However, sometimes trouble comes when certificate is not signed by one issuer, or when root CA expires in old version of OS or JVM. Following are 2 useful tool for you to test SSL installation through internet.

VeriSign SSL Certificate Installation Checker







































SSL Certificate Tester - Check Certificates

Thursday, August 26, 2010

Mobileme Setup with Godaddy Domain

Mobileme Individual BoxMobileme service provides web space that can be utilized as a personal website. You can have website with URL link "http://web.me.com/[user name]". However, We always want our customized domain for our website. Unfortunately, Mobileme doesn't provide domain registration service, but you can go to popular domain service site to register you own domain name. Let's take Godaddy.com as an examples. In following, I will show you how to setup up your own website with Godday and Mobileme service.


Pre-requirement : you need Mobileme account and Godday domain registration.


1. Go to your Mobileme configuration. Choose Personal Domain tab and click "Add Domain" button.

2. Fill in domain name that you have registered on Godaddy.com

3. You will see your domain name in "Personal Domain" tab once you complete previous steps.

4. Go to "Domain Manager" Tab on your Godaddy.com account.

5. Click "Manage" link in "Domain Information" section to configure.

6. Forward original domain to "www.yourdomain.com" subdomain.

7. Configure www CNAME and have it point to "web.me.com"


8. Test your domain name after 30 mins.

Monday, August 16, 2010

JSF

Saturday, August 14, 2010

Apache Derby - as Embedded Database

The most convenient part for Apache Derby is it can be an embedded database in JVM. When JVM starts, database starts as well, when JVM shutdown database shutdown as well. it's lightweight, portable and easy to embedded to any application.


Following are steps that how you create test application in Eclipse with Apache Derby DB embedded.
Download Apache Derby from web and extract it to folders you prefer.

Create project and include all jar files in derby lib folder.


Copy SimpleApp.java (under demo/program/simple folder) to project src folder and run it. you will get simliar console output, which means derby is successfully installed and executed.

Monday, August 9, 2010

Idea about Create a Studio

Studio

Goal
  • Organization Helps Developers Focus on What they are doing and care less about rest of the miscellaneous.
  • Organization Can Provide Best Development Environment including Software Framework, Hardware Infrastructure. 
  • Organization help members gain their maximum benefit. 70% revenue goes to Project members, 30% go Studio Growing Funding
Philosophy
  • Entire World Grow with This Organization. We developer what people want.
How to Keep Developers
  • Provide Best Development Environment
  • Maximum Benefits
  • Growing Opportunity
Organization Hierarchy
  • Projective Team
  • Functional Team

Friday, August 6, 2010

What i have

photo.JPG

Tuesday, August 3, 2010

use ExtJS to design Intranet

ExtJS is the most impressive AJAX framework i have seen. When one project came to me and i decided to use this framework as presentation tier framework. following video is sample UI i created for project. It looks pretty nice and amazing.

One of P is let users feel they are using desktop application. No page reload and refresh required. Middle tier i were using JSP to server JSON objects to presentation tier.

Another benefit to use ExtJS is it's easier for you to adopt MVC pattern.

There is no big learn curve to use this framework. I spent one week reading "Learning Ext JS" and ExtJS API document, then i was able to code almost any UI i want.



Thursday, July 29, 2010

General Load Test Proposal

General Load Test Proposal

Prepared by: Henry Tsai , Software Engineer II
November 14, 2009
Proposal number:123-11478
Version : 1.0 Executive Summary
Objective
This Document describes approach of performing load testing on specified web site system.
Goals
The goal of this project is to deliver sizing information for web based system on the results of controlled load testing. This includes sizing for fast-cgi Application server and Apache servers. The project consists of running up to 300 users to simulate 10,000 concurrent connections. during a load test. This load test will be the first one executed with the developed load test with Apache JMeter or LoadRunner tooling based on the HTTP/HTTPS protocol over TCP/IP.
During development it will become more clear that this load test approach in combination with system infrastructure and software architecture.
Assumption
System is build in Clustered environment. Load balancer should have higher/same as performance as Citrix - NetScaler MPX 5500 model per server farm.
The average apache hit on web site is 30 ~50 hit/page ( including static/dynamic page content)
Maximum Number of Concurrent User is 300.
Solution
An option to use Load Test software to test system's response at unusually high or peak loads. Such as LoadRunner or Apache JMeter is suggested. 
LoadRunner from HP can take completed scenario result and prepares the necessary graphs for the tester to view. Also, graphs can be merged to get a good picture of the performance. The tester can then make needed adjustments to the graph and prepare a LoadRunner report. However, LoadRunner License fee could significantly increase cost of this project. License fee for 200 virtual user is around $44,000. License for 300 virtual users is around $55,000.(Currency is USD)
JMeter from Apache is open source software, a 100% pure Java desktop application designed to load test functional behavior and measure performance. It was originally designed for testing Web Applications but has since expanded to other test functions. Based on criterial of this project. A box with 3Ghz CPU can be used to perform 300 virtual users load test. or 2 boxes with 1.5Ghz CPU with distributed load test environment as an alternative. A comment here is if web site system returns a lot of XML response. more boxes are expected.
Test Focus
Service-oriented indicators are availability and response time; they measure how well (or not) an application is providing a service to the end users. Efficiency-oriented indicators are throughput and utilization; they measure how well (or not) an application makes use of the application landscape. Test focus will be focus on follows:
Availability : The amount of time an application is available to the end user. Lack of availability is significant because many applications will have a substantial business cost for even a small outage. In performance testing terms, this would mean the complete inability of an end user to make effective use of the application.
Response Time : The amount of time it takes for the application to respond to a user request. For performance testing, one normally measures system response time, which is the time between the user's requesting a response from the application and a complete reply arriving at the user's workstation.
Throughput : The rate at which application-oriented events occur. A good example would be the number of hits on a web page within a given period of time.

Untitled.png
In this project, when all page request content are all available and correct and all response time are within accept time-limit ( usually 2 seconds) and Throughput is within expected number, the result will be considered as pass.
Task List
Make sure System is table enough for performance Testing. ( Code must be freeze)
Identify and Scripting the Business-Critical transactions.
An example of ten transactions distributed among a total application concurrency of 1,000 virtual users.

Untitled.png

Perform Test based on Transaction distributed.
Deliver Report
Note
This Project use Ramp-up1 as Load Test injection profile.



References
Integrated Approach to Web Performance Testing: A Practitioner's Guide - B. M. Subraya, Jan 6, 2006
The Art of Application Performance Testing: Help for Programmers and Quality Assurance, Ian Molyneaux. Jan 1, 2009



http://jakarta.apache.org/jmeter/usermanual/jmeter_distributed_testing_step_by_step.pdf

http://www.citrix.com/site/resources/dynamic/salesdocs/DataSheet_NetScaler_Sept09.pdf

http://answers.google.com/answers/threadview/id/555953.html

http://jakarta.apache.org/jmeter/index.html

https://h10078.www1.hp.com/cda/hpdc/display/main/download_pdf_unprotected.jsp?zn=bto&cp=54_4000_100
http://www.paessler.com/webstress



Tuesday, July 27, 2010

Mindmap Tool - Novamind

I have found a good Mind-map tool to record requirement while doing System Analysis.
bundle2.png

Monday, July 26, 2010

Find Kth smallest in a given integer array java

public int findksmallest(int[] array, int k) throws Exception {
  if (k <= array.length && k > 0) { 
   for( int i =0 ; i < k ;i++){
          for ( int j = i+1 ; j< array.length ; j++){
              if(array[j] < array[i]){
               int tmp = array[i];
               array[i] = array[j];
               array[j] = tmp;
              }
          }
   }
  }else{
   throw new Exception("k is an invalid number");
  }
  return array[k-1];
 }

Sunday, July 25, 2010

Palindrome Checker in Java

public static boolean isPalindrome(String input){
  boolean result = true;
  for(int i = 0 ; i < input.length() / 2 ; i++ ){
   if(input.charAt(i) != input.charAt(input.length()-(i+1))){
    result = false;
   }
  }
  return result;
 }

Saturday, July 24, 2010

Simple Queue Implementatino in Java

public class BoundedIntQueue {
int[] queue;
int startIndex;
int endIndex;
int size;
public BoundedIntQueue(int queueSize) {
queue = new int[queueSize];
startIndex = 0;
endIndex = 0;
size = 0;
}

public int dequeue() throws Exception{
int result = 0;
// check if queue is empty, throw exception if empty
if(size<=0){
throw new Exception("Queue Empty");
}else{
// dequeue element in queue, if queue is not empty
result = queue[startIndex];
adjustStartIndexAfterDequeue();
size--;
}
return result;
}

private void adjustStartIndexAfterDequeue(){
startIndex++;
if(startIndex >= queue.length)
startIndex = 0;
if(startIndex < 0)
startIndex = queue.length -1;
}    

public void enqueue(int x) throws Exception{
// check if queue is full, throw exception if full
if(size >= queue.length){
throw new Exception("Queue Full");            
}else{
// insert element in queue, if queue is not full
queue[endIndex] = x;
adjustEndIndexAfterEnqueue();
size++;
}
}

private void adjustEndIndexAfterEnqueue(){
endIndex++;
if(endIndex < 0)
endIndex = queue.length -1;
if(endIndex >= queue.length)
endIndex = 0;
}
}

Friday, July 23, 2010

Quick Way in Troubleshooting Web Application Performance Issue

With widely use of Ajax and Javascript in presentation tier of application these 2 years, it's getting hard to find where the real problem is in web application. Before you the only thing you have to care about is server side, now client browser side makes big deal. one incidence in my career life, i got a issue ticket reporting that customer experienced web site slow. I checked each application/web server, database, networking and everything on server side, ( it's especially hard in clustered environment , since you have you check every individual server) and couldn't find any problem. 3 hours had past, and i have no clue. Suddenly it occurred to me that Safari got resource tracking tool. Chrome got same tool build-in. I ran the resource tracking on website and suddenly everything is so clear. it's Google Analytics causing all those trouble. Google Analytics uses javascript to call or fetched resource on google server and it turned out one of resources that this Google Analytics javascript tried to fetch is not available and all those javascript is running on client browser, so i can't find anything wrong on our server. following are some quick tip to show you how to determine performance in really quick way.
First, open the page you want to inspect , and right click. Choose "inspect element" on menu.
inspect.png
it will now bring out a new spitted frame in the bottom. got to "Resources" tab. you will find a pretty chart including all resources rendered by browser on this page.
resource.png
if you separate web-server and web-application server in architecture, you can easily tell which server takes more time to response from resource type

Thursday, July 1, 2010

Implement Opensolaris Production Storage

OpenSolarisLogoXPRT[1]-SMALL.gif

 

 

 

We all know NetApp is a leading storage solution in industry. It provides reliable and performance storage array. We have been use NetApp solution for almost 2 years and never had any failure on it.

NetApp is excellent product. However it's also an expensive hardware. due to limited budget, we have to find another way to implement storage that  has similar functionality but with lower cost.

In first few days of project, I have tried Openfiler, and Nexenta, but didn't make it out. Openfiler is easy to setup, but while doing CIFS share, i encountered problem in setting windows permissions. Nexenta got pretty interface. Somehow while i change NFS configuration, it didn't applied. Finally i turned to OpenSolaris with ZFS.

I have created couple storage servers by using OpenSolaris box. They are running on production environment severing storage to Oracle database and on traffic web servers. Looks pretty stable so far. Performance is around 10 ~ 30 % slower than our current NetApp storage, but cost is , you know.

Following i will share steps that how we created those OpenSolaris storage.

Share Planning First you have plan how many shares needed in each box and what type of share each share point is. in my case, there are 2 storage box. Storage I got 2 mix share. Same share goes both NFS and CIFS protocol.  Storage II got 2 MIX share and 2 NFS share.

Production Filer Mount Structure.png

Config Network Interface Configure box DNS and running following command to refresh the change.

cp /etc/nsswitch.dns /etc/nsswitch.conf

Edit resolv.conf and add domain information in it. Ex :  "domain abc.com" "search  abc.hq"

nano /etc/resolv.conf

Make sure default routing is going to right network interface if you have 2 or above Network Interfaces.

netstat -rn

Edit host file (/etc/hosts) to contains all servers that need to access to it. Ex: 10.0.1.1 DB10.0.1.2 ApplicationServer-I 10.0.1.2 ApplicationServer-II

nano /etc/hosts
Install the Solaris CIFS service packages
Download SMB package from internet.
pkg install SUNWsmbskr pkg install SUNWsmbs
Load the smbsrv module.
add_drv smbsrv
Import the Solaris CIFS service SMF manifest.
 svccfg import /var/svc/manifest/network/smb/server.xml
Sync time with DNS server
ntpdate runner.zzf.hq
Install PAM module. Add line "other password required pam_smb_passwd.so.1 nowarn" to /etc/pam.conf
nano /etc/pam.conf
Enable CIFS service
svcadm enable smb/server
You have to reboot server after you perform previous configuration.
reboot
Configure CIFS with AD
Set up Kerberos 5. fill following information in krb5.conf:
default_realm = ZZF.HQ
[realms]
ABC.HQ = {
kdc = your ad server ip or name
admin_server = your ad server
kpasswd_server = your ad server
kpasswd_protocol = SET_CHANGE
}
nano  /etc/krb5/krb5.conf
SMB join ActiveDirectory
smbadm join -u administrator abc.hq

Create User Create Unix users

// make sure all UNIX system user ID group ID are same. useradd -u 999 oracle  useradd -u 5501 web 
Perform ID mapping on administrator and other users.
idmap add 'wingroup:administrators' 'unixgroup:sysadmin'
idmap add 'winname:administrator@zzf.hq' 'unixuser:root'
// restart service after mapping is done. i actually encountered that ID mapping doesn't always work while update mapping list.
svcadm restart smb/server; svcadm restart idmap 
Setup ZFS
Create ZFS Pool
// user format to check your disk id format  zpool create -f  laketahoe c9d0
Create Shares Points
zfs create -o casesensitivity=mixed laketahoe/mixshare-I
zfs create -o casesensitivity=mixed laketahoe/mixshare-II
zfs create -o casesensitivity=mixed laketahoe/mixshare-III
zfs create -o casesensitivity=mixed laketahoe/mixshare-IV
zfs create laketahoe/nfsshare-I
zfs create laketahoe/nfsshare-II
Share
Create NFS Share
zfs set sharenfs="anon=0,rw=@192.168.1.201/24,root=@10.0.0.1/24" laketahoe/mixshare-I
zfs set sharenfs="anon=0,rw=@192.168.1.201/24,root=@10.0.0.2/24" laketahoe/mixshare-II
zfs set sharenfs="anon=0,rw=@192.168.1.201/24,root=@10.0.0.1/24" laketahoe/mixshare-III
zfs set sharenfs="anon=0,rw=@192.168.1.201/24,root=@10.0.0.2/24" laketahoe/mixshare-IV
zfs set sharenfs="anon=0,rw=@192.168.1.201/24,root=@10.0.0.1/24" laketahoe/nfsshare-I
zfs set sharenfs="anon=0,rw=@192.168.1.201/24,root=@10.0.0.2/24" laketahoe/nfsshare-II

Create CIFS Share
chmod 777 /laketahoe/mixshare-I chmod 777 /laketahoe/mixshare-II chmod 777 /laketahoe/mixshare-III chmod 777 /laketahoe/mixshare-IV

zfs set sharesmb=on laketahoe/mixshare-I

zfs set sharesmb=on laketahoe/mixshare-II zfs set sharesmb=on laketahoe/mixshare-III zfs set sharesmb=on laketahoe/mixshare-IV
Mount Share
check available NFS mount point. go to machine that
 showmount -e [filer host name]
mount NFS
mount filer:/laketahoe/mixshare-I /mnt/mixshare
at this point , you should be able to see that NFS is mounted
 df -h
 
you can also mount those mix share from windows box as long you use windows administrator to set right permission on those share.
those are steps are steps that make shares work. for permission setting and detail about those configuration, following are good references to go.

References
Developer Recipes: Setting Up an OpenSolaris Storage Server in 10 Minutes or Less ~ By Dominic Kay, April 29, 2008
http://developers.sun.com/openstorage/articles/opensolaris_storage_server.html
HOW to INSTALL and SHARE a File System to CIFS Clients ~ By Brian Leonard, May 22, 2009
http://www.opensolaris.com/use/CIFS.pdf
CIFS_Service_Troubleshooting ~ wiki
http://wiki.genunix.org:8080/wiki/index.php/CIFS_Service_Troubleshooting
Getting Started With the Solaris CIFS Service ~ wiki
http://wiki.genunix.org:8080/wiki/index.php/Getting_Started_With_the_Solaris_CIFS_Service
Solaris CIFS Administration Guide ~ By Sun Microsystems, Inc, March, 2009
http://dlc.sun.com/pdf/820-2429/820-2429.pdf
How to Configure the Solaris CIFS Service in Domain Mode ~ Oracle
http://docs.sun.com/app/docs/doc/820-2429/configuredomainmodetask

Troubleshooting Guide

 

Encountering "Permission Deny" while mounting NFS

-> check nfs mount ip address and mask

zfs set sharenfs="anon=0,rw=@192.168.1.201/24,root=@192.168.1.201/24" laketahoe/oradatawp



 

"NFS compound failed for server 192.168.1.17: error 27 (RPC: Received disconnect from remote)" message shown while mounting NFS

-> check nfs mount ip address and mask

zfs set sharenfs="anon=0,rw=@192.168.1.201/24,root=@192.168.1.201/24" laketahoe/oradatawp

 

 

Encountering “nfs mount: mount: /local/httpd/htdocs: Device busy” message while mountng NFS

-> check nfs mount ip address and mask

zfs set sharenfs="anon=0,rw=@192.168.1.201/24,root=@192.168.1.201/24" laketahoe/oradatawp

 

 

Showing "nobody" in folder ownership on NFS mount

change following domain to map ZZF.HQ

#vi /etc/default/nfs

#vi /etc/resolv.conf

#vi /var/run/nfs4_domain

#svcadm restart nfs/mapid