VeriSign SSL Certificate Installation Checker
SSL Certificate Tester - Check Certificates
VeriSign SSL Certificate Installation Checker
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]; }
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; }
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; } }
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.
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"
Make sure default routing is going to right network interface if you have 2 or above Network Interfaces.
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
pkg install SUNWsmbskr
pkg install SUNWsmbs
add_drv smbsrv
svccfg import /var/svc/manifest/network/smb/server.xml
ntpdate runner.zzf.hq
nano /etc/pam.conf
svcadm enable smb/server
reboot
nano /etc/krb5/krb5.conf
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
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
// user format to check your disk id
format
zpool create -f laketahoe c9d0
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
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
chmod 777 /laketahoe/mixshare-I
chmod 777 /laketahoe/mixshare-II
chmod 777 /laketahoe/mixshare-III
chmod 777 /laketahoe/mixshare-IVzfs 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
showmount -e [filer host name]
mount filer:/laketahoe/mixshare-I /mnt/mixshare
df -h
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