<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-3053352583694970340</id><updated>2012-01-26T17:14:21.424-08:00</updated><title type='text'>iT Geek Help</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://itgeekhelp.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3053352583694970340/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://itgeekhelp.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Pedric Kng Aka Boon</name><uri>http://www.blogger.com/profile/07979744237794291200</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>64</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-3053352583694970340.post-2374449679458119415</id><published>2012-01-18T23:46:00.001-08:00</published><updated>2012-01-18T23:46:23.169-08:00</updated><title type='text'>SVN Installation on Fedora</title><content type='html'>References:&lt;br /&gt;http://www.if-not-true-then-false.com/2010/install-svn-subversion-server-on-fedora-centos-red-hat-rhel/&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3053352583694970340-2374449679458119415?l=itgeekhelp.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://itgeekhelp.blogspot.com/feeds/2374449679458119415/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://itgeekhelp.blogspot.com/2012/01/svn-installation-on-fedora.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3053352583694970340/posts/default/2374449679458119415'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3053352583694970340/posts/default/2374449679458119415'/><link rel='alternate' type='text/html' href='http://itgeekhelp.blogspot.com/2012/01/svn-installation-on-fedora.html' title='SVN Installation on Fedora'/><author><name>Pedric Kng Aka Boon</name><uri>http://www.blogger.com/profile/07979744237794291200</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3053352583694970340.post-8104320833218348229</id><published>2011-10-28T21:12:00.000-07:00</published><updated>2011-10-28T21:13:20.773-07:00</updated><title type='text'>Fedora install tomcat 6</title><content type='html'>yum install tomcat6 tomcat6-admin-webapps tomcat6-webapps&lt;br /&gt;chmod g+x /usr/share/tomcat6/logs&lt;br /&gt;chmod g+x /etc/tomcat6&lt;br /&gt;chmod g+x /usr/share/tomcat6/webapps/&lt;br /&gt;chmod g+x /usr/share/tomcat6/temp&lt;br /&gt;chmod g+x /usr/share/tomcat6/work&lt;br /&gt;chmod g+x /var/cache/tomcat6&lt;br /&gt;chown -R tomcat:tomcat /etc/tomcat6/Catalina&lt;br /&gt;chmod g+x /var/lib/tomcat6/&lt;br /&gt;&lt;br /&gt;Ok. Now try start tomcat again:&lt;br /&gt;service tomcat6 restart&lt;br /&gt;Open browser: http://localhost:8080/&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3053352583694970340-8104320833218348229?l=itgeekhelp.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://itgeekhelp.blogspot.com/feeds/8104320833218348229/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://itgeekhelp.blogspot.com/2011/10/fedora-install-tomcat-6.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3053352583694970340/posts/default/8104320833218348229'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3053352583694970340/posts/default/8104320833218348229'/><link rel='alternate' type='text/html' href='http://itgeekhelp.blogspot.com/2011/10/fedora-install-tomcat-6.html' title='Fedora install tomcat 6'/><author><name>Pedric Kng Aka Boon</name><uri>http://www.blogger.com/profile/07979744237794291200</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3053352583694970340.post-5953018676425858210</id><published>2011-10-09T20:45:00.001-07:00</published><updated>2011-10-09T20:45:35.304-07:00</updated><title type='text'>How to list the files installed by a yum package</title><content type='html'>If you don’t have repoquery you’ll need to install it first:&lt;br /&gt;&lt;br /&gt;% yum install yum-utilsThen you can run it like so:&lt;br /&gt;&lt;br /&gt;% repoquery --list *package*repoquery writes the list of files for the specified package to standard output. For example, to see the files installed by the nmh package, use:&lt;br /&gt;&lt;br /&gt;% repoquery --list nmh&lt;br /&gt;/etc/nmh&lt;br /&gt;/etc/nmh/MailAliases&lt;br /&gt;/etc/nmh/components&lt;br /&gt;/etc/nmh/digestcomps&lt;br /&gt;/etc/nmh/distcomps&lt;br /&gt;...&lt;br /&gt;&lt;br /&gt;#Referenced from http://cimarron-taylor.appspot.com/html/0901/090107-yum.html&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3053352583694970340-5953018676425858210?l=itgeekhelp.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://itgeekhelp.blogspot.com/feeds/5953018676425858210/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://itgeekhelp.blogspot.com/2011/10/how-to-list-files-installed-by-yum.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3053352583694970340/posts/default/5953018676425858210'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3053352583694970340/posts/default/5953018676425858210'/><link rel='alternate' type='text/html' href='http://itgeekhelp.blogspot.com/2011/10/how-to-list-files-installed-by-yum.html' title='How to list the files installed by a yum package'/><author><name>Pedric Kng Aka Boon</name><uri>http://www.blogger.com/profile/07979744237794291200</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3053352583694970340.post-219102277833749931</id><published>2011-10-09T20:21:00.000-07:00</published><updated>2011-10-09T20:22:34.736-07:00</updated><title type='text'>YUM command</title><content type='html'>yum gets the list of packages from repository /etc/yum.repos.d&lt;br /&gt;&lt;br /&gt;install additional repository into top folder&lt;br /&gt;- wsget *.repo&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3053352583694970340-219102277833749931?l=itgeekhelp.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://itgeekhelp.blogspot.com/feeds/219102277833749931/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://itgeekhelp.blogspot.com/2011/10/yum-command.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3053352583694970340/posts/default/219102277833749931'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3053352583694970340/posts/default/219102277833749931'/><link rel='alternate' type='text/html' href='http://itgeekhelp.blogspot.com/2011/10/yum-command.html' title='YUM command'/><author><name>Pedric Kng Aka Boon</name><uri>http://www.blogger.com/profile/07979744237794291200</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3053352583694970340.post-2454018985362480049</id><published>2011-04-16T00:19:00.003-07:00</published><updated>2011-04-16T00:19:52.844-07:00</updated><title type='text'>JavaServlet\WebService Security Constraint</title><content type='html'>Reference: http://blogs.sun.com/monzillo/entry/web_xml_security_constraints_best&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3053352583694970340-2454018985362480049?l=itgeekhelp.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://itgeekhelp.blogspot.com/feeds/2454018985362480049/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://itgeekhelp.blogspot.com/2011/04/javaservletwebservice-security.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3053352583694970340/posts/default/2454018985362480049'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3053352583694970340/posts/default/2454018985362480049'/><link rel='alternate' type='text/html' href='http://itgeekhelp.blogspot.com/2011/04/javaservletwebservice-security.html' title='JavaServlet\WebService Security Constraint'/><author><name>Pedric Kng Aka Boon</name><uri>http://www.blogger.com/profile/07979744237794291200</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3053352583694970340.post-7276203652955891679</id><published>2011-04-14T06:36:00.000-07:00</published><updated>2011-04-14T06:39:07.879-07:00</updated><title type='text'>Javascript Get browser\OS version</title><content type='html'>*** browser\other version ***&lt;br /&gt;&lt;br /&gt;&lt;script&gt;&lt;br /&gt;w=window.open("");&lt;br /&gt;for(i in navigator){&lt;br /&gt;w.document.write("&lt;li&gt;"+i+" = "+eval('navigator.'+i));&lt;br /&gt;}&lt;br /&gt;&lt;/script&gt;&lt;br /&gt;&lt;br /&gt;Ref: http://www.webdeveloper.com/forum/archive/index.php/t-127667.html&lt;br /&gt;&lt;br /&gt;*** OS version ***&lt;br /&gt;&lt;br /&gt;// This script sets OSName variable as follows:&lt;br /&gt;// "Windows"    for all versions of Windows&lt;br /&gt;// "MacOS"      for all versions of Macintosh OS&lt;br /&gt;// "Linux"      for all versions of Linux&lt;br /&gt;// "UNIX"       for all other UNIX flavors &lt;br /&gt;// "Unknown OS" indicates failure to detect the OS&lt;br /&gt;&lt;br /&gt;var OSName="Unknown OS";&lt;br /&gt;if (navigator.appVersion.indexOf("Win")!=-1) OSName="Windows";&lt;br /&gt;if (navigator.appVersion.indexOf("Mac")!=-1) OSName="MacOS";&lt;br /&gt;if (navigator.appVersion.indexOf("X11")!=-1) OSName="UNIX";&lt;br /&gt;if (navigator.appVersion.indexOf("Linux")!=-1) OSName="Linux";&lt;br /&gt;&lt;br /&gt;document.write('Your OS: '+OSName);&lt;br /&gt;&lt;br /&gt;Ref: http://www.javascripter.net/faq/operatin.htm&lt;br /&gt;&lt;br /&gt;Others: https://developer.mozilla.org/En/Browser_Detection_and_Cross_Browser_Support&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3053352583694970340-7276203652955891679?l=itgeekhelp.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://itgeekhelp.blogspot.com/feeds/7276203652955891679/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://itgeekhelp.blogspot.com/2011/04/javascript-get-browseros-version.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3053352583694970340/posts/default/7276203652955891679'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3053352583694970340/posts/default/7276203652955891679'/><link rel='alternate' type='text/html' href='http://itgeekhelp.blogspot.com/2011/04/javascript-get-browseros-version.html' title='Javascript Get browser\OS version'/><author><name>Pedric Kng Aka Boon</name><uri>http://www.blogger.com/profile/07979744237794291200</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3053352583694970340.post-4251148881964019506</id><published>2011-01-23T20:08:00.000-08:00</published><updated>2011-01-23T20:09:16.251-08:00</updated><title type='text'>Setting Java System Properties in JBoss</title><content type='html'>I like using JVM system properties as a way to access non hard coded resources. Typing System.getProperty("myPropertyName") is convenient and clean. The best part is that these properties have JVM scope, so you don't have to worry about class loaders.&lt;br /&gt;&lt;br /&gt;For convenience let me define a couple of variables:&lt;br /&gt;&lt;br /&gt;%JBOSS_HOME= directory where JBoss is installed&lt;br /&gt;%JBOSS_SERVER= server instance name&lt;br /&gt;&lt;br /&gt;There are 2 ways to define system properties in JBoss:&lt;br /&gt;&lt;br /&gt;a) By specifying them in %JBOSS_HOME/bin/run.conf&lt;br /&gt;&lt;br /&gt;You use run.conf, don't you? Don't change run.sh or run.bat directly. That makes your application less portable. The file run.conf is used by run.sh or run.bat to setup a number of properties. To setup system properties you need modify the JAVA_OPTS variable. Find this section in run.conf and modify it accordingly:&lt;br /&gt;&lt;br /&gt;#&lt;br /&gt;# Specify options to pass to the Java VM.&lt;br /&gt;#&lt;br /&gt;if [ "x$JAVA_OPTS" = "x" ]; then&lt;br /&gt;     JAVA_OPTS="-Xms500m -Xmx500m -Dsun.rmi.dgc.client.gcInterval=3600000 -Dsun.rmi.dgc.server.gcInterval=3600000 -DyourPropertyName=yourPropertyValue"   &lt;br /&gt;fi&lt;br /&gt;&lt;br /&gt;As you can see I added the property yourPropertyName to the System Properties. So, once you restart the server, you will able to simply call System.getProperty("yourPropertyName") and get the value of it in any application running in JBoss.&lt;br /&gt;&lt;br /&gt;The problem with this approach is that to change the values of the properties, or add values, you need to restart the server.&lt;br /&gt;&lt;br /&gt;b) Use properties-service.xml&lt;br /&gt;&lt;br /&gt;This is my favorite method. In $JBOSS_HOME/server/$JBOSS_SERVER/deploy you will find the file properties-service.xml . In this file you can specify new system properties, modify existing ones and even remove old ones. All you need to do is uncomment the following block in properties-service.xml:&lt;br /&gt;&lt;br /&gt;    &lt;!--&lt;br /&gt;       | Set raw properties file style properties. --&gt;&lt;br /&gt;&lt;br /&gt;    &lt;attribute name="Properties"&gt;&lt;br /&gt;    &lt;br /&gt;&lt;br /&gt;yourPropertyName=yourPropertyValue&lt;br /&gt;&lt;br /&gt;    &lt;/attribute&gt;&lt;br /&gt;&lt;br /&gt;You don't need to restart the server for defined properties or changed in properties-service.xml to take effect. Placing properties with links to web services endpoints, LDAP servers and other resources in properties-service.xml makes an application EAR or WAR more portable and easier to move from a development environment to a production environment since the properties are outside of the deployment instruments.&lt;br /&gt;&lt;br /&gt;Reference from: http://www.hugotroche.com/my_weblog/2008/07/setting-java-sy.html&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3053352583694970340-4251148881964019506?l=itgeekhelp.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://itgeekhelp.blogspot.com/feeds/4251148881964019506/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://itgeekhelp.blogspot.com/2011/01/setting-java-system-properties-in-jboss.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3053352583694970340/posts/default/4251148881964019506'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3053352583694970340/posts/default/4251148881964019506'/><link rel='alternate' type='text/html' href='http://itgeekhelp.blogspot.com/2011/01/setting-java-system-properties-in-jboss.html' title='Setting Java System Properties in JBoss'/><author><name>Pedric Kng Aka Boon</name><uri>http://www.blogger.com/profile/07979744237794291200</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3053352583694970340.post-8577456299940691735</id><published>2011-01-12T02:16:00.000-08:00</published><updated>2011-01-28T01:28:07.421-08:00</updated><title type='text'>JBOSS 5 on Java 5 Unsupported Operation...Set ....</title><content type='html'>from 5.0.0.GA&lt;br /&gt;JBossAS 5.0.0.GA can be compiled with both Java5 &amp; Java6. The Java5 compiled binary is our primary/recommended binary distribution. It has undergone rigorous testing and can run under both a Java 5 and a Java 6 runtime. When running under Java 6 you need to manually copy the following libraries from the JBOSS_HOME/common/lib directory to the JBOSS_HOME/lib/endorsed directory, so that the JAX-WS 2.0 apis supported by JBossWS are used:&lt;br /&gt;&lt;br /&gt;    * jbossws-native-saaj.jar&lt;br /&gt;    * jbossws-native-jaxrpc.jar&lt;br /&gt;    * jbossws-native-jaxws.jar&lt;br /&gt;    * jbossws-native-jaxws-ext.jar&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3053352583694970340-8577456299940691735?l=itgeekhelp.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://itgeekhelp.blogspot.com/feeds/8577456299940691735/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://itgeekhelp.blogspot.com/2011/01/jboss-5-on-java-5-unsupported.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3053352583694970340/posts/default/8577456299940691735'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3053352583694970340/posts/default/8577456299940691735'/><link rel='alternate' type='text/html' href='http://itgeekhelp.blogspot.com/2011/01/jboss-5-on-java-5-unsupported.html' title='JBOSS 5 on Java 5 Unsupported Operation...Set ....'/><author><name>Pedric Kng Aka Boon</name><uri>http://www.blogger.com/profile/07979744237794291200</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3053352583694970340.post-4894871447743302801</id><published>2011-01-06T20:37:00.000-08:00</published><updated>2011-01-06T20:38:23.101-08:00</updated><title type='text'>Linux change hostname</title><content type='html'>Display Hostname&lt;br /&gt;Type the following command:&lt;br /&gt;&lt;br /&gt;hostnameSample ouputs:&lt;br /&gt;&lt;br /&gt;server.nixcraft.net.inStep # 1: Change Hostname&lt;br /&gt;You need to update two files:&lt;br /&gt;&lt;br /&gt;Linux Distribution specific file. Edit appropriate file as per your distribution as follows. &lt;br /&gt;/etc/hosts &lt;br /&gt;Redhat / CentOS / Fedora: Change Hostname&lt;br /&gt;Edit /etc/sysconfig/network, enter:&lt;br /&gt;&lt;br /&gt;vi /etc/sysconfig/networkSet HOSTNAME=newhost.example.com, enter:&lt;br /&gt;&lt;br /&gt;HOSTNAME=server2.nixcraft.comSave and close the file. Type the following command:&lt;br /&gt;&lt;br /&gt;hostname server2.nixcraft.com&lt;br /&gt;hostname&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Step #2: Update /etc/hosts&lt;br /&gt;Now, you need to edit /etc/hosts file, enteR:&lt;br /&gt;&lt;br /&gt;vi /etc/hostsChange all old hostname with newer one.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3053352583694970340-4894871447743302801?l=itgeekhelp.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://itgeekhelp.blogspot.com/feeds/4894871447743302801/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://itgeekhelp.blogspot.com/2011/01/linux-change-hostname.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3053352583694970340/posts/default/4894871447743302801'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3053352583694970340/posts/default/4894871447743302801'/><link rel='alternate' type='text/html' href='http://itgeekhelp.blogspot.com/2011/01/linux-change-hostname.html' title='Linux change hostname'/><author><name>Pedric Kng Aka Boon</name><uri>http://www.blogger.com/profile/07979744237794291200</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3053352583694970340.post-6321918974627034709</id><published>2010-07-26T03:06:00.001-07:00</published><updated>2010-07-26T03:07:43.662-07:00</updated><title type='text'>Android System properties</title><content type='html'>Reference:&lt;br /&gt;http://android-er.blogspot.com/2009/09/read-android-system-info-using.html&lt;br /&gt;http://android-er.blogspot.com/2009/09/read-android-cpu-info.html&lt;br /&gt;http://android-er.blogspot.com/2009/09/read-android-os-version.html&lt;br /&gt;http://d.hatena.ne.jp/Kazzz/20100113/p1&lt;br /&gt;&lt;br /&gt;http://strazzere.com/blog/?p=116&lt;br /&gt;http://www.androidsoftwaredeveloper.com/2009/04/02/how-to-get-the-phone-imei/&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3053352583694970340-6321918974627034709?l=itgeekhelp.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://itgeekhelp.blogspot.com/feeds/6321918974627034709/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://itgeekhelp.blogspot.com/2010/07/android-system-properties.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3053352583694970340/posts/default/6321918974627034709'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3053352583694970340/posts/default/6321918974627034709'/><link rel='alternate' type='text/html' href='http://itgeekhelp.blogspot.com/2010/07/android-system-properties.html' title='Android System properties'/><author><name>Pedric Kng Aka Boon</name><uri>http://www.blogger.com/profile/07979744237794291200</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3053352583694970340.post-4794847367609548604</id><published>2010-07-05T20:25:00.001-07:00</published><updated>2010-07-05T20:28:14.350-07:00</updated><title type='text'>Unix mail commands</title><content type='html'>Extracted from: http://www.cyberciti.biz/faq/linux-send-email-from-console/&lt;br /&gt;&lt;br /&gt;To send an email from console you need to use mail command, which is an intelligent mail processing system which has a command syntax reminiscent of ed with lines replaced by messages. To send an email to somewhere@domain.com you need to type following command:&lt;br /&gt;&lt;br /&gt;$ mail somewhere@domain.comOutput:&lt;br /&gt;&lt;br /&gt;Subject: Hello&lt;br /&gt;Hai,&lt;br /&gt;&lt;br /&gt;How are you? Hope so you are fine :)&lt;br /&gt;&lt;br /&gt;Take care&lt;br /&gt;&lt;br /&gt;Babai&lt;br /&gt;&lt;br /&gt;Vivek&lt;br /&gt;. &lt;Type  DOT (.) followed by ENTER KEY&gt;&lt;br /&gt;Cc: &lt;Press ENTER KEY&gt;&lt;br /&gt;&lt;br /&gt;You need to type . (dot) to send an email. To send contains of file (such as /tmp/message) as mail body then use following command:&lt;br /&gt;$ mail -s 'Hai' somewhere@domain.com &lt; /tmp/messagePlease note that above command will NOT route an email if you do not have properly configured MTA/mail server.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;*** Read mail ***&lt;br /&gt;&gt;&gt;mail -f /var/spool/mail/&lt;user&gt; e.g., mail -f /var/spool/mail/root //root email&lt;br /&gt;&gt;&gt;mbox //list all mails&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Reference: http://www.computerhope.com/unix/umail.htm&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3053352583694970340-4794847367609548604?l=itgeekhelp.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://itgeekhelp.blogspot.com/feeds/4794847367609548604/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://itgeekhelp.blogspot.com/2010/07/unix-mail.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3053352583694970340/posts/default/4794847367609548604'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3053352583694970340/posts/default/4794847367609548604'/><link rel='alternate' type='text/html' href='http://itgeekhelp.blogspot.com/2010/07/unix-mail.html' title='Unix mail commands'/><author><name>Pedric Kng Aka Boon</name><uri>http://www.blogger.com/profile/07979744237794291200</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3053352583694970340.post-6821381852485661129</id><published>2010-07-05T20:23:00.000-07:00</published><updated>2010-07-05T20:24:28.243-07:00</updated><title type='text'>Forward root email to external email</title><content type='html'>Extracted from: http://dettox.blogspot.com/2008/01/automatic-forward-to-another-email.html&lt;br /&gt;&lt;br /&gt;Root account&lt;br /&gt;editing the file /etc/aliases we can add an email alias for every account on the server&lt;br /&gt;&lt;br /&gt;    ...&lt;br /&gt;    ftp-adm: ftp&lt;br /&gt;    ftp-admin: ftp&lt;br /&gt;    www: webmaster&lt;br /&gt;    webmaster: root&lt;br /&gt;    noc: root&lt;br /&gt;    security: root&lt;br /&gt;    hostmaster: root&lt;br /&gt;    info: postmaster&lt;br /&gt;    marketing: postmaster&lt;br /&gt;    sales: postmaster&lt;br /&gt;    support: postmaster&lt;br /&gt;    # Person who should get root's mail&lt;br /&gt;    root: root&lt;br /&gt;    ...&lt;br /&gt;&lt;br /&gt;so in this case we can write:&lt;br /&gt;&lt;br /&gt;    ...&lt;br /&gt;    root: root, example@domain.com&lt;br /&gt;    ...&lt;br /&gt;&lt;br /&gt;running the command newaliases the change will take effect:&lt;br /&gt;&lt;br /&gt;    [root@localhost ~]# newaliases&lt;br /&gt;    /etc/aliases: 77 aliases, longest 22 bytes, 791 bytes total&lt;br /&gt;    [root@localhost ~]# &lt;br /&gt;&lt;br /&gt;every mail to root@localhost will be forwarded to example@domain.com leaving a copy on the server.&lt;br /&gt;&lt;br /&gt;User account&lt;br /&gt;&lt;br /&gt;to forward user address without root privileges, just create the file .forward in the home directory with inside the name of the mail address:&lt;br /&gt;&lt;br /&gt;    [dettox@localhost ~]$ pwd&lt;br /&gt;    /home/dettox&lt;br /&gt;    [dettox@localhost ~]$ echo "example@domain.com" &gt; .forward&lt;br /&gt;    [dettox@localhost ~]$ chmod 644 .forward&lt;br /&gt;    [dettox@localhost ~]$&lt;br /&gt;&lt;br /&gt;every mail to dettox@localhost will be forwarded to example@domain.com without leaving a copy on the server.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3053352583694970340-6821381852485661129?l=itgeekhelp.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://itgeekhelp.blogspot.com/feeds/6821381852485661129/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://itgeekhelp.blogspot.com/2010/07/forward-root-email-to-external-email.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3053352583694970340/posts/default/6821381852485661129'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3053352583694970340/posts/default/6821381852485661129'/><link rel='alternate' type='text/html' href='http://itgeekhelp.blogspot.com/2010/07/forward-root-email-to-external-email.html' title='Forward root email to external email'/><author><name>Pedric Kng Aka Boon</name><uri>http://www.blogger.com/profile/07979744237794291200</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3053352583694970340.post-7988247934242237479</id><published>2010-06-30T20:27:00.000-07:00</published><updated>2010-07-01T02:21:52.024-07:00</updated><title type='text'>Android Eclipse ADT</title><content type='html'>FAQ&lt;br /&gt;&lt;br /&gt;Q: 'Gen' Folder missing. Set build path&lt;br /&gt;A: Set the following&lt;br /&gt;   Project &gt; Properties &gt; Java Compiler &gt; JDK Compliance &gt; Compiler compliance level: 1.6&lt;br /&gt;&lt;br /&gt;Q: Installation and uninstallation of Android application&lt;br /&gt;A: &lt;br /&gt;&lt;br /&gt;1. Start emulator and wait for bootup completion&lt;br /&gt; C:\android-sdk-windows\tools\emulator.exe -avd1.5&lt;br /&gt;&lt;br /&gt;2. Install application&lt;br /&gt; C:\android-sdk-windows\tools\adb install F:\Projects\Citibank\CitiE2E_Android\library_export\CitiE2ETest.apk&lt;br /&gt;&lt;br /&gt;3. Uninstall application&lt;br /&gt; i)  adb shell&lt;br /&gt; ii) ls //Show all package installed.&lt;br /&gt; iii) rm &lt;package_name&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3053352583694970340-7988247934242237479?l=itgeekhelp.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://itgeekhelp.blogspot.com/feeds/7988247934242237479/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://itgeekhelp.blogspot.com/2010/06/android-eclipse-adt.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3053352583694970340/posts/default/7988247934242237479'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3053352583694970340/posts/default/7988247934242237479'/><link rel='alternate' type='text/html' href='http://itgeekhelp.blogspot.com/2010/06/android-eclipse-adt.html' title='Android Eclipse ADT'/><author><name>Pedric Kng Aka Boon</name><uri>http://www.blogger.com/profile/07979744237794291200</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3053352583694970340.post-1836416381966816521</id><published>2010-06-01T18:53:00.000-07:00</published><updated>2010-06-01T18:54:36.757-07:00</updated><title type='text'>How to setup a Mobile Browser Emulator in Windows Mobile 6</title><content type='html'>http://www.lancelhoff.com/how-to-emulate-windows-mobile-6/&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3053352583694970340-1836416381966816521?l=itgeekhelp.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://itgeekhelp.blogspot.com/feeds/1836416381966816521/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://itgeekhelp.blogspot.com/2010/06/how-to-setup-mobile-browser-emulator-in.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3053352583694970340/posts/default/1836416381966816521'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3053352583694970340/posts/default/1836416381966816521'/><link rel='alternate' type='text/html' href='http://itgeekhelp.blogspot.com/2010/06/how-to-setup-mobile-browser-emulator-in.html' title='How to setup a Mobile Browser Emulator in Windows Mobile 6'/><author><name>Pedric Kng Aka Boon</name><uri>http://www.blogger.com/profile/07979744237794291200</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3053352583694970340.post-6119332553142792723</id><published>2010-05-25T23:14:00.000-07:00</published><updated>2010-05-25T23:15:47.100-07:00</updated><title type='text'>c\c++ compiler w. netbeans</title><content type='html'>references:&lt;br /&gt;&lt;br /&gt;http://cygwin.com/&lt;br /&gt;http://royalexander.wordpress.com/2009/03/20/configuring-cygwin-cc-compiler-for-netbeans-65-under-windows/&lt;br /&gt;http://netbeans.org/community/releases/68/cpp-setup-instructions.html&lt;br /&gt;http://netbeans.org/kb/trails/cnd.html&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3053352583694970340-6119332553142792723?l=itgeekhelp.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://itgeekhelp.blogspot.com/feeds/6119332553142792723/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://itgeekhelp.blogspot.com/2010/05/cc-compiler-w-netbeans.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3053352583694970340/posts/default/6119332553142792723'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3053352583694970340/posts/default/6119332553142792723'/><link rel='alternate' type='text/html' href='http://itgeekhelp.blogspot.com/2010/05/cc-compiler-w-netbeans.html' title='c\c++ compiler w. netbeans'/><author><name>Pedric Kng Aka Boon</name><uri>http://www.blogger.com/profile/07979744237794291200</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3053352583694970340.post-5758319456985632941</id><published>2010-04-15T19:05:00.000-07:00</published><updated>2010-05-24T23:37:50.059-07:00</updated><title type='text'>Signed Applet to Javascript</title><content type='html'>&lt;pre&gt;String lineSeparator = java.security.AccessController.doPrivileged(&lt;br /&gt;new java.security.PrivilegedAction&lt;String&gt;(){&lt;br /&gt;public String run() {return System.getProperty("line.separator");}});&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre class="prettyprint"&gt;&lt;code&gt;&lt;span class="pun"&gt;&lt;/span&gt;&lt;span class="pln"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;http://www.raditha.com/java/sandbox/unsigned.php&lt;br /&gt;http://stackoverflow.com/questions/852453/accesscontroller-doprivileged&lt;br /&gt;http://chriswongdevblog.blogspot.com/2009/08/invisible-applet.html&lt;br /&gt;http://forums.sun.com/thread.jspa?threadID=5434324&lt;br /&gt;http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4406607&lt;br /&gt;http://forums.devshed.com/java-help-9/saving-file-into-local-disc-using-applet-613357.html&lt;br /&gt;http://lwjgl.org/forum/index.php?action=printpage;topic=3186.0&lt;br /&gt;http://stackoverflow.com/questions/1068271/signed-applet-gives-accesscontrolexception-access-denied-when-calling-from-java&lt;br /&gt;http://www.snowbound.com/tech_tips/g_security_applet_java.html&lt;br /&gt;http://java.sun.com/j2se/1.4.2/docs/api/java/security/AccessController.html&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3053352583694970340-5758319456985632941?l=itgeekhelp.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://itgeekhelp.blogspot.com/feeds/5758319456985632941/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://itgeekhelp.blogspot.com/2010/04/signed-applet-to-javascript.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3053352583694970340/posts/default/5758319456985632941'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3053352583694970340/posts/default/5758319456985632941'/><link rel='alternate' type='text/html' href='http://itgeekhelp.blogspot.com/2010/04/signed-applet-to-javascript.html' title='Signed Applet to Javascript'/><author><name>Pedric Kng Aka Boon</name><uri>http://www.blogger.com/profile/07979744237794291200</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3053352583694970340.post-4220722293148854648</id><published>2010-01-20T01:56:00.000-08:00</published><updated>2010-01-20T19:44:58.145-08:00</updated><title type='text'>RPM commands</title><content type='html'>Some common rpm commands&lt;br /&gt;&lt;br /&gt;1. Install&lt;br /&gt;rpm -i &lt;rpm files=""&gt;&lt;br /&gt;&lt;br /&gt;2. Remove&lt;br /&gt;rpm -e&lt;package&gt;&lt;br /&gt;&lt;br /&gt;3. List all installed packages&lt;br /&gt;rpm -qa[ i &lt;more information=""&gt;]&lt;/more&gt;&lt;/package&gt;&lt;/rpm&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3053352583694970340-4220722293148854648?l=itgeekhelp.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://itgeekhelp.blogspot.com/feeds/4220722293148854648/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://itgeekhelp.blogspot.com/2010/01/rpm-commands.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3053352583694970340/posts/default/4220722293148854648'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3053352583694970340/posts/default/4220722293148854648'/><link rel='alternate' type='text/html' href='http://itgeekhelp.blogspot.com/2010/01/rpm-commands.html' title='RPM commands'/><author><name>Pedric Kng Aka Boon</name><uri>http://www.blogger.com/profile/07979744237794291200</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3053352583694970340.post-3324380822905633241</id><published>2010-01-18T00:45:00.000-08:00</published><updated>2010-01-18T06:02:54.389-08:00</updated><title type='text'>Installing default EJBCA on Fedora 10</title><content type='html'>Installation packages&lt;br /&gt;- jdk 1.5&lt;br /&gt;- ejbca 3.9.2&lt;br /&gt;- JBOSS 5.1&lt;br /&gt;- Ant 1.7.1 &gt;= 1.6.5&lt;br /&gt;- install Java Cryptography Extension (JCE) Unlimited Strength Jurisdiction Policy Files 5.0 http://java.sun.com/j2se/1.5.0/download.jsp&lt;br /&gt;&lt;br /&gt;-----------------------------------------------------------------------------------&lt;br /&gt;&lt;br /&gt;1) Install the following packages:&lt;br /&gt;&lt;br /&gt;yum install ant-nodeps&lt;br /&gt;yum install xdoclet&lt;br /&gt;yum install xjavadoc //optional&lt;br /&gt;&lt;br /&gt;2) install sun java 1.5 and Unlimited strength policy(readme.txt in zip).&lt;br /&gt;3) unzip jboss 1.5 and ejbca to required folder.&lt;br /&gt;4) Add the following lines to /etc/profile&lt;br /&gt;&lt;br /&gt;# User specific aliases and functions&lt;br /&gt;# The following are the environment variables for Java and JBOSS&lt;br /&gt;&lt;br /&gt;export JAVA_HOME=/usr/java/jdk1.5.0_22&lt;br /&gt;export PATH=$PATH:$JAVA_HOME/bin&lt;br /&gt;&lt;br /&gt;export JBOSS_HOME=/opt/jboss-5.1.0.GA&lt;br /&gt;export PATH=$PATH:$JBOSS_HOME/bin&lt;br /&gt;&lt;br /&gt;export APPSRV_HOME=$JBOSS_HOME&lt;br /&gt;export ANT_OPTS=-Xmx512m&lt;br /&gt;&lt;br /&gt;export EJBCA_HOME=ejbca_3_9_2&lt;br /&gt;&lt;br /&gt;5) In $APPSRV_HOME/bin/run.conf, edit the following:&lt;br /&gt;JAVA_OPTS="-server -Xms128m -Xmx512m" //Optional&lt;br /&gt;&lt;br /&gt;6) JBoss 5.x have a bug causing issues with the BC JCE provider. To work around this you can copy the files EJBCA_HOME/lib/bc*.jar to JBOSS_HOME/server/default/lib/. &lt;br /&gt;cp -s EJBCA_HOME/lib/bc*.jar JBOSS_HOME/server/default/lib/.&lt;br /&gt;&lt;br /&gt;7) $EJBCA_HOME/ant bootstrap //Compile, jar, war, ear everything and deploy it to JBoss. &lt;br /&gt;&lt;br /&gt;8) Start JBOSS&lt;br /&gt;$APPSRV_HOME/bin/./run.sh -b 0.0.0.0 //bind(b) allow access via ip address instead of localhost only.&lt;br /&gt;JBoss should deploy the ear without errors.&lt;br /&gt;&lt;br /&gt;9) $EJBCA_HOME/ant install //generate all certificates, keys, etc &lt;br /&gt;admin keys will be stored in ${ejbca.home}/p12&lt;br /&gt;Adds data to jboss/server/default/data/hypersonic database&lt;br /&gt;*Only run once.&lt;br /&gt;tomcat.jks is for the servlet container (don't bother with it) &lt;br /&gt;truststore.jks is for the servlet container (don't bother with it) &lt;br /&gt;superadmin.p12 should be imported in your browser, that's your administration certificate.&lt;br /&gt;&lt;br /&gt;10) Stop JBoss&lt;br /&gt;&lt;br /&gt;11) $EJBCA_HOME/ant deploy&lt;br /&gt;deploy everything again and configure the servlet container with the keystore file(HTTPS) (this is why we needed to stop the container). &lt;br /&gt;&lt;br /&gt;12) Import the certificate from $EJBCA_HOME/p12/superadmin.p12 into the browser. This is for administration access.&lt;br /&gt;Default password for superadmin.p12: ejbca //configured in ejbca.properties&lt;br /&gt;&lt;br /&gt;13) Start JBoss&lt;br /&gt;https://&lt;ipaddress&gt;:8443/ejbca //admin-GUI *superadmin.p12 provide the admin login.&lt;br /&gt;http://localhost:8080/ejbca //public page w/o administration&lt;br /&gt;&lt;br /&gt;*To add recognised CA signed SSL&lt;br /&gt;$ant -Dca.name="My CA Name" javatruststore&lt;br /&gt;- adds the CA certificate to p12/truststore.jks &lt;br /&gt;- copies this 'truststore.jks' to $JBOSS_HOME/server/default/conf/keystore&lt;br /&gt;- Stop and start tomcat&lt;br /&gt;&lt;br /&gt;------------------------------------------------------------------------------------&lt;br /&gt;Tips:&lt;br /&gt;version of EJBCA - $EJBCA_HOME/ant ejbcaversion&lt;br /&gt;&lt;br /&gt;EJB CA properties - conf/ejbca.properties &lt;br /&gt;Database properties - conf/database.properties &lt;br /&gt;&lt;br /&gt;Files deployed &lt;br /&gt;- ant bootstrap &lt;br /&gt; - deploy/ejbca-ds.xml &lt;br /&gt; - deploy/ejbca-mail-service.xml &lt;br /&gt; - deploy/ejbca.ear &lt;br /&gt;&lt;br /&gt;- ant deploy &lt;br /&gt; - Files from ant bootstrap &lt;br /&gt; - conf/keystore/keystore.jk &lt;br /&gt; - conf/keystore/truststore.jks &lt;br /&gt; - deploy/jboss-web.deployer/server.xml &lt;br /&gt;&lt;br /&gt;------------------------------------------------------------------------------------&lt;br /&gt;Reference&lt;br /&gt;http://www.ejbca.org/installation.html&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3053352583694970340-3324380822905633241?l=itgeekhelp.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://itgeekhelp.blogspot.com/feeds/3324380822905633241/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://itgeekhelp.blogspot.com/2010/01/installing-default-ejbca-on-fedora-10.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3053352583694970340/posts/default/3324380822905633241'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3053352583694970340/posts/default/3324380822905633241'/><link rel='alternate' type='text/html' href='http://itgeekhelp.blogspot.com/2010/01/installing-default-ejbca-on-fedora-10.html' title='Installing default EJBCA on Fedora 10'/><author><name>Pedric Kng Aka Boon</name><uri>http://www.blogger.com/profile/07979744237794291200</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3053352583694970340.post-5940800649278565544</id><published>2009-12-01T05:57:00.001-08:00</published><updated>2009-12-01T06:25:33.708-08:00</updated><title type='text'>gcc library missing during run</title><content type='html'>&lt;tt class="FILENAME"&gt;edit /etc/ld.so.conf and &lt;/tt&gt;run &lt;code class="literal"&gt;ldconfig.&lt;/code&gt;&lt;br /&gt;&lt;tt class="FILENAME"&gt;&lt;br /&gt;In fedora&lt;br /&gt;&lt;/tt&gt;&lt;tt class="FILENAME"&gt;/etc/ld.so.conf -&gt; include &lt;/tt&gt;&lt;tt class="FILENAME"&gt;/etc/ld.so.conf.d/&lt;br /&gt;&lt;br /&gt;all config in the above folder should include lib directory&lt;br /&gt;&lt;br /&gt;e.g. pbc.conf&lt;br /&gt;/usr/local/lib&lt;br /&gt;&lt;/tt&gt;&lt;br /&gt;&lt;br /&gt;http://www.dwheeler.com/secure-programs/Secure-Programs-HOWTO/dlls.html&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3053352583694970340-5940800649278565544?l=itgeekhelp.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://itgeekhelp.blogspot.com/feeds/5940800649278565544/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://itgeekhelp.blogspot.com/2009/12/gcc-library-missing-during-run.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3053352583694970340/posts/default/5940800649278565544'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3053352583694970340/posts/default/5940800649278565544'/><link rel='alternate' type='text/html' href='http://itgeekhelp.blogspot.com/2009/12/gcc-library-missing-during-run.html' title='gcc library missing during run'/><author><name>Pedric Kng Aka Boon</name><uri>http://www.blogger.com/profile/07979744237794291200</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3053352583694970340.post-3927111440388394437</id><published>2009-10-20T01:13:00.000-07:00</published><updated>2009-10-20T01:14:33.892-07:00</updated><title type='text'>SunJDK weblogic</title><content type='html'>Reference: http://buttso.blogspot.com/2009/09/switching-between-jrockit-and-sun-jdk.html&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;h3 class="post-title entry-title"&gt; &lt;a href="http://buttso.blogspot.com/2009/09/switching-between-jrockit-and-sun-jdk.html"&gt;Switching Between JRockit and Sun JDK with WebLogic Server&lt;/a&gt; &lt;/h3&gt;   Need to swap between JRockit and the Sun JDK when starting your WebLogic Server instance?&lt;br /&gt;&lt;br /&gt;Looking at the start scripts &lt;span style="font-family: Courier;"&gt;$DOMAIN_HOME/bin/setDomainEnv.cmd&lt;/span&gt;, I just realized that this operational task is basically taken care of in the scripts we have. &lt;br /&gt;&lt;br /&gt;To swap between the Sun JDK and JRockit to launch a WLS instance, all you need to do is set the JAVA_VENDOR environment variable to either "Sun" or "Oracle" and the scripts will take of launching WLS using the specified JDK.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Snippets from setDomainEnv.cmd:&lt;/b&gt;&lt;br /&gt;&lt;div style="padding: 10px; font-family: courier; background-color: rgb(204, 204, 153); width: 95%;"&gt;&lt;pre&gt;set BEA_JAVA_HOME=d:\wls1031\jrockit_160_05_R27.6.2-20&lt;br /&gt;set SUN_JAVA_HOME=d:\wls1031\jdk160_11&lt;br /&gt;&lt;br /&gt;if "%JAVA_VENDOR%"=="Oracle" (&lt;br /&gt;set JAVA_HOME=%BEA_JAVA_HOME%&lt;br /&gt;) else (&lt;br /&gt;if "%JAVA_VENDOR%"=="Sun" (&lt;br /&gt;set JAVA_HOME=%SUN_JAVA_HOME%&lt;br /&gt;) else (&lt;br /&gt;set JAVA_VENDOR=Sun&lt;br /&gt;set JAVA_HOME=d:\wls1031\jdk160_11&lt;br /&gt;)&lt;br /&gt;)&lt;/pre&gt;&lt;/div&gt;&lt;br /&gt;Where JAVA_HOME is then used by startWebLogic.cmd script when it launches the WLS instance to identify the JDK to use.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Snippets from startWebLogic.cmd&lt;/b&gt;&lt;br /&gt;&lt;div style="padding: 10px; font-family: courier; background-color: rgb(204, 204, 153);"&gt;&lt;pre&gt;%JAVA_HOME%\bin\java %JAVA_VM% %MEM_ARGS%&lt;br /&gt;-Dweblogic.Name=%SERVER_NAME%&lt;br /&gt;-Djava.security.policy=%WL_HOME%\server\lib\weblogic.policy&lt;br /&gt;%JAVA_OPTIONS%&lt;br /&gt;%PROXY_SETTINGS%&lt;br /&gt;%SERVER_CLASS%&lt;/pre&gt;&lt;/div&gt;&lt;br /&gt;With this information at hand, then switching between the two different JDKs is as simple as setting an environment variable before launching WebLogic Server.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Using JRockit:&lt;/b&gt;&lt;br /&gt;&lt;div style="padding: 10px; font-family: courier; background-color: rgb(204, 204, 153);"&gt;&lt;pre&gt;&gt;set JAVA_VENDOR=Oracle&lt;br /&gt;&gt;startWebLogic.cmd&lt;br /&gt;...&lt;br /&gt;d:\wls1031\JROCKI~1.2-2\bin\java -jrockit -Xms512m -Xmx512m -Dweblogic.Name=AdminServer ...&lt;/pre&gt;&lt;/div&gt;&lt;br /&gt;And just as easy to switch back to Sun. Note here that you could just unset the JAVA_HOME environment variable, which will set the script to use whatever default was configured when the domain was created.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Using Sun JDK:&lt;/b&gt;&lt;br /&gt;&lt;div style="padding: 10px; font-family: courier; background-color: rgb(204, 204, 153);"&gt;&lt;pre&gt;&gt;set JAVA_VENDOR=Sun&lt;br /&gt;&gt;startWebLogic.cmd&lt;br /&gt;...&lt;br /&gt;d:\wls1031\JDK160~1\bin\java -client -Xms256m -Xmx512m -Dweblogic.Name=AdminServer ...&lt;/pre&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3053352583694970340-3927111440388394437?l=itgeekhelp.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://itgeekhelp.blogspot.com/feeds/3927111440388394437/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://itgeekhelp.blogspot.com/2009/10/sunjdk-weblogic.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3053352583694970340/posts/default/3927111440388394437'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3053352583694970340/posts/default/3927111440388394437'/><link rel='alternate' type='text/html' href='http://itgeekhelp.blogspot.com/2009/10/sunjdk-weblogic.html' title='SunJDK weblogic'/><author><name>Pedric Kng Aka Boon</name><uri>http://www.blogger.com/profile/07979744237794291200</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3053352583694970340.post-2776584355699757408</id><published>2009-10-12T07:37:00.000-07:00</published><updated>2010-02-10T18:13:59.300-08:00</updated><title type='text'>OpenSSL resources</title><content type='html'>http://www.dylanbeattie.net/docs/openssl_iis_ssl_howto.html&lt;br /&gt;http://www.herongyang.com/crypto/OpenSSL_Signing_keytool_CSR_5.html&lt;br /&gt;http://security.ncsa.uiuc.edu/research/grid-howtos/usefulopenssl.php&lt;br /&gt;&lt;br /&gt;To view the details of the certificate signing request contained in the file server.csr, use:&lt;br /&gt;&lt;code&gt;openssl req -noout -text -in server.csr&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;c:\OpenSSL\bin\openssl asn1parse -inform der -in demo.p7 -i &gt; c:\demo.asn1&lt;br /&gt;&lt;br /&gt;c:\OpenSSL\bin\openssl pkcs7 -inform der -in demo.p7 -text -print_certs -noout&lt;br /&gt;&lt;br /&gt;View certificate details&lt;br /&gt;C:\Program Files\LunaPCI\keys&gt;openssl x509 -inform PEM -in cert0.cer -text&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;------------------------------------------------------------------------------&lt;br /&gt;&lt;br /&gt;&lt;/code&gt;&lt;pre&gt;1) Generate RSA key:&lt;br /&gt; $ openssl genrsa -out key.pem 1024&lt;br /&gt; $ openssl rsa -in key.pem -text -noout&lt;br /&gt;&lt;br /&gt;2) Save public key in pub.pem file:&lt;br /&gt; $ openssl rsa -in key.pem -pubout -out pub.pem&lt;br /&gt; $ openssl rsa -in pub.pem -pubin -text -noout&lt;br /&gt;&lt;br /&gt;3) Encrypt some data:&lt;br /&gt; $ echo test test test &gt; file.txt&lt;br /&gt; $ openssl rsautl -encrypt -inkey pub.pem -pubin -in file.txt \&lt;br /&gt;-out file.bin&lt;br /&gt; $ ll file.bin&lt;br /&gt; -rw-r--r-- 1 root root 128 2007-07-11 01:58 file.bin&lt;br /&gt;&lt;br /&gt;4) Decrypt encrypted data:&lt;br /&gt; $ openssl rsautl -decrypt -inkey key.pem -in file.bin&lt;br /&gt; test test test&lt;br /&gt;&lt;br /&gt;But you should have public key in so called SubjectPublicKeyInfo format&lt;br /&gt;(look at RFC2459).&lt;br /&gt;You can look at ASN.1 structure of public key with command:&lt;br /&gt;$ openssl asn1parse -in pub.pem&lt;br /&gt;  0:d=0  hl=3 l= 159 cons: SEQUENCE&lt;br /&gt;  3:d=1  hl=2 l=  13 cons: SEQUENCE&lt;br /&gt;  5:d=2  hl=2 l=   9 prim: OBJECT            :rsaEncryption&lt;br /&gt; 16:d=2  hl=2 l=   0 prim: NULL&lt;br /&gt; 18:d=1  hl=3 l= 141 prim: BIT STRING&lt;br /&gt;&lt;br /&gt;Sample Public key&lt;br /&gt;-----BEGIN PUBLIC KEY-----&lt;br /&gt;MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDRzVwcS4JP8K5iihVc4j26QZWp&lt;br /&gt;4n4Bh9cTxdCovsrCd50lxPNRUPPGqPcPwYGLVyyTG8+DR9RtqcVrC3gYtI20G2+0&lt;br /&gt;HbWTRWAAa/LF/x937nt3Q92CDu010eRY0CDtvyLcg90yLV/84TOc5PRwbCwuURgu&lt;br /&gt;3Nzn+7BiEZ7lYCyXGQIDAQAB&lt;br /&gt;-----END PUBLIC KEY-----&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;------------------------------------------------------------------------------&lt;br /&gt;For public key in hex64 ending with '==', use openssl asn1parse -in c:\maybank.pem&lt;br /&gt;&lt;br /&gt;-----BEGIN PUBLIC KEY-----&lt;br /&gt;MIGIAoGAq74V/tQfDXWpO821eujW9MOpSROdVKQXncV3m+k1K0Vmnu8QGSzvFq5cBe7R6uHB&lt;br /&gt;/J5gHKwFVG6XgrqjVa46gprk+8vQFfLfshHcFf/Vv79Ykpj0/PWaCAvp7uvcFKKByb1cDhAu&lt;br /&gt;PDmzbBJYMyg7nG3dmAzhEqPK+LLOQ5s7mHkCAwEAAQ==&lt;br /&gt;-----END PUBLIC KEY-----&lt;br /&gt;&lt;br /&gt;------------------------------------------------------------------------------&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt;&lt;/code&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3053352583694970340-2776584355699757408?l=itgeekhelp.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://itgeekhelp.blogspot.com/feeds/2776584355699757408/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://itgeekhelp.blogspot.com/2009/10/openssl-resources.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3053352583694970340/posts/default/2776584355699757408'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3053352583694970340/posts/default/2776584355699757408'/><link rel='alternate' type='text/html' href='http://itgeekhelp.blogspot.com/2009/10/openssl-resources.html' title='OpenSSL resources'/><author><name>Pedric Kng Aka Boon</name><uri>http://www.blogger.com/profile/07979744237794291200</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3053352583694970340.post-3952368040304807759</id><published>2009-10-08T01:24:00.001-07:00</published><updated>2009-10-08T01:24:59.357-07:00</updated><title type='text'>Netbeans Sign jar</title><content type='html'>http://ezzatron.com/2009/09/29/automatically-signing-jar-files-in-netbeans/&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3053352583694970340-3952368040304807759?l=itgeekhelp.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://itgeekhelp.blogspot.com/feeds/3952368040304807759/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://itgeekhelp.blogspot.com/2009/10/netbeans-sign-jar.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3053352583694970340/posts/default/3952368040304807759'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3053352583694970340/posts/default/3952368040304807759'/><link rel='alternate' type='text/html' href='http://itgeekhelp.blogspot.com/2009/10/netbeans-sign-jar.html' title='Netbeans Sign jar'/><author><name>Pedric Kng Aka Boon</name><uri>http://www.blogger.com/profile/07979744237794291200</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3053352583694970340.post-2654388663227613278</id><published>2009-09-09T23:15:00.000-07:00</published><updated>2009-09-10T02:30:10.425-07:00</updated><title type='text'>Vmware: Weblogic 9.2, solaris 9, JDK 1.5_12</title><content type='html'>1. Download solaris 9 from sun.com //Hint: Use Sun download manager&lt;br /&gt;2. Download Weblogic 9.2 from BEA(Oracle) website&lt;br /&gt;3. Download Sun JDK 1.5_12 from sun.com for solaris.&lt;br /&gt;&lt;br /&gt;4. Install Solaris 9 iso onto vmware&lt;br /&gt;  http://pubs.vmware.com/guestnotes/wwhelp/wwhimpl/common/html/wwhelp.htm?context=guestnotes&amp;amp;file=guestos_solaris9.html&lt;br /&gt;&lt;br /&gt;5. Install JDK 1.5_12 into iso&lt;br /&gt;  http://java.sun.com/j2se/1.5.0/install-solaris.html&lt;br /&gt;6. Install BEA Weblogic 9.2 referencing JDK 1.5_12&lt;br /&gt;http://download.oracle.com/docs/cd/E13196_01/platform/suppconfigs/configs/solaris/solaris9_91.html#96804&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3053352583694970340-2654388663227613278?l=itgeekhelp.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://itgeekhelp.blogspot.com/feeds/2654388663227613278/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://itgeekhelp.blogspot.com/2009/09/vmware-weblogic-92-solaris-9-jdk-1512.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3053352583694970340/posts/default/2654388663227613278'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3053352583694970340/posts/default/2654388663227613278'/><link rel='alternate' type='text/html' href='http://itgeekhelp.blogspot.com/2009/09/vmware-weblogic-92-solaris-9-jdk-1512.html' title='Vmware: Weblogic 9.2, solaris 9, JDK 1.5_12'/><author><name>Pedric Kng Aka Boon</name><uri>http://www.blogger.com/profile/07979744237794291200</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3053352583694970340.post-6108128942091524602</id><published>2009-09-04T01:38:00.000-07:00</published><updated>2009-09-07T00:49:24.755-07:00</updated><title type='text'>WebLogic truststore keystore</title><content type='html'>references:&lt;br /&gt;http://jonwilliams.wordpress.com/2009/07/27/configure-ssl-for-nodemanager/&lt;br /&gt;http://download.oracle.com/docs/cd/E13222_01/wls/docs92/ConsoleHelp/taskhelp/security/ConfigureKeystoresAndSSL.html&lt;br /&gt;http://download.oracle.com/docs/cd/E13222_01/wls/docs92/secmanage/ssl.html&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Weblogic default&lt;br /&gt;-keystore : DemoIdentity.jks \ DemoIdentityKeyStorePassPhrase&lt;br /&gt;-truststore : DemoTrust.jks \ DemoTrustKeyStorePassPhrase&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3053352583694970340-6108128942091524602?l=itgeekhelp.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://itgeekhelp.blogspot.com/feeds/6108128942091524602/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://itgeekhelp.blogspot.com/2009/09/weblogic-truststore-keystore.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3053352583694970340/posts/default/6108128942091524602'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3053352583694970340/posts/default/6108128942091524602'/><link rel='alternate' type='text/html' href='http://itgeekhelp.blogspot.com/2009/09/weblogic-truststore-keystore.html' title='WebLogic truststore keystore'/><author><name>Pedric Kng Aka Boon</name><uri>http://www.blogger.com/profile/07979744237794291200</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3053352583694970340.post-2735973279289877627</id><published>2009-08-02T19:45:00.000-07:00</published><updated>2009-08-02T20:01:31.964-07:00</updated><title type='text'>Java Tracing &amp; logging</title><content type='html'>Reference from: http://java.sun.com/javase/6/docs/technotes/guides/deployment/deployment-guide/tracing_logging.html&lt;br /&gt;&lt;br /&gt;&lt;h2&gt;Tracing&lt;/h2&gt; &lt;p&gt;Tracing is a facility to redirect any output in the Java Console to a trace    file. &lt;/p&gt; &lt;h3&gt;Java Plug-in&lt;/h3&gt; &lt;p&gt;Tracing can be turned on by enabling the property &lt;code&gt;javaplugin.trace&lt;/code&gt;.    However, it turns on all tracing facilities inside Java Plug-in. To enable more    fine-grained tracing,&lt;code&gt; javaplugin.trace.option&lt;/code&gt; may be used. You    can set trace-level options (0-5) in the &lt;a href="http://java.sun.com/javase/6/docs/technotes/guides/deployment/deployment-guide/console.html"&gt;Java    Console&lt;/a&gt;, shown in the previous chapter, with the following meanings:&lt;/p&gt; &lt;ul&gt;&lt;li&gt;0 — off&lt;/li&gt;&lt;li&gt;1 — basic&lt;/li&gt;&lt;li&gt;2 — network, cache, and basic&lt;/li&gt;&lt;li&gt;3 — security, network and basic&lt;/li&gt;&lt;li&gt;4 — extension, security, network and basic&lt;/li&gt;&lt;li&gt;5 — LiveConnect, extension, security, network, temp, and basic&lt;/li&gt;&lt;/ul&gt; &lt;p&gt;This enables tracing on the fly.&lt;/p&gt; &lt;p&gt;Another way to set fine-grained tracing is through the &lt;a href="http://java.sun.com/javase/6/docs/technotes/guides/deployment/deployment-guide/jcp.html"&gt;Java    Control Panel&lt;/a&gt;. For instance, to enable tracing for everthing (option 5 above),    enter the following in the "Java Run Time Parameters" textfield:&lt;/p&gt; &lt;blockquote&gt;    &lt;p&gt;&lt;code&gt;-Djavaplugin.trace=true&lt;br /&gt;   -Djavaplugin.trace.option=basic|net|cache|security|ext|liveconnect|temp&lt;/code&gt;&lt;/p&gt; &lt;/blockquote&gt; &lt;p&gt;Tracing set through the Control Panel will take effect when the Plug-in is    launched, but changes made through the Control Panel while a Plug-in is running    will have no effect until restart.&lt;/p&gt; &lt;h3&gt;Java Web Start&lt;/h3&gt; &lt;p&gt; To set the initial trace level for a Java Web Start application  set the deployment property deployment.trace.level. The &lt;code&gt;deployment.trace.level&lt;/code&gt; property can have one of the following values: &lt;/p&gt; &lt;ul&gt;&lt;li&gt;basic&lt;/li&gt;&lt;li&gt;cache&lt;/li&gt;&lt;li&gt;net&lt;/li&gt;&lt;li&gt;security&lt;/li&gt;&lt;li&gt;ext&lt;/li&gt;&lt;li&gt;liveconnect &lt;/li&gt;&lt;/ul&gt; &lt;p&gt;To use all the tracing level set &lt;code&gt;deployment.trace.level&lt;/code&gt; to &lt;code&gt;all&lt;/code&gt;.&lt;/p&gt; &lt;h2&gt;&lt;a name="logging"&gt;&lt;/a&gt;Logging&lt;/h2&gt; &lt;p&gt;Similar to tracing, logging is a facility to redirect any output in the Java    Console to a log file using the Java Logging API. To enable logging perform the following actions: &lt;/p&gt; &lt;ul&gt;&lt;li&gt;Open Java Control Panel&lt;/li&gt;&lt;li&gt;Click &lt;strong&gt;Advanced&lt;/strong&gt; tab.&lt;/li&gt;&lt;li&gt;Select &lt;strong&gt;Enable Logging&lt;/strong&gt; under the &lt;strong&gt;Debugging&lt;/strong&gt; option            &lt;/li&gt;&lt;/ul&gt; &lt;blockquote&gt;   &lt;p&gt; &lt;/p&gt; &lt;/blockquote&gt; &lt;h2&gt;&lt;a name="other"&gt;&lt;/a&gt;Other Options&lt;/h2&gt;  &lt;h3&gt;File Names&lt;/h3&gt; &lt;p&gt;The names of the trace and log files are&lt;/p&gt; &lt;blockquote&gt;    &lt;p&gt;&lt;code&gt;plugin&lt;modified&gt;.trace&lt;/modified&gt;&lt;/code&gt;&lt;br /&gt;    &lt;code&gt;plugin&lt;modified&gt;.log&lt;/modified&gt;&lt;/code&gt;&lt;/p&gt; &lt;/blockquote&gt; &lt;p&gt;where the &lt;code&gt;&lt;modified&gt;&lt;/modified&gt;&lt;/code&gt; includes the  major, minor and patch version numbers; e.g., &lt;code&gt;plugin142_06.trace&lt;/code&gt; or &lt;code&gt;plugin150.log&lt;/code&gt;&lt;/p&gt; &lt;h3&gt;File Locations&lt;/h3&gt; &lt;p&gt;The default location (directory) of the trace and log files is:&lt;/p&gt; &lt;ul&gt;&lt;li&gt;&lt;code&gt;&lt;user.home&gt;/.java/deployment/log&lt;/user.home&gt;&lt;/code&gt; on Unix/Linux&lt;/li&gt;&lt;li&gt;&lt;code&gt;&lt;user&gt;\Sun\Java\Deployment\log&lt;/user&gt;&lt;/code&gt; on Windows&lt;/li&gt;&lt;/ul&gt; &lt;p&gt;where &lt;code&gt;&lt;user&gt;&lt;/user&gt;&lt;/code&gt;  is as defined &lt;a href="http://java.sun.com/javase/6/docs/technotes/guides/plugin/developer_guide/version.html#property"&gt;here&lt;/a&gt;.&lt;/p&gt; &lt;p&gt;If the environment variable &lt;code&gt;USER_JPI_PROFILE&lt;/code&gt; is set to   &lt;code&gt;&lt;user&gt;&lt;/user&gt;&lt;/code&gt; then the trace and log  files will be written to:&lt;/p&gt; &lt;ul&gt;&lt;li&gt;&lt;code&gt;&lt;user&gt;/.java/deployment/log&lt;/user&gt;&lt;/code&gt; on Unix/Linux&lt;/li&gt;&lt;li&gt;&lt;code&gt;&lt;user&gt;\Sun\Java\Deployment\log&lt;/user&gt;&lt;/code&gt; on Windows&lt;/li&gt;&lt;/ul&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3053352583694970340-2735973279289877627?l=itgeekhelp.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://itgeekhelp.blogspot.com/feeds/2735973279289877627/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://itgeekhelp.blogspot.com/2009/08/java-tracing-logging.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3053352583694970340/posts/default/2735973279289877627'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3053352583694970340/posts/default/2735973279289877627'/><link rel='alternate' type='text/html' href='http://itgeekhelp.blogspot.com/2009/08/java-tracing-logging.html' title='Java Tracing &amp; logging'/><author><name>Pedric Kng Aka Boon</name><uri>http://www.blogger.com/profile/07979744237794291200</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3053352583694970340.post-2503630301863940120</id><published>2009-07-29T00:35:00.000-07:00</published><updated>2009-07-29T00:36:01.760-07:00</updated><title type='text'>Personal 2D barcode</title><content type='html'>http://mobilecodes.nokia.com/create.jsp?terms=accepted&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3053352583694970340-2503630301863940120?l=itgeekhelp.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://itgeekhelp.blogspot.com/feeds/2503630301863940120/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://itgeekhelp.blogspot.com/2009/07/personal-2d-barcode.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3053352583694970340/posts/default/2503630301863940120'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3053352583694970340/posts/default/2503630301863940120'/><link rel='alternate' type='text/html' href='http://itgeekhelp.blogspot.com/2009/07/personal-2d-barcode.html' title='Personal 2D barcode'/><author><name>Pedric Kng Aka Boon</name><uri>http://www.blogger.com/profile/07979744237794291200</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3053352583694970340.post-3134324564160360129</id><published>2009-07-28T21:23:00.000-07:00</published><updated>2009-07-29T00:35:47.970-07:00</updated><title type='text'>log4J internationalization &amp; localisation</title><content type='html'>http://java.sun.com/developer/technicalArticles/Intl/ResourceBundles/&lt;br /&gt;http://java.sun.com/docs/books/tutorial/i18n/index.html&lt;br /&gt;http://forums.sun.com/thread.jspa?threadID=5370732&amp;amp;tstart=60&lt;br /&gt;http://blogs.sun.com/CoreJavaTechTips/entry/logging_localized_message&lt;br /&gt;&lt;br /&gt;Log4J internationalization&lt;br /&gt;http://forums.sun.com/thread.jspa?threadID=770074&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;h3 class="post-title"&gt; &lt;a href="http://javahowto.blogspot.com/2006/05/debug-java-util-missingresourceexcepti.html"&gt;Debug java util MissingResourceException&lt;/a&gt; &lt;/h3&gt;    &lt;p&gt; java.util.MissingResourceException Can't find bundle for base name, locale...How did I get this exception? The crux of this problem is the requested resource, in most cases, a properties file, is not configured correctly in the classpath. For example, you have a properties file, &lt;code&gt;connection.properties&lt;/code&gt;, in the same source directory as Java source files. Javac will compile *.java into *.class in a target directory such as &lt;code&gt;build/classes&lt;/code&gt;, which is in your runtime classpath. But &lt;code&gt;connection.properties&lt;/code&gt; is not copied into &lt;code&gt;build/classes&lt;/code&gt; directory unless you either add a &lt;code&gt;&lt;copy&gt; &lt;/code&gt;task after&lt;code&gt; &lt;javac&gt; &lt;/code&gt;in the Ant build file, or do so manually. &lt;/p&gt;  &lt;p&gt; How to fix it? Make sure this resource is configured correctly in the classpath through one of the following: &lt;/p&gt; &lt;ul&gt;&lt;li&gt;Like I said above, copy the resource from source directory to &lt;code&gt;build/classes&lt;/code&gt; directory, which is in the classpath.&lt;/li&gt;&lt;/ul&gt;&lt;ul&gt;&lt;ul&gt;&lt;li&gt;If your code is like &lt;code&gt;ResourceBundle.getBundle("connection"), &lt;/code&gt;then after copying you should have &lt;code&gt;build/classes/connection.properties.&lt;/code&gt;&lt;/li&gt;&lt;/ul&gt;&lt;ul&gt;&lt;li&gt;If your code is like &lt;code&gt;ResourceBundle.getBundle("com.javahowto.test.connection"), &lt;/code&gt;then after copying you should have &lt;code&gt;build/classes/com/javahowto/test/connection.properties.&lt;/code&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;ul&gt;&lt;li&gt;Or you can choose package resources into a jar file, say, &lt;code&gt;connection-info.jar&lt;/code&gt;, which is included in runtime classpath (not needed in Javac classpath).&lt;/li&gt;&lt;/ul&gt;&lt;ul&gt;&lt;ul&gt;&lt;li&gt;If your code is like &lt;code&gt;ResourceBundle.getBundle("connection"),&lt;/code&gt; then &lt;code&gt;connection-info.jar&lt;/code&gt; should contain this entry: &lt;code&gt;connection.properties&lt;/code&gt;.&lt;/li&gt;&lt;/ul&gt;&lt;ul&gt;&lt;li&gt;If your code is like &lt;code&gt;ResourceBundle.getBundle("com.javahowto.test.connection")&lt;/code&gt;, then &lt;code&gt;connection-info.jar&lt;/code&gt; should contain this entry: &lt;code&gt;com/javahowto/test/connection.properties&lt;/code&gt;.&lt;/li&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;ul&gt;&lt;li&gt;Or you can choose to put the resource in a separate &lt;code&gt;resources&lt;/code&gt; directory, include &lt;code&gt;resources&lt;/code&gt; directory in runtime classpath. This way you don't have to duplicate the resource in multiple directories/jar. The disadvantage is it's a little inconvenient at development time to have resource in a separate directory than Java code.&lt;/li&gt;&lt;/ul&gt;&lt;ul&gt;&lt;ul&gt;&lt;li&gt;If your code is like &lt;code&gt;ResourceBundle.getBundle("connection")&lt;/code&gt;, then you should have &lt;code&gt;resources/connection.properties&lt;/code&gt;.&lt;/li&gt;&lt;/ul&gt;&lt;ul&gt;&lt;li&gt;If your code is like &lt;code&gt;ResourceBundle.getBundle("com.javahowto.test.connection")&lt;/code&gt;, then you should have &lt;code&gt;resources/com/javahowto/test/connection.properties&lt;/code&gt;.&lt;/li&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3053352583694970340-3134324564160360129?l=itgeekhelp.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://itgeekhelp.blogspot.com/feeds/3134324564160360129/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://itgeekhelp.blogspot.com/2009/07/log4j-internationalization-localisation.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3053352583694970340/posts/default/3134324564160360129'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3053352583694970340/posts/default/3134324564160360129'/><link rel='alternate' type='text/html' href='http://itgeekhelp.blogspot.com/2009/07/log4j-internationalization-localisation.html' title='log4J internationalization &amp; localisation'/><author><name>Pedric Kng Aka Boon</name><uri>http://www.blogger.com/profile/07979744237794291200</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3053352583694970340.post-3079899561119321939</id><published>2009-07-28T19:14:00.000-07:00</published><updated>2009-07-28T19:30:55.427-07:00</updated><title type='text'>J2ME barcode libraries</title><content type='html'>available Java ME barcode libraries:&lt;br /&gt;&lt;a href="http://sourceforge.net/projects/readbarj/" target="_blank"&gt;http://sourceforge.net/projects/readbarj/&lt;/a&gt;&lt;br /&gt;&lt;a href="http://code.google.com/p/zxing/" target="_blank"&gt;http://code.google.com/p/zxing/&lt;/a&gt;&lt;br /&gt;http://code.google.com/p/zxing/wiki/GetTheReader&lt;br /&gt;&lt;a href="http://people.inf.ethz.ch/adelmanr/batoo/index.php" target="_blank"&gt;http://people.inf.ethz.ch/adelmanr/batoo/index.php&lt;/a&gt;&lt;br /&gt;&lt;a href="http://code.google.com/p/jjil/"&gt;http://code.google.com/p/jjil/&lt;/a&gt;&lt;br /&gt;&lt;a href="http://code.google.com/p/pp-barcode-reader/"&gt;http://code.google.com/p/pp-barcode-reader/&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.jappit.com/" target="_blank"&gt;http://www.jappit.com/&lt;/a&gt; - mobile and web blog&lt;br /&gt;&lt;br /&gt;articles&lt;br /&gt;&lt;a href="http://blog.erikdebruijn.nl/archives/78-Camera-phones-as-barcode-readers-increased-buying-power.html"&gt;http://blog.erikdebruijn.nl/archives/78-Camera-phones-as-barcode-readers-increased-buying-power.html&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3053352583694970340-3079899561119321939?l=itgeekhelp.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://itgeekhelp.blogspot.com/feeds/3079899561119321939/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://itgeekhelp.blogspot.com/2009/07/j2me-barcode-libraries.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3053352583694970340/posts/default/3079899561119321939'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3053352583694970340/posts/default/3079899561119321939'/><link rel='alternate' type='text/html' href='http://itgeekhelp.blogspot.com/2009/07/j2me-barcode-libraries.html' title='J2ME barcode libraries'/><author><name>Pedric Kng Aka Boon</name><uri>http://www.blogger.com/profile/07979744237794291200</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3053352583694970340.post-3868838495978783275</id><published>2009-07-25T09:43:00.000-07:00</published><updated>2009-07-25T09:44:53.314-07:00</updated><title type='text'>java localisation &amp; Internalization</title><content type='html'>java&lt;br /&gt;http://java.sun.com/docs/books/tutorial/i18n/intro/after.html&lt;br /&gt;http://java.sun.com/docs/books/tutorial/i18n/resbundle/propfile.html&lt;br /&gt;http://www.velocityreviews.com/forums/t153252-resourcebundle-cant-find-properties-file-unless-in-package.html&lt;br /&gt;http://www.rgagnon.com/javadetails/java-0135.html&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3053352583694970340-3868838495978783275?l=itgeekhelp.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://itgeekhelp.blogspot.com/feeds/3868838495978783275/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://itgeekhelp.blogspot.com/2009/07/java-localisation-internalization.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3053352583694970340/posts/default/3868838495978783275'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3053352583694970340/posts/default/3868838495978783275'/><link rel='alternate' type='text/html' href='http://itgeekhelp.blogspot.com/2009/07/java-localisation-internalization.html' title='java localisation &amp; Internalization'/><author><name>Pedric Kng Aka Boon</name><uri>http://www.blogger.com/profile/07979744237794291200</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3053352583694970340.post-3147740093462771212</id><published>2009-07-22T22:49:00.001-07:00</published><updated>2009-07-22T22:50:00.072-07:00</updated><title type='text'>XML Schema</title><content type='html'>http://www.datypic.com/books/defxmlschema/chapter13.html&lt;br /&gt;http://www.w3schools.com/schema/schema_simple.asp&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3053352583694970340-3147740093462771212?l=itgeekhelp.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://itgeekhelp.blogspot.com/feeds/3147740093462771212/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://itgeekhelp.blogspot.com/2009/07/xml-schema.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3053352583694970340/posts/default/3147740093462771212'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3053352583694970340/posts/default/3147740093462771212'/><link rel='alternate' type='text/html' href='http://itgeekhelp.blogspot.com/2009/07/xml-schema.html' title='XML Schema'/><author><name>Pedric Kng Aka Boon</name><uri>http://www.blogger.com/profile/07979744237794291200</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3053352583694970340.post-7058068184301627306</id><published>2009-07-21T20:00:00.000-07:00</published><updated>2009-07-22T19:44:28.450-07:00</updated><title type='text'>Blog Recommendation</title><content type='html'>java exception handling&lt;br /&gt;&lt;br /&gt;- http://tutorials.jenkov.com/&lt;br /&gt;&lt;br /&gt;- http://www.javaworld.com/javaworld/jw-07-2005/jw-0711-exception.html?page=5&lt;br /&gt;&lt;br /&gt;static Intialiser&lt;br /&gt;- http://www.developer.com/java/other/article.php/2238491&lt;br /&gt;- http://java.sun.com/docs/books/tutorial/java/javaOO/initial.html&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3053352583694970340-7058068184301627306?l=itgeekhelp.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://itgeekhelp.blogspot.com/feeds/7058068184301627306/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://itgeekhelp.blogspot.com/2009/07/blog-recommendation.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3053352583694970340/posts/default/7058068184301627306'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3053352583694970340/posts/default/7058068184301627306'/><link rel='alternate' type='text/html' href='http://itgeekhelp.blogspot.com/2009/07/blog-recommendation.html' title='Blog Recommendation'/><author><name>Pedric Kng Aka Boon</name><uri>http://www.blogger.com/profile/07979744237794291200</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3053352583694970340.post-51501946819185496</id><published>2009-07-15T19:42:00.000-07:00</published><updated>2009-07-15T19:43:42.906-07:00</updated><title type='text'>Netbeans UTF 8 encoding</title><content type='html'>/etc folder of netbeans directory, called netbeans.conf&lt;br /&gt;&lt;em&gt;-J-Dfile.encoding=UTF-8&lt;/em&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3053352583694970340-51501946819185496?l=itgeekhelp.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://itgeekhelp.blogspot.com/feeds/51501946819185496/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://itgeekhelp.blogspot.com/2009/07/netbeans-utf-8-encoding.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3053352583694970340/posts/default/51501946819185496'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3053352583694970340/posts/default/51501946819185496'/><link rel='alternate' type='text/html' href='http://itgeekhelp.blogspot.com/2009/07/netbeans-utf-8-encoding.html' title='Netbeans UTF 8 encoding'/><author><name>Pedric Kng Aka Boon</name><uri>http://www.blogger.com/profile/07979744237794291200</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3053352583694970340.post-896783621837520450</id><published>2009-06-03T02:43:00.001-07:00</published><updated>2009-06-03T03:04:34.820-07:00</updated><title type='text'>Java Jar files</title><content type='html'>&lt;div class="deleteBody"&gt;&lt;h2 class="postTitle" style="color: rgb(102, 102, 102);"&gt;&lt;br /&gt;&lt;/h2&gt; &lt;p class="postBody" style="color: rgb(119, 119, 119);"&gt;jar cvf app.jar MyApp.class&lt;br /&gt;&lt;br /&gt;execute jar files&lt;br /&gt;java -jar app.jar&lt;br /&gt;&lt;/p&gt;&lt;p class="postBody" style="color: rgb(119, 119, 119);"&gt;java -classpath app.jar foo.Main&lt;/p&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3053352583694970340-896783621837520450?l=itgeekhelp.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://itgeekhelp.blogspot.com/feeds/896783621837520450/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://itgeekhelp.blogspot.com/2009/06/java-jar-files_03.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3053352583694970340/posts/default/896783621837520450'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3053352583694970340/posts/default/896783621837520450'/><link rel='alternate' type='text/html' href='http://itgeekhelp.blogspot.com/2009/06/java-jar-files_03.html' title='Java Jar files'/><author><name>Pedric Kng Aka Boon</name><uri>http://www.blogger.com/profile/07979744237794291200</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3053352583694970340.post-7531208792048053146</id><published>2009-05-28T21:08:00.000-07:00</published><updated>2009-05-28T21:09:26.358-07:00</updated><title type='text'>bouncycastle</title><content type='html'>Bouncycastle supported Encodings and Algorithm&lt;br /&gt;http://www.bouncycastle.org/specifications.html&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3053352583694970340-7531208792048053146?l=itgeekhelp.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://itgeekhelp.blogspot.com/feeds/7531208792048053146/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://itgeekhelp.blogspot.com/2009/05/bouncycastle.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3053352583694970340/posts/default/7531208792048053146'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3053352583694970340/posts/default/7531208792048053146'/><link rel='alternate' type='text/html' href='http://itgeekhelp.blogspot.com/2009/05/bouncycastle.html' title='bouncycastle'/><author><name>Pedric Kng Aka Boon</name><uri>http://www.blogger.com/profile/07979744237794291200</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3053352583694970340.post-3484378699914591758</id><published>2009-05-28T20:36:00.000-07:00</published><updated>2009-05-28T20:39:13.290-07:00</updated><title type='text'>fedora last reboot, poweroff</title><content type='html'>who command&lt;br /&gt;You need to use who command, to print who is logged on. It also displays the time of last system boot. Use last command to display system reboot and shutdown date and time.&lt;br /&gt;&lt;br /&gt;$ who –b&lt;br /&gt;&lt;br /&gt;Output:system boot Apr 30 15:08&lt;br /&gt;&lt;br /&gt;Use last command to display listing of last logged in users and system last reboot time and date:&lt;br /&gt;&lt;br /&gt;$ last reboot  lessOr better try:$ last reboot  head -1&lt;br /&gt;Output:reboot system boot 2.6.15.4 Sun Apr 30 15:08 - 16:22 (01:13)&lt;br /&gt;&lt;br /&gt;last command searches back through the file /var/log/wtmp and displays a list of all users logged in (and out) since that file was created. The pseudo user reboot logs in each time the system is rebooted. Thus last reboot command will show a log of all reboots since the log file was created.&lt;br /&gt;&lt;br /&gt;To display last shutdown date and time use following command:&lt;br /&gt;&lt;br /&gt;$ last -x  grep down&lt;br /&gt;$ last -xgrep shutdown  head -1&lt;br /&gt;Output:shutdown system down 2.6.15.4 Sun Apr 30 13:31 - 15:08 (01:37)&lt;br /&gt;&lt;br /&gt;Where,&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;-x: Display the system shutdown entries and run level changes.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3053352583694970340-3484378699914591758?l=itgeekhelp.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://itgeekhelp.blogspot.com/feeds/3484378699914591758/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://itgeekhelp.blogspot.com/2009/05/fedora-last-reboot-poweroff.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3053352583694970340/posts/default/3484378699914591758'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3053352583694970340/posts/default/3484378699914591758'/><link rel='alternate' type='text/html' href='http://itgeekhelp.blogspot.com/2009/05/fedora-last-reboot-poweroff.html' title='fedora last reboot, poweroff'/><author><name>Pedric Kng Aka Boon</name><uri>http://www.blogger.com/profile/07979744237794291200</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3053352583694970340.post-6291232886091823853</id><published>2009-05-28T20:02:00.001-07:00</published><updated>2009-05-28T20:02:38.568-07:00</updated><title type='text'>fedora logs</title><content type='html'>Fedora's /etc/syslog.conf follows a standard logic:&lt;br /&gt;&lt;br /&gt;mail logs are stored in /var/log/maillog,&lt;br /&gt;system's logs are in /var/log/messages,&lt;br /&gt;cron jobs activities are in /var/log/cron,&lt;br /&gt;authentication data are in /var/log/secure.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3053352583694970340-6291232886091823853?l=itgeekhelp.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://itgeekhelp.blogspot.com/feeds/6291232886091823853/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://itgeekhelp.blogspot.com/2009/05/fedora-logs.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3053352583694970340/posts/default/6291232886091823853'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3053352583694970340/posts/default/6291232886091823853'/><link rel='alternate' type='text/html' href='http://itgeekhelp.blogspot.com/2009/05/fedora-logs.html' title='fedora logs'/><author><name>Pedric Kng Aka Boon</name><uri>http://www.blogger.com/profile/07979744237794291200</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3053352583694970340.post-8649512026023421861</id><published>2009-04-26T23:54:00.000-07:00</published><updated>2009-04-26T23:55:44.416-07:00</updated><title type='text'>Active directory remote administration</title><content type='html'>References: http://www.computerperformance.co.uk/w2k3/utilities/ldp.htm&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3053352583694970340-8649512026023421861?l=itgeekhelp.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://itgeekhelp.blogspot.com/feeds/8649512026023421861/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://itgeekhelp.blogspot.com/2009/04/active-directory.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3053352583694970340/posts/default/8649512026023421861'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3053352583694970340/posts/default/8649512026023421861'/><link rel='alternate' type='text/html' href='http://itgeekhelp.blogspot.com/2009/04/active-directory.html' title='Active directory remote administration'/><author><name>Pedric Kng Aka Boon</name><uri>http://www.blogger.com/profile/07979744237794291200</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3053352583694970340.post-234178892123533094</id><published>2009-04-20T20:41:00.001-07:00</published><updated>2009-04-20T20:41:58.992-07:00</updated><title type='text'>Increase Glassfish memory(heap)</title><content type='html'>Application Server-&gt;JVM Settings-&gt;JVM Options&lt;br /&gt;&lt;br /&gt;Change -Xmx512m to -Xmx1024m or more.&lt;br /&gt;&lt;br /&gt;OR if you are get out of PermGen memory add a property&lt;br /&gt;&lt;br /&gt;-XX:MaxPermSize=256m&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3053352583694970340-234178892123533094?l=itgeekhelp.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://itgeekhelp.blogspot.com/feeds/234178892123533094/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://itgeekhelp.blogspot.com/2009/04/increase-glassfish-memoryheap.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3053352583694970340/posts/default/234178892123533094'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3053352583694970340/posts/default/234178892123533094'/><link rel='alternate' type='text/html' href='http://itgeekhelp.blogspot.com/2009/04/increase-glassfish-memoryheap.html' title='Increase Glassfish memory(heap)'/><author><name>Pedric Kng Aka Boon</name><uri>http://www.blogger.com/profile/07979744237794291200</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3053352583694970340.post-310604806874811284</id><published>2009-04-14T01:56:00.000-07:00</published><updated>2009-04-14T02:03:21.504-07:00</updated><title type='text'>glassfish remove http instance port xx80</title><content type='html'>Goto /opt/glassfish/domain/dsss/config&lt;br /&gt;vi domain.xml&lt;br /&gt;&lt;br /&gt;Change below&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;&amp;lt;http-listener acceptor-threads="1" address="0.0.0.0" blocking-enabled="false" default-virtual-server="server" enabled="true" family="inet" id="http-listener-1" port="2080" security-enabled="false" server-name="" xpowered-by="true"&amp;gt;&lt;br /&gt;         &amp;lt;property name="proxiedProtocols" value="ws/tcp"/&amp;gt;&lt;br /&gt;       &amp;lt;/http-listener&amp;gt;&lt;br /&gt;      &lt;br /&gt;       &amp;lt;http-listener acceptor-threads="1" address="0.0.0.0" blocking-enabled="false" default-virtual-server="server" enabled="true" family="inet" id="http-listener-2" port="2081" security-enabled="true" server-name="" xpowered-by="true"&amp;gt;&lt;br /&gt;         &amp;lt;ssl cert-nickname="s1as" client-auth-enabled="false" ssl2-enabled="false" ssl3-enabled="true" tls-enabled="true" tls-rollback-enabled="true"/&amp;gt;&lt;br /&gt;       &amp;lt;/http-listener&amp;gt;&lt;br /&gt;&lt;br /&gt;to:&lt;br /&gt;&lt;br /&gt;&amp;lt;http-listener acceptor-threads="1" address="0.0.0.0" blocking-enabled="false" default-virtual-server="server" enabled="true" family="inet" id="http-listener-1" port="2081" security-enabled="true" server-name="" xpowered-by="true"&amp;gt;&lt;br /&gt;         &amp;lt;ssl cert-nickname="s1as" client-auth-enabled="false" ssl2-enabled="false" ssl3-enabled="true" tls-enabled="true" tls-rollback-enabled="true"/&amp;gt;&lt;br /&gt;         &amp;lt;property name="proxiedProtocols" value="ws/tcp"/&amp;gt;&lt;br /&gt;       &amp;lt;/http-listener&amp;gt;&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;remove http-listener-2 from below:&lt;br /&gt;&lt;br /&gt;&amp;lt;http-listener acceptor-threads="1" address="0.0.0.0" blocking-enabled="false" default-virtual-server="__asadmin" enabled="true" family="inet" id="admin-listener" port="2048" security-enabled="false" server-name="" xpowered-by="true"/&amp;gt;&lt;br /&gt;&amp;lt;virtual-server hosts="${com.sun.aas.hostName}" http-listeners="http-listener-1,&lt;span style="font-weight: bold;"&gt;http-listener-2&lt;/span&gt;" id="server" log-file="${com.sun.aas.instanceRoot}/logs/server.log" state="on"&amp;gt;&lt;br /&gt;         &amp;lt;property name="docroot" value="${com.sun.aas.instanceRoot}/docroot"/&amp;gt;&lt;br /&gt;         &amp;lt;property name="accesslog" value="${com.sun.aas.instanceRoot}/logs/access"/&amp;gt;&lt;br /&gt;         &amp;lt;property name="sso-enabled" value="false"/&amp;gt;&lt;br /&gt;       &amp;lt;/virtual-server&amp;gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3053352583694970340-310604806874811284?l=itgeekhelp.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://itgeekhelp.blogspot.com/feeds/310604806874811284/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://itgeekhelp.blogspot.com/2009/04/glassfish-remove-http-instance-port.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3053352583694970340/posts/default/310604806874811284'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3053352583694970340/posts/default/310604806874811284'/><link rel='alternate' type='text/html' href='http://itgeekhelp.blogspot.com/2009/04/glassfish-remove-http-instance-port.html' title='glassfish remove http instance port xx80'/><author><name>Pedric Kng Aka Boon</name><uri>http://www.blogger.com/profile/07979744237794291200</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3053352583694970340.post-2293943673144565500</id><published>2009-04-13T02:32:00.000-07:00</published><updated>2009-04-16T00:49:41.937-07:00</updated><title type='text'>Netbeans combine library jar and output jar</title><content type='html'>Combine library jar and executing jars into one jar&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;&lt;br /&gt; &amp;lt;target name="-post-jar"&amp;gt;&lt;br /&gt;        &amp;lt;jar jarfile="dist/Combined-dist.jar"&amp;gt;&lt;br /&gt;            &amp;lt;zipfileset src="${dist.jar}" excludes="META-INF/*" /&amp;gt;&lt;br /&gt;            &amp;lt;zipfileset src="lib/commons-io-1.4.jar" excludes="META-INF/*" /&amp;gt;&lt;br /&gt;            &amp;lt;manifest&amp;gt;&lt;br /&gt;                &amp;lt;attribute name="Main-Class" value="com.example.mypackage.Main"/&amp;gt;&lt;br /&gt;            &amp;lt;/manifest&amp;gt;&lt;br /&gt;        &amp;lt;/jar&amp;gt;&lt;br /&gt;    &amp;lt;/target&amp;gt;&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3053352583694970340-2293943673144565500?l=itgeekhelp.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://itgeekhelp.blogspot.com/feeds/2293943673144565500/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://itgeekhelp.blogspot.com/2009/04/netbeans-combine-library-jar-and-output.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3053352583694970340/posts/default/2293943673144565500'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3053352583694970340/posts/default/2293943673144565500'/><link rel='alternate' type='text/html' href='http://itgeekhelp.blogspot.com/2009/04/netbeans-combine-library-jar-and-output.html' title='Netbeans combine library jar and output jar'/><author><name>Pedric Kng Aka Boon</name><uri>http://www.blogger.com/profile/07979744237794291200</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3053352583694970340.post-8313481967687119082</id><published>2009-04-12T19:49:00.000-07:00</published><updated>2009-04-13T02:32:19.796-07:00</updated><title type='text'>BouncyCastle JSSE</title><content type='html'>References:&lt;br /&gt;http://www.javamex.com/tutorials/cryptography/rsa_encryption.shtml&lt;br /&gt;http://java.sun.com/developer/JDCTechTips/2004/tt0116.html&lt;br /&gt;http://www.bouncycastle.org/specifications.html&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3053352583694970340-8313481967687119082?l=itgeekhelp.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://itgeekhelp.blogspot.com/feeds/8313481967687119082/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://itgeekhelp.blogspot.com/2009/04/bouncycastle-jsse.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3053352583694970340/posts/default/8313481967687119082'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3053352583694970340/posts/default/8313481967687119082'/><link rel='alternate' type='text/html' href='http://itgeekhelp.blogspot.com/2009/04/bouncycastle-jsse.html' title='BouncyCastle JSSE'/><author><name>Pedric Kng Aka Boon</name><uri>http://www.blogger.com/profile/07979744237794291200</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3053352583694970340.post-1338387122894154645</id><published>2009-04-11T03:29:00.000-07:00</published><updated>2009-04-11T03:40:40.256-07:00</updated><title type='text'>Netbean JDK 1.1 support</title><content type='html'>References from : http://wiki.netbeans.org/FaqJdk11&lt;br /&gt;&lt;hr&gt;&lt;br /&gt;  &lt;h3 id="section-FaqJdk11-CanIUseJDK1.1ForMyProject"&gt; Can I use JDK 1.1 for my project?&lt;/h3&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;The IDE does not support JDK 1.1 directly but it can be made to work if you want. Here are some sample&lt;br /&gt;instructions which were tested with a NB 5.0 development build running under JDK 6 on Fedora Core 4 Linux&lt;br /&gt;with an installation of Blackdown's JDK 1.1.8:&lt;br /&gt;&lt;/p&gt;&lt;br /&gt;&lt;p&gt;1. Make a new Java &amp;quot;class library&amp;quot; project.&lt;br /&gt;&lt;/p&gt;&lt;br /&gt;&lt;p&gt;2. In the &lt;b&gt;Files&lt;/b&gt; tab, open &lt;tt&gt;project.properties&lt;/tt&gt;. Edit the definition of &lt;tt&gt;javac.source&lt;/tt&gt; to read:&lt;br /&gt;&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;javac.source=1.2&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;p&gt;(the 1.2 language doesn't really differ from 1.1, so this is just to make sure the editor doesn't think &lt;tt&gt;assert&lt;/tt&gt; or generics are allowed!)&lt;br /&gt;&lt;/p&gt;&lt;br /&gt;&lt;p&gt;and also add to either &lt;tt&gt;project.properties&lt;/tt&gt; or &lt;tt&gt;private.properties&lt;/tt&gt; the location of your JDK 1.1 installation,&lt;br /&gt;e.g.:&lt;br /&gt;&lt;/p&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;&lt;br /&gt;jdk11.home=/space/jdk118_v3&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;p&gt;3. Open&lt;tt&gt;build.xml&lt;/tt&gt;and add&lt;br /&gt;&lt;/p&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;    &amp;lt;target name=&amp;quot;-init-macrodef-javac&amp;quot;&amp;gt;&lt;br /&gt;        &amp;lt;macrodef name=&amp;quot;javac&amp;quot; uri=&amp;quot;http://www.netbeans.org/ns/j2se-project/3&amp;quot;&amp;gt;&lt;br /&gt;&lt;br /&gt;            &amp;lt;attribute name=&amp;quot;srcdir&amp;quot; default=&amp;quot;${src.dir}&amp;quot;/&amp;gt;&lt;br /&gt;            &amp;lt;attribute name=&amp;quot;destdir&amp;quot; default=&amp;quot;${build.classes.dir}&amp;quot;/&amp;gt;&lt;br /&gt;            &amp;lt;attribute name=&amp;quot;classpath&amp;quot; default=&amp;quot;${javac.classpath}&amp;quot;/&amp;gt;&lt;br /&gt;&lt;br /&gt;            &amp;lt;attribute name=&amp;quot;debug&amp;quot; default=&amp;quot;${javac.debug}&amp;quot;/&amp;gt;&lt;br /&gt;            &amp;lt;element name=&amp;quot;customize&amp;quot; optional=&amp;quot;true&amp;quot;/&amp;gt;&lt;br /&gt;            &amp;lt;sequential&amp;gt;&lt;br /&gt;&lt;br /&gt;                &amp;lt;javac srcdir=&amp;quot;@{srcdir}&amp;quot; destdir=&amp;quot;@{destdir}&amp;quot; debug=&amp;quot;@{debug}&amp;quot;&lt;br /&gt;                       deprecation=&amp;quot;${javac.deprecation}&amp;quot; source=&amp;quot;1.1&amp;quot; target=&amp;quot;1.1&amp;quot;&lt;br /&gt;&lt;br /&gt;                       includeantruntime=&amp;quot;false&amp;quot; bootclasspath=&amp;quot;${jdk11.home}/lib/classes.zip&amp;quot;&amp;gt;&lt;br /&gt;                    &amp;lt;classpath&amp;gt;&lt;br /&gt;                        &amp;lt;path path=&amp;quot;@{classpath}&amp;quot;/&amp;gt;&lt;br /&gt;                    &amp;lt;/classpath&amp;gt;&lt;br /&gt;&lt;br /&gt;                    &amp;lt;compilerarg line=&amp;quot;${javac.compilerargs}&amp;quot;/&amp;gt;&lt;br /&gt;                    &amp;lt;customize/&amp;gt;&lt;br /&gt;                &amp;lt;/javac&amp;gt;&lt;br /&gt;            &amp;lt;/sequential&amp;gt;&lt;br /&gt;        &amp;lt;/macrodef&amp;gt;&lt;br /&gt;&lt;br /&gt;    &amp;lt;/target&amp;gt;&lt;br /&gt;    &amp;lt;target name=&amp;quot;-init-macrodef-java&amp;quot;&amp;gt;&lt;br /&gt;        &amp;lt;macrodef name=&amp;quot;java&amp;quot; uri=&amp;quot;http://www.netbeans.org/ns/j2se-project/1&amp;quot;&amp;gt;&lt;br /&gt;            &amp;lt;attribute name=&amp;quot;classname&amp;quot; default=&amp;quot;${main.class}&amp;quot;/&amp;gt;&lt;br /&gt;&lt;br /&gt;            &amp;lt;element name=&amp;quot;customize&amp;quot; optional=&amp;quot;true&amp;quot;/&amp;gt;&lt;br /&gt;            &amp;lt;sequential&amp;gt;&lt;br /&gt;                &amp;lt;java fork=&amp;quot;true&amp;quot; classname=&amp;quot;@{classname}&amp;quot; dir=&amp;quot;${work.dir}&amp;quot;&lt;br /&gt;&lt;br /&gt;                      jvm=&amp;quot;${jdk11.home}/bin/java&amp;quot;&amp;gt;&lt;br /&gt;                    &amp;lt;jvmarg line=&amp;quot;${run.jvmargs}&amp;quot;/&amp;gt;&lt;br /&gt;                    &amp;lt;classpath&amp;gt;&lt;br /&gt;                        &amp;lt;path path=&amp;quot;${run.classpath}:${jdk11.home}/lib/classes.zip&amp;quot;/&amp;gt;&lt;br /&gt;&lt;br /&gt;                    &amp;lt;/classpath&amp;gt;&lt;br /&gt;                    &amp;lt;syspropertyset&amp;gt;&lt;br /&gt;                        &amp;lt;propertyref prefix=&amp;quot;run-sys-prop.&amp;quot;/&amp;gt;&lt;br /&gt;                        &amp;lt;mapper type=&amp;quot;glob&amp;quot; from=&amp;quot;run-sys-prop.*&amp;quot; to=&amp;quot;*&amp;quot;/&amp;gt;&lt;br /&gt;&lt;br /&gt;                    &amp;lt;/syspropertyset&amp;gt;&lt;br /&gt;                    &amp;lt;customize/&amp;gt;&lt;br /&gt;                &amp;lt;/java&amp;gt;&lt;br /&gt;            &amp;lt;/sequential&amp;gt;&lt;br /&gt;        &amp;lt;/macrodef&amp;gt;&lt;br /&gt;    &amp;lt;/target&amp;gt;&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;p&gt;These Ant targets should suffice to make basic compilation and execution of Java apps work. If your JDK 1.1&lt;br /&gt;installation has a different file layout from Blackdown's, you may need to adjust these targets a bit (update&lt;br /&gt;this Wiki page if so).&lt;br /&gt;&lt;/p&gt;&lt;br /&gt;&lt;p&gt;3a. If you are using NetBeans 6.0, the macrodef for 'depend' should also be added in &amp;lt;target name=&amp;quot;-init-macrodef-javac&amp;quot;&amp;gt; after macrodef for javac, as follows:&lt;br /&gt;&lt;/p&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;   &amp;lt;target name=&amp;quot;-init-macrodef-javac&amp;quot;&amp;gt;&lt;br /&gt;        &amp;lt;macrodef name=&amp;quot;javac&amp;quot; uri=&amp;quot;http://www.netbeans.org/ns/j2se-project/3&amp;quot;&amp;gt;&lt;br /&gt;&lt;br /&gt;           ...&lt;br /&gt;        &amp;lt;/macrodef&amp;gt;&lt;br /&gt;         &amp;lt;macrodef name=&amp;quot;depend&amp;quot; uri=&amp;quot;http://www.netbeans.org/ns/j2se-project/3&amp;quot;&amp;gt;&lt;br /&gt;            &amp;lt;attribute default=&amp;quot;${src.dir}&amp;quot; name=&amp;quot;srcdir&amp;quot;/&amp;gt;&lt;br /&gt;&lt;br /&gt;            &amp;lt;attribute name=&amp;quot;destdir&amp;quot; default=&amp;quot;${build.classes.dir}&amp;quot;/&amp;gt;&lt;br /&gt;            &amp;lt;attribute name=&amp;quot;classpath&amp;quot; default=&amp;quot;${javac.classpath}&amp;quot;/&amp;gt;&lt;br /&gt;            &amp;lt;sequential&amp;gt;&lt;br /&gt;&lt;br /&gt;                &amp;lt;depend cache=&amp;quot;${build.dir}/depcache&amp;quot; destdir=&amp;quot;@{destdir}&amp;quot; excludes=&amp;quot;${excludes}&amp;quot; includes=&amp;quot;${includes}&amp;quot; srcdir=&amp;quot;@{srcdir}&amp;quot;&amp;gt;&lt;br /&gt;                    &amp;lt;classpath&amp;gt;&lt;br /&gt;&lt;br /&gt;                        &amp;lt;path path=&amp;quot;@{classpath}&amp;quot;/&amp;gt;&lt;br /&gt;                    &amp;lt;/classpath&amp;gt;&lt;br /&gt;                &amp;lt;/depend&amp;gt;&lt;br /&gt;            &amp;lt;/sequential&amp;gt;&lt;br /&gt;        &amp;lt;/macrodef&amp;gt;&lt;br /&gt;&lt;br /&gt;    &amp;lt;/target&amp;gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;p&gt;4. Make a new &lt;b&gt;Java GUI Forms / AWT Forms / Applet Form&lt;/b&gt;. Build whatever GUI you like, using e.g.&lt;br /&gt;     &lt;tt&gt;GridBagLayout&lt;/tt&gt;as the layout manager (Matisse won't work), and of course using just AWT components (no Swing). (Unfortunately, the form designer will still use constants like &lt;tt&gt;BorderLayout.PAGE_START&lt;/tt&gt; that don't exist in Java 1.1, and these will show up in generated code that can't be hand-modified. Use the source view to check for these errors. You'll have to simply avoid using those features of the form designer that cause problems, or code your app without using the designer at all.)&lt;br /&gt;&lt;/p&gt;&lt;br /&gt;&lt;p&gt;5. You will need to correct the &lt;tt&gt;init()&lt;/tt&gt; method to call &lt;tt&gt;initComponents()&lt;/tt&gt; directly (&lt;tt&gt;EventQueue.invokeLater&lt;/tt&gt;&lt;br /&gt;&lt;br /&gt;      does not exist in this JDK, but you do not need it anyway).&lt;br /&gt;&lt;/p&gt;&lt;br /&gt;&lt;p&gt;6. Press &lt;b&gt;Shift-F6&lt;/b&gt; (or select &lt;b&gt;Run / Run File / Run&lt;/b&gt; from the menu) to build and run your applet. The JDK 1.1 version of&lt;tt&gt;appletviewer&lt;/tt&gt;should start with&lt;br /&gt;      your applet.&lt;br /&gt;&lt;/p&gt;&lt;br /&gt;&lt;p&gt;7. Running a main class should work similarly.&lt;br /&gt;&lt;/p&gt;&lt;br /&gt;&lt;p&gt;The above setup does &lt;i&gt;not&lt;/i&gt; include code completion, i.e. the IDE will show you code completion from your default&lt;br /&gt;JDK (whatever the IDE runs on - 1.4+), even though your project will be compiled by Ant against JDK 1.1. Also,&lt;br /&gt;the background error stripes will not show accidental usage of JDK 1.2+ APIs. To make code completion and&lt;br /&gt;background error detection work is a little tricky since the &lt;b&gt;Java Platform Manager&lt;/b&gt; does not recognize JDK 1.1&lt;br /&gt;installations. But you can set it up manually:&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;&lt;br /&gt;&lt;p&gt;1. Close the IDE.&lt;br /&gt;&lt;/p&gt;&lt;br /&gt;&lt;p&gt;2. In your user directory (available from &lt;b&gt;Help | About&lt;/b&gt;), locate the directory&lt;br /&gt;     &lt;tt&gt;config/Services/Platforms/org-netbeans-api-java-Platform&lt;/tt&gt; and make a new text file called &lt;tt&gt;JDK11.xml&lt;/tt&gt;&lt;br /&gt;      with contents like:&lt;br /&gt;&lt;/p&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;&amp;lt;?xml version='1.0'?&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;!DOCTYPE platform PUBLIC&lt;br /&gt;          '-//NetBeans//DTD Java PlatformDefinition 1.0//EN'&lt;br /&gt;          'http://www.netbeans.org/dtds/java-platformdefinition-1_0.dtd'&amp;gt;&lt;br /&gt;&amp;lt;platform name='JDK11' default='no'&amp;gt;&lt;br /&gt;  &amp;lt;properties&amp;gt;&lt;br /&gt;    &amp;lt;property name='platform.ant.name' value='JDK11'/&amp;gt;&lt;br /&gt;  &amp;lt;/properties&amp;gt;&lt;br /&gt;  &amp;lt;sysproperties&amp;gt;&lt;br /&gt;    &amp;lt;property name='sun.boot.class.path' value='/space/jdk118_v3/lib/classes.zip'/&amp;gt;&lt;br /&gt;&lt;br /&gt;    &amp;lt;property name='java.specification.version' value='1.1'/&amp;gt;&lt;br /&gt;    &amp;lt;property name='java.class.path' value=''/&amp;gt;&lt;br /&gt;    &amp;lt;property name='java.ext.dirs' value=''/&amp;gt;&lt;br /&gt;  &amp;lt;/sysproperties&amp;gt;&lt;br /&gt;  &amp;lt;jdkhome&amp;gt;&lt;br /&gt;    &amp;lt;resource&amp;gt;file:/space/jdk118_v3/&amp;lt;/resource&amp;gt;&lt;br /&gt;&lt;br /&gt;  &amp;lt;/jdkhome&amp;gt;&lt;br /&gt;  &amp;lt;sources&amp;gt;&lt;br /&gt;    &amp;lt;resource&amp;gt;jar:file:/space/jdk118_v3/src.zip!/src/&amp;lt;/resource&amp;gt;&lt;br /&gt;  &amp;lt;/sources&amp;gt;&lt;br /&gt;&amp;lt;/platform&amp;gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;Of course replace the three occurrences of &lt;tt&gt;/space/jdk118_v3&lt;/tt&gt; with the location of your JDK 1.1 installation.&lt;br /&gt;The second two are URLs so you need to use &lt;tt&gt;/&lt;/tt&gt; not &lt;tt&gt;\&lt;/tt&gt; on Windows.&lt;br /&gt;&lt;/p&gt;&lt;br /&gt;&lt;p&gt;3. Restart the IDE. You should see an entry &lt;b&gt;JDK11&lt;/b&gt; in the &lt;b&gt;Java Platform Manager&lt;/b&gt;.&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;&lt;br /&gt;&lt;p&gt;4. Open the properties of your Java project, and set &lt;b&gt;Libraries | Java Platform&lt;/b&gt; to &lt;b&gt;JDK11&lt;/b&gt;. The IDE will ask&lt;br /&gt;      you to set the source level to 1.1; you can accept this offer (shouldn't matter).&lt;br /&gt;&lt;/p&gt;&lt;br /&gt;&lt;p&gt;5. Now try code completion on your project - you should see only JDK 1.1 classes. (However, this does not fix the problem noted above with the form designer using constants that are not valid in Java 1.1.)&lt;br /&gt;&lt;/p&gt;&lt;br /&gt;&lt;hr /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3053352583694970340-1338387122894154645?l=itgeekhelp.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://itgeekhelp.blogspot.com/feeds/1338387122894154645/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://itgeekhelp.blogspot.com/2009/04/netbean-jdk-11-support.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3053352583694970340/posts/default/1338387122894154645'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3053352583694970340/posts/default/1338387122894154645'/><link rel='alternate' type='text/html' href='http://itgeekhelp.blogspot.com/2009/04/netbean-jdk-11-support.html' title='Netbean JDK 1.1 support'/><author><name>Pedric Kng Aka Boon</name><uri>http://www.blogger.com/profile/07979744237794291200</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3053352583694970340.post-3060505643959800078</id><published>2009-04-10T08:16:00.001-07:00</published><updated>2009-04-10T08:24:32.988-07:00</updated><title type='text'>Linux firewall allow glassfish access</title><content type='html'>vi /etc/sysconfig iptables&lt;br /&gt;&lt;br /&gt;# Firewall configuration written by system-config-firewall&lt;br /&gt;# Manual customization of this file is not recommended.&lt;br /&gt;*filter&lt;br /&gt;:INPUT ACCEPT [0:0]&lt;br /&gt;:FORWARD ACCEPT [0:0]&lt;br /&gt;:OUTPUT ACCEPT [0:0]&lt;br /&gt;:RH-Firewall-1-INPUT - [0:0]&lt;br /&gt;-A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT&lt;br /&gt;-A INPUT -p icmp -j ACCEPT&lt;br /&gt;-A INPUT -i lo -j ACCEPT&lt;br /&gt;-A INPUT -m state --state NEW -m tcp -p tcp --dport 22 -j ACCEPT //add this for ssh&lt;br /&gt;-A INPUT -m state --state NEW -m tcp -p tcp --dport 3306 -j ACCEPT //add this for mysql&lt;br /&gt;-A INPUT -m state --state NEW -m tcp -p tcp --dport 2048 -j ACCEPT //add this for domain administration&lt;br /&gt;-A INPUT -m state --state NEW -m tcp -p tcp --dport 2080 -j ACCEPT //add this for http&lt;br /&gt;-A INPUT -m state --state NEW -m tcp -p tcp --dport 2081 -j ACCEPT //add this for https&lt;br /&gt;-A INPUT -j REJECT --reject-with icmp-host-prohibited&lt;br /&gt;-A FORWARD -j REJECT --reject-with icmp-host-prohibited&lt;br /&gt;-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 5901 -j ACCEPT&lt;br /&gt;#-A RH-Firewall-1-INPUT -p tcp -m state -m tcp --dport 3306 --state NEW -j ACCEPT&lt;br /&gt;#-A RH-Firewall-1-INPUT -p udp -m state -m udp --dport 3306 --state NEW -j ACCEPT&lt;br /&gt;#-A RH-Firewall-1-INPUT -p tcp -m state -m tcp --dport 2048:2081 --state NEW -j ACCEPT&lt;br /&gt;#-A RH-Firewall-1-INPUT -p udp -m state -m udp --dport 2048:2081 --state NEW -j ACCEPT&lt;br /&gt;COMMIT&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;References:&lt;br /&gt;http://www.yolinux.com/TUTORIALS/LinuxTutorialInitProcess.html&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3053352583694970340-3060505643959800078?l=itgeekhelp.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://itgeekhelp.blogspot.com/feeds/3060505643959800078/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://itgeekhelp.blogspot.com/2009/04/linux-firewall.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3053352583694970340/posts/default/3060505643959800078'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3053352583694970340/posts/default/3060505643959800078'/><link rel='alternate' type='text/html' href='http://itgeekhelp.blogspot.com/2009/04/linux-firewall.html' title='Linux firewall allow glassfish access'/><author><name>Pedric Kng Aka Boon</name><uri>http://www.blogger.com/profile/07979744237794291200</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3053352583694970340.post-6244586529697834644</id><published>2009-04-10T07:54:00.000-07:00</published><updated>2009-04-10T08:12:44.925-07:00</updated><title type='text'>fedora disable gnome desktop</title><content type='html'>&lt;strong&gt;&lt;/strong&gt;1. while computer is running&lt;br /&gt;#: init 3 //switch to run level 3(text mode) //gnome window in level 5(default mode)&lt;br /&gt;#:&lt;br /&gt;&lt;br /&gt;2. Permanent&lt;br /&gt;#: vi /etc/inittab&lt;br /&gt;find "id:&lt;var&gt;number&lt;/var&gt;:initdefault:" //default is id:5:initdefault:&lt;br /&gt;change line to "id:3:initdefault:"&lt;br /&gt;&lt;br /&gt;ref: http://www.fedorafaq.org/basics/&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3053352583694970340-6244586529697834644?l=itgeekhelp.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://itgeekhelp.blogspot.com/feeds/6244586529697834644/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://itgeekhelp.blogspot.com/2009/04/fedora-disable-gnome-desktop.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3053352583694970340/posts/default/6244586529697834644'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3053352583694970340/posts/default/6244586529697834644'/><link rel='alternate' type='text/html' href='http://itgeekhelp.blogspot.com/2009/04/fedora-disable-gnome-desktop.html' title='fedora disable gnome desktop'/><author><name>Pedric Kng Aka Boon</name><uri>http://www.blogger.com/profile/07979744237794291200</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3053352583694970340.post-9019368742187859044</id><published>2009-04-09T03:30:00.000-07:00</published><updated>2009-04-15T19:52:23.046-07:00</updated><title type='text'>Cron job (MYSQLDUMP FTP SCRIPT)</title><content type='html'>Cron commands&lt;br /&gt;crontab -e //edit user cronjob&lt;br /&gt;&lt;br /&gt;Add the below script to the cron&lt;br /&gt;50 10 * * * /opt/logScripts/mysqlbackup.sh &gt; /opt/logs/mysqlbackup.log&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;crontab -l  //list&lt;br /&gt;crontab -r //remove&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;#!/bin/bash&lt;br /&gt;&lt;br /&gt;DATADIR=/home/database&lt;br /&gt;&lt;br /&gt;NOW=$(date +%d%m%Y%H%M%S)&lt;br /&gt;#T=$(date +%H%M%S)&lt;br /&gt;#echo ${T}&lt;br /&gt;&lt;br /&gt;mysqldump -uroot -p12345678 webservice &gt; "${DATADIR}/db${NOW}.sql"&lt;br /&gt;tar -zcf "${DATADIR}/db${NOW}.tgz" "${DATADIR}/betterthanpindb${NOW}.sql"&lt;br /&gt;rm -f "${DATADIR}/db${NOW}.sql"&lt;br /&gt;&lt;br /&gt;HOST='192.168.1.250'&lt;br /&gt;USER='ftpuser'&lt;br /&gt;PASSWD='12345678'&lt;br /&gt;&lt;br /&gt;TARFILE="db${NOW}.tgz"&lt;br /&gt;&lt;br /&gt;ftp -i -n ${HOST} &amp;lt;&amp;lt; END_SCRIPT&lt;br /&gt;user ${USER} ${PASSWD}&lt;br /&gt;&lt;br /&gt;binary&lt;br /&gt;lcd ${DATADIR}&lt;br /&gt;put $TARFILE&lt;br /&gt;quit&lt;br /&gt;END_SCRIPT&lt;br /&gt;&lt;br /&gt;rm -f "${DATADIR}/db${NOW}.tgz"&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;http://www.adminschoice.com/docs/crontab.htm&lt;br /&gt;http://www.webmasterworld.com/databases_sql_mysql/3277413.htm&lt;br /&gt;http://www.unixgeeks.org/security/newbie/unix/cron-1.html&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3053352583694970340-9019368742187859044?l=itgeekhelp.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://itgeekhelp.blogspot.com/feeds/9019368742187859044/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://itgeekhelp.blogspot.com/2009/04/cron-job-mysqldump-ftp-script.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3053352583694970340/posts/default/9019368742187859044'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3053352583694970340/posts/default/9019368742187859044'/><link rel='alternate' type='text/html' href='http://itgeekhelp.blogspot.com/2009/04/cron-job-mysqldump-ftp-script.html' title='Cron job (MYSQLDUMP FTP SCRIPT)'/><author><name>Pedric Kng Aka Boon</name><uri>http://www.blogger.com/profile/07979744237794291200</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3053352583694970340.post-5270287034792917259</id><published>2009-04-08T22:23:00.000-07:00</published><updated>2010-03-30T23:08:19.057-07:00</updated><title type='text'>Linux Glassfish startup service</title><content type='html'>1. Add the script glassfish below to /etc/init.d&lt;br /&gt;Name of file = glassfish-&lt;domain_name&gt;&lt;domain&gt;&lt;domain&gt; e.g., glassfish-domain1&lt;br /&gt;-chmod a+x /etc/init.d/glassfish-&lt;domain&gt;&lt;domain_name&gt;&lt;domain&gt;&lt;br /&gt;&lt;br /&gt;2. To support service, the script must fulfill the below criteria:&lt;br /&gt;-3 functions: start, stop, restart&lt;br /&gt;-chkconfig level&lt;br /&gt;3. debug script # bash -x glassfish-&lt;domain&gt; &lt;arg&gt;&lt;br /&gt;4. to have glassfish start during boot (and stop during halt)&lt;br /&gt;&lt;br /&gt;run level: 2345&lt;br /&gt;start priority:64&lt;br /&gt;stop priority:36&lt;br /&gt;&lt;br /&gt;ln -s /etc/init.d/glassfish-&lt;domain&gt; /etc/rc0.d/K36glassfish-&lt;domain&gt;&lt;br /&gt;ln -s /etc/init.d/glassfish-&lt;domain&gt; /etc/rc1.d/K36glassfish-&lt;domain&gt;&lt;br /&gt;ln -s /etc/init.d/glassfish-&lt;domain&gt; /etc/rc2.d/S64glassfish-&lt;domain&gt;&lt;br /&gt;ln -s /etc/init.d/glassfish-&lt;domain&gt; /etc/rc3.d/S64glassfish-&lt;domain&gt;&lt;br /&gt;ln -s /etc/init.d/glassfish-&lt;domain&gt; /etc/rc4.d/S64glassfish-&lt;domain&gt;&lt;br /&gt;ln -s /etc/init.d/glassfish-&lt;domain&gt; /etc/rc5.d/S64glassfish-&lt;domain&gt;&lt;br /&gt;ln -s /etc/init.d/glassfish-&lt;domain&gt; /etc/rc6.d/K36glassfish-&lt;domain&gt;&lt;br /&gt;&lt;br /&gt;5. reboot&lt;br /&gt;&lt;br /&gt;Linux command to chkconfig service start on boot&lt;br /&gt;#: ntsysv&lt;br /&gt;&lt;br /&gt;ps U &lt;user&gt;&lt;br /&gt;service glassfish-&lt;domain&gt; status&lt;br /&gt;service glassfish-&lt;domain&gt; start&lt;br /&gt;&lt;br /&gt;************glassfish****************************&lt;br /&gt;&lt;br /&gt;#!/bin/bash&lt;br /&gt;# chkconfig: 2345 64 36&lt;br /&gt;# description: GlassFish is a Java Application Server.&lt;br /&gt;# processname: glassfish&lt;br /&gt;# pidfile: /var/run/glassfish.pid&lt;br /&gt;&lt;br /&gt;# filename glassfish-&lt;domain&gt;&lt;br /&gt;&lt;br /&gt;# source function library&lt;br /&gt;. /etc/init.d/functions&lt;br /&gt;&lt;br /&gt;RETVAL=0&lt;br /&gt;GLASSFISH_BIN="/opt/glassfish/bin"&lt;br /&gt;PASSWORDPATH="/opt/glassfish/domains/dsss/config/startup-password"&lt;br /&gt;GFUSER="atworld"&lt;br /&gt;&lt;br /&gt;# Basename works with symbolic links.&lt;br /&gt;NAME="$(basename $0)"&lt;br /&gt;unset ISBOOT&lt;br /&gt;# Trim off the Sxx/Kxx prefix&lt;br /&gt;if [ "${NAME:0:1}" = "S" -o "${NAME:0:1}" = "K" ]; then&lt;br /&gt; NAME="${NAME:3}"&lt;br /&gt; ISBOOT="1"&lt;br /&gt;fi&lt;br /&gt;# Trim off the glassfish- prefix&lt;br /&gt;NAME=${NAME:10}&lt;br /&gt;&lt;br /&gt;# /etc/init.d/glassfish should never be called directly.&lt;br /&gt;if [ -z $NAME ]; then&lt;br /&gt;     echo -n $"Cannot start Glassfish without specifying a domain."&lt;br /&gt;     failure&lt;br /&gt;     echo&lt;br /&gt;     exit 1&lt;br /&gt;fi&lt;br /&gt;&lt;br /&gt;start() {&lt;br /&gt;     echo -n $"Starting Glassfish V2 domain $NAME: "&lt;br /&gt;     daemon --user $GFUSER --pidfile /var/run/glassfish-$NAME.pid "$GLASSFISH_BIN/asadmin start-domain --passwordfile $PASSWORDPATH $NAME"&lt;br /&gt;     RETVAL=$?&lt;br /&gt;     if [ $RETVAL -eq 0 ]; then&lt;br /&gt;             PID=`ps U $GFUSER | grep $NAME | awk '{ print $1}'`&lt;br /&gt;             echo $PID &gt; /var/run/glassfish-$NAME.pid&lt;br /&gt;             touch /var/lock/subsys/glassfish-$NAME&lt;br /&gt;     fi&lt;br /&gt;     echo&lt;br /&gt;}&lt;br /&gt;stop() {&lt;br /&gt;     echo -n $"Shutting down Glassfish V2 domain $NAME: "&lt;br /&gt;     $GLASSFISH_BIN/asadmin stop-domain $NAME&lt;br /&gt;     RETVAL=$?&lt;br /&gt;     [ $RETVAL -eq 0 ]&lt;br /&gt;      rm -f /var/lock/subsys/glassfish-$NAME&lt;br /&gt;      rm -f /var/run/glassfish-$NAME success || failure&lt;br /&gt;     echo&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;case "$1" in&lt;br /&gt;start)&lt;br /&gt;     start&lt;br /&gt;     ;;&lt;br /&gt;stop)&lt;br /&gt;     stop&lt;br /&gt;     ;;&lt;br /&gt;restart|reload)&lt;br /&gt;     stop&lt;br /&gt;     start&lt;br /&gt;     ;;&lt;br /&gt;condrestart)&lt;br /&gt;     if [ -f /var/lock/subsys/glassfish-$NAME ]; then&lt;br /&gt;         stop&lt;br /&gt;         start&lt;br /&gt;     fi&lt;br /&gt;     ;;&lt;br /&gt;status)&lt;br /&gt;     status glassfish-$NAME&lt;br /&gt;     RETVAL=$?&lt;br /&gt;     ;;&lt;br /&gt;*)&lt;br /&gt;     echo $"Usage: $0 {start|stop|restart|condrestart|status}"&lt;br /&gt;     exit 1&lt;br /&gt;esac&lt;br /&gt;&lt;br /&gt;exit $RETVAL&lt;br /&gt;&lt;br /&gt;****************************************************&lt;br /&gt;&lt;br /&gt;References:&lt;br /&gt;http://www.thelinuxblog.com/adding-a-service-on-fedora/&lt;br /&gt;http://computingwithjasper.blogspot.com/2008/01/installing-glassfish-2-on-ubuntu-710.html&lt;br /&gt;http://www.cyberciti.biz/faq/rhel5-update-rcd-command/&lt;br /&gt;http://www.linux.com/feature/46892&lt;br /&gt;http://www.linuxjournal.com/article/4445&lt;br /&gt;http://www.comptechdoc.org/os/linux/startupman/linux_surcsysinit.html&lt;br /&gt;http://www.vias.org/linux-knowhow/fwpx_appendix_a_03.html&lt;br /&gt;http://www.cricalix.net/archives/2008/07/22/autostarting-glassfish-on-centos/&lt;br /&gt;http://www.linuxhomenetworking.com/wiki/index.php/Quick_HOWTO_:_Ch07_:_The_Linux_Boot_Process&lt;br /&gt;http://www.zimbra.com/forums/installation/10553-solved-sudo-sorry-you-must-have-tty-run-sudo.html&lt;br /&gt;http://www.linuxmanpages.com/man5/sudoers.5.php#lbAM&lt;br /&gt;http://www.yolinux.com/TUTORIALS/LinuxTutorialInitProcess.html&lt;br /&gt;&lt;/domain&gt;&lt;/domain&gt;&lt;/domain&gt;&lt;/user&gt;&lt;/domain&gt;&lt;/domain&gt;&lt;/domain&gt;&lt;/domain&gt;&lt;/domain&gt;&lt;/domain&gt;&lt;/domain&gt;&lt;/domain&gt;&lt;/domain&gt;&lt;/domain&gt;&lt;/domain&gt;&lt;/domain&gt;&lt;/domain&gt;&lt;/domain&gt;&lt;/arg&gt;&lt;/domain&gt;&lt;/domain&gt;&lt;/domain_name&gt;&lt;/domain&gt;&lt;/domain_name&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3053352583694970340-5270287034792917259?l=itgeekhelp.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://itgeekhelp.blogspot.com/feeds/5270287034792917259/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://itgeekhelp.blogspot.com/2009/04/linux-glassfish-startup-domain-upon.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3053352583694970340/posts/default/5270287034792917259'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3053352583694970340/posts/default/5270287034792917259'/><link rel='alternate' type='text/html' href='http://itgeekhelp.blogspot.com/2009/04/linux-glassfish-startup-domain-upon.html' title='Linux Glassfish startup service'/><author><name>Pedric Kng Aka Boon</name><uri>http://www.blogger.com/profile/07979744237794291200</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3053352583694970340.post-1311656908461268774</id><published>2009-04-08T02:52:00.000-07:00</published><updated>2009-04-08T03:03:32.792-07:00</updated><title type='text'>Cron job to backup mysql database</title><content type='html'>&lt;pre class="code" style="font-family: monospace;"&gt;date=`date -I`; mysqldump -uyourusername -pyourpassword ——all-databases &gt; /home/LOGIN/backups/xbackup_$date.sql; gzip /home/LOGIN/backups/xbackup_$date.sql&lt;br /&gt;&lt;br /&gt;he date line formats the date so that we can append it to our backup filename. We then ask mysql to dump all databases into /&lt;strong&gt;home/LOGIN/public_html/backups/xbackup_$date.sql&lt;/strong&gt;,&lt;br /&gt;where LOGIN is your Cpanel name, using “yourusername” as user (-u) and&lt;br /&gt;“yourpassword” as the password (-p). Notice the date variable inserted&lt;br /&gt;in the filename. Finally our &lt;acronym title="Structured Query Language"&gt;SQL&lt;/acronym&gt; file is gzipped using the gzip directive.&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3053352583694970340-1311656908461268774?l=itgeekhelp.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://itgeekhelp.blogspot.com/feeds/1311656908461268774/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://itgeekhelp.blogspot.com/2009/04/cron-job-to-backup-mysql-database.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3053352583694970340/posts/default/1311656908461268774'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3053352583694970340/posts/default/1311656908461268774'/><link rel='alternate' type='text/html' href='http://itgeekhelp.blogspot.com/2009/04/cron-job-to-backup-mysql-database.html' title='Cron job to backup mysql database'/><author><name>Pedric Kng Aka Boon</name><uri>http://www.blogger.com/profile/07979744237794291200</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3053352583694970340.post-6970358335083567994</id><published>2009-04-08T02:41:00.000-07:00</published><updated>2009-04-10T07:51:19.215-07:00</updated><title type='text'>Setup file owner and group. Current process</title><content type='html'>******Change file owner*******&lt;br /&gt;chown &lt;owner&gt; &lt;filename&gt;&lt;br /&gt;chown &lt;owner&gt; . //all&lt;br /&gt;&lt;br /&gt;******Change group***********&lt;br /&gt;chgrp &lt;group&gt; &lt;filename&gt;&lt;br /&gt;chgrp &lt;group&gt; . //all&lt;br /&gt;&lt;br /&gt;******Current process***********&lt;br /&gt;&lt;pre&gt;&lt;b&gt;&lt;b&gt;ps aux | grep&lt;br /&gt;ps U &lt;username&gt;&lt;br /&gt;&lt;processname&gt;&lt;/processname&gt;&lt;/b&gt;&lt;/b&gt;&lt;/pre&gt;&lt;/group&gt;&lt;/filename&gt;&lt;/group&gt;&lt;/owner&gt;&lt;/filename&gt;&lt;/owner&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3053352583694970340-6970358335083567994?l=itgeekhelp.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://itgeekhelp.blogspot.com/feeds/6970358335083567994/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://itgeekhelp.blogspot.com/2009/04/setup-file-owner-and-group-current.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3053352583694970340/posts/default/6970358335083567994'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3053352583694970340/posts/default/6970358335083567994'/><link rel='alternate' type='text/html' href='http://itgeekhelp.blogspot.com/2009/04/setup-file-owner-and-group-current.html' title='Setup file owner and group. Current process'/><author><name>Pedric Kng Aka Boon</name><uri>http://www.blogger.com/profile/07979744237794291200</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3053352583694970340.post-2262573999349020150</id><published>2009-03-18T21:02:00.000-07:00</published><updated>2009-04-05T23:35:01.800-07:00</updated><title type='text'>Sync Linux server Time w. NTP server</title><content type='html'>&lt;span style="font-weight: bold;"&gt;Synchronize&lt;br /&gt;&lt;/span&gt;ntpdate -b pool.ntp.org&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;configuration&lt;/span&gt;&lt;br /&gt;vi /etc/ntp.conf&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;References: http://www.brennan.id.au/09-Network_Time_Protocol.html&lt;br /&gt;&lt;br /&gt;&lt;ol&gt;&lt;li&gt;Logged in as root, check which timezone your machine is currently using by executing `&lt;b&gt;date&lt;/b&gt;`. You'll see something like &lt;code&gt;Mon 17 Jan 2005 12:15:08 PM PST&lt;/code&gt;, PST in this case is the current timezone.&lt;/li&gt;&lt;li&gt;Change to the directory &lt;code&gt;/usr/share/zoneinfo&lt;/code&gt; here you will find a list of time zone regions. Choose the most appropriate region, if you live in Canada or the US this directory is the "America" directory.&lt;/li&gt;&lt;li&gt;If you wish, backup the previous timezone configuration by copying it to a different location. Such as &lt;pre&gt;mv /etc/localtime  /etc/localtime-old&lt;br /&gt;&lt;/pre&gt;&lt;/li&gt;&lt;li&gt;Create a symbolic link from the appropiate timezone to /etc/localtime. Example: &lt;pre&gt;ln -sf /usr/share/zoneinfo/Europe/Amsterdam /etc/localtime&lt;br /&gt;&lt;/pre&gt;&lt;/li&gt;&lt;li&gt;If you have the utility rdate, update the current system time by executing &lt;pre&gt;/usr/bin/rdate -s time.nist.gov&lt;br /&gt;&lt;/pre&gt;&lt;/li&gt;&lt;li&gt;Set the ZONE entry in the file &lt;code&gt;/etc/sysconfig/clock&lt;/code&gt; file (e.g. "America/Los_Angeles")&lt;/li&gt;&lt;li&gt;Set the hardware clock by executing: &lt;pre&gt;/sbin/hwclock --systohc&lt;br /&gt;&lt;/pre&gt;&lt;/li&gt;&lt;/ol&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3053352583694970340-2262573999349020150?l=itgeekhelp.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://itgeekhelp.blogspot.com/feeds/2262573999349020150/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://itgeekhelp.blogspot.com/2009/03/sync-linux-server-time-w-ntp-server.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3053352583694970340/posts/default/2262573999349020150'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3053352583694970340/posts/default/2262573999349020150'/><link rel='alternate' type='text/html' href='http://itgeekhelp.blogspot.com/2009/03/sync-linux-server-time-w-ntp-server.html' title='Sync Linux server Time w. NTP server'/><author><name>Pedric Kng Aka Boon</name><uri>http://www.blogger.com/profile/07979744237794291200</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3053352583694970340.post-6500911590181373273</id><published>2009-03-18T02:01:00.000-07:00</published><updated>2009-03-18T02:02:17.805-07:00</updated><title type='text'>Glassfish web container tuning settings</title><content type='html'>Reference: http://docs.sun.com/app/docs/doc/820-4343/abedw?a=view&lt;br /&gt;&lt;br /&gt;&lt;h1 class="sol"&gt;Web Container Settings&lt;/h1&gt;  &lt;p&gt;Set &lt;a name="indexterm-91"&gt;&lt;/a&gt;Web container properties with the Admin Console at Configurations &gt; &lt;var&gt;config-name&lt;/var&gt; &gt; Web Container.&lt;/p&gt;   &lt;ul&gt;&lt;li&gt; &lt;p&gt; &lt;a href="http://docs.sun.com/app/docs/doc/820-4343/abedx?a=view"&gt;Session Properties: Session Timeout&lt;/a&gt; &lt;/p&gt;   &lt;/li&gt;&lt;li&gt; &lt;p&gt; &lt;a href="http://docs.sun.com/app/docs/doc/820-4343/abedy?a=view"&gt;Manager Properties: Reap Interval&lt;/a&gt; &lt;/p&gt;   &lt;/li&gt;&lt;li&gt; &lt;p&gt; &lt;a href="http://docs.sun.com/app/docs/doc/820-4343/abedz?a=view"&gt;Disable Dynamic JSP Reloading&lt;/a&gt; &lt;/p&gt;   &lt;/li&gt;&lt;/ul&gt;  &lt;a name="abedx"&gt;&lt;/a&gt; &lt;h2 class="sol"&gt;Session Properties: Session Timeout&lt;/h2&gt;  &lt;p&gt; &lt;a name="indexterm-92"&gt;&lt;/a&gt;Session timeout determines how long the server maintains a session if a user does not explicitly invalidate the session. The default value is 30 minutes. Tune this value according to your application requirements. Setting a very large value for session timeout can degrade performance by causing the server to maintain too many sessions in the session store. However, setting a very small value can cause the server to reclaim sessions too soon.&lt;/p&gt;  &lt;a name="abedy"&gt;&lt;/a&gt; &lt;h2 class="sol"&gt;Manager Properties: Reap Interval&lt;/h2&gt;  &lt;p&gt;Modifying the &lt;a name="indexterm-93"&gt;&lt;/a&gt;reap interval can improve performance, but setting it without considering the nature of your sessions and business logic can cause data inconsistency, especially for time-based persistence-frequency.&lt;/p&gt;  &lt;p&gt;For example, if you set the reap interval to 60 seconds, the value of session data will be recorded every 60 seconds. But if a client accesses a servlet to update a value at 20 second increments, then inconsistencies will result.&lt;/p&gt;  &lt;p&gt;For example, consider an online auction scenario as follows:&lt;/p&gt;   &lt;ul&gt;&lt;li&gt; &lt;p&gt;Bidding starts at $5, in 60 seconds the value recorded will be $8 (three 20 second intervals).&lt;/p&gt;   &lt;/li&gt;&lt;li&gt; &lt;p&gt;During the next 40 seconds, the client starts incrementing the price. The value the client sees is $10.&lt;/p&gt;   &lt;/li&gt;&lt;li&gt; &lt;p&gt;During the client’s 20 second rest, the Application Server stops and starts in 10 seconds. As a result, the latest value recorded at the 60 second interval ($8) is be loaded into the session.&lt;/p&gt;   &lt;/li&gt;&lt;li&gt; &lt;p&gt;The client clicks again expecting to see $11; but instead sees is $9, which is incorrect.&lt;/p&gt;   &lt;/li&gt;&lt;li&gt; &lt;p&gt;So, to avoid data inconsistencies, take into the account the expected behavior of the application when adjusting the reap interval.&lt;/p&gt;   &lt;/li&gt;&lt;/ul&gt;  &lt;a name="abedz"&gt;&lt;/a&gt; &lt;h2 class="sol"&gt;Disable Dynamic JSP Reloading&lt;/h2&gt;  &lt;a name="indexterm-94"&gt;&lt;/a&gt; &lt;p&gt;On a production system, improve web container performance by disabling dynamic JSP reloading. To do so, edit the &lt;tt&gt;default-web.xml&lt;/tt&gt; file in the &lt;tt&gt;config&lt;/tt&gt; directory for each instance. Change the servlet definition for a JSP file to look like this:&lt;/p&gt;   &lt;pre&gt;&lt;servlet&gt;&lt;br /&gt; &lt;servlet-name&gt;jsp&lt;/servlet-name&gt;&lt;br /&gt; &lt;servlet-class&gt;org.apache.jasper.servlet.JspServlet&lt;/servlet-class&gt;&lt;br /&gt; &lt;init-param&gt;&lt;br /&gt;   &lt;param-name&gt;development&lt;/param-name&gt;&lt;br /&gt;   &lt;param-value&gt;false&lt;/param-value&gt;&lt;br /&gt; &lt;/init-param&gt;&lt;br /&gt; &lt;init-param&gt;&lt;br /&gt;   &lt;param-name&gt;xpoweredBy&lt;/param-name&gt;&lt;br /&gt;   &lt;param-value&gt;true&lt;/param-value&gt;&lt;br /&gt; &lt;/init-param&gt;&lt;br /&gt; &lt;init-param&gt;&lt;br /&gt;   &lt;param-name&gt;genStrAsCharArray&lt;/param-name&gt;&lt;br /&gt;   &lt;param-value&gt;true&lt;/param-value&gt;&lt;br /&gt; &lt;/init-param&gt;  &lt;load-on-startup&gt;3&lt;/load-on-startup&gt;&lt;br /&gt;&lt;/servlet&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3053352583694970340-6500911590181373273?l=itgeekhelp.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://itgeekhelp.blogspot.com/feeds/6500911590181373273/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://itgeekhelp.blogspot.com/2009/03/glassfish-web-container-tuning-settings.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3053352583694970340/posts/default/6500911590181373273'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3053352583694970340/posts/default/6500911590181373273'/><link rel='alternate' type='text/html' href='http://itgeekhelp.blogspot.com/2009/03/glassfish-web-container-tuning-settings.html' title='Glassfish web container tuning settings'/><author><name>Pedric Kng Aka Boon</name><uri>http://www.blogger.com/profile/07979744237794291200</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3053352583694970340.post-3599220811390720332</id><published>2009-03-17T02:13:00.001-07:00</published><updated>2009-03-17T02:56:40.903-07:00</updated><title type='text'>MySQL Database Replication</title><content type='html'>http://aciddrop.com/2008/01/10/step-by-step-how-to-setup-mysql-database-replication/&lt;br /&gt;&lt;span id="intelliTxt"&gt;&lt;/span&gt;&lt;h2&gt;&lt;span style="font-size:85%;"&gt;http://www.howtoforge.com/mysql_database_replication&lt;/span&gt;&lt;/h2&gt;http://www.onlamp.com/pub/a/onlamp/2005/06/16/MySQLian.html&lt;br /&gt;&lt;br /&gt;http://osdir.com/ml/db.mysql.java/2004-10/msg00011.html&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3053352583694970340-3599220811390720332?l=itgeekhelp.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://itgeekhelp.blogspot.com/feeds/3599220811390720332/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://itgeekhelp.blogspot.com/2009/03/mysql-database-replication.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3053352583694970340/posts/default/3599220811390720332'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3053352583694970340/posts/default/3599220811390720332'/><link rel='alternate' type='text/html' href='http://itgeekhelp.blogspot.com/2009/03/mysql-database-replication.html' title='MySQL Database Replication'/><author><name>Pedric Kng Aka Boon</name><uri>http://www.blogger.com/profile/07979744237794291200</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3053352583694970340.post-1425313767444621426</id><published>2009-03-17T01:16:00.000-07:00</published><updated>2009-04-08T00:26:39.089-07:00</updated><title type='text'>Putty show server ipaddress</title><content type='html'>Add the below to vi ~/&lt;username&gt;.bashrc&lt;br /&gt;&lt;br /&gt;add IP=`ifconfig eth0|grep inet\ addr|cut -d " " -s -f 12|cut -d : -s -f 2`&lt;br /&gt;export PS1='${debian_chroot:+($debian_chroot)}\u@$IP:\w\$ '&lt;/username&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3053352583694970340-1425313767444621426?l=itgeekhelp.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://itgeekhelp.blogspot.com/feeds/1425313767444621426/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://itgeekhelp.blogspot.com/2009/03/putty-show-server-ipaddress.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3053352583694970340/posts/default/1425313767444621426'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3053352583694970340/posts/default/1425313767444621426'/><link rel='alternate' type='text/html' href='http://itgeekhelp.blogspot.com/2009/03/putty-show-server-ipaddress.html' title='Putty show server ipaddress'/><author><name>Pedric Kng Aka Boon</name><uri>http://www.blogger.com/profile/07979744237794291200</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3053352583694970340.post-5558617011283335419</id><published>2009-03-16T01:48:00.000-07:00</published><updated>2009-03-16T01:49:29.408-07:00</updated><title type='text'>How to Get the Best Performance Out of a Java Persistence Implementation</title><content type='html'>Ref: http://blogs.sun.com/enterprisetechtips/entry/how_to_get_the_best&lt;br /&gt;&lt;br /&gt;http://dev.mysql.com/tech-resources/articles/connection_pooling_with_connectorj.html&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3053352583694970340-5558617011283335419?l=itgeekhelp.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://itgeekhelp.blogspot.com/feeds/5558617011283335419/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://itgeekhelp.blogspot.com/2009/03/how-to-get-best-performance-out-of-java.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3053352583694970340/posts/default/5558617011283335419'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3053352583694970340/posts/default/5558617011283335419'/><link rel='alternate' type='text/html' href='http://itgeekhelp.blogspot.com/2009/03/how-to-get-best-performance-out-of-java.html' title='How to Get the Best Performance Out of a Java Persistence Implementation'/><author><name>Pedric Kng Aka Boon</name><uri>http://www.blogger.com/profile/07979744237794291200</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3053352583694970340.post-7786884493674418604</id><published>2009-03-16T00:43:00.000-07:00</published><updated>2009-03-16T00:44:55.580-07:00</updated><title type='text'>Multiple MYSQL Instance reference</title><content type='html'>http://code.openark.org/blog/mysql/manually-installing-multiple-mysql-instances-on-linux-howto&lt;br /&gt;http://www.ducea.com/2009/01/19/running-multiple-instances-of-mysql-on-the-same-machine/&lt;br /&gt;http://dev.mysql.com/doc/refman/5.1/en/multiple-unix-servers.html&lt;br /&gt;http://blog.dbadojo.com/2008/01/multiple-mysql-instances-on-ec2.html&lt;br /&gt;http://forums.mysql.com/read.php?79,27,85#msg-85&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3053352583694970340-7786884493674418604?l=itgeekhelp.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://itgeekhelp.blogspot.com/feeds/7786884493674418604/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://itgeekhelp.blogspot.com/2009/03/multiple-mysql-instance-reference.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3053352583694970340/posts/default/7786884493674418604'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3053352583694970340/posts/default/7786884493674418604'/><link rel='alternate' type='text/html' href='http://itgeekhelp.blogspot.com/2009/03/multiple-mysql-instance-reference.html' title='Multiple MYSQL Instance reference'/><author><name>Pedric Kng Aka Boon</name><uri>http://www.blogger.com/profile/07979744237794291200</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3053352583694970340.post-9206775541563222081</id><published>2009-03-10T23:14:00.000-07:00</published><updated>2009-03-10T23:24:44.205-07:00</updated><title type='text'>Java Access Control</title><content type='html'>Access Levels&lt;br /&gt;Modifier Class Package Subclass World&lt;br /&gt;public         Y Y Y  Y&lt;br /&gt;protected Y Y Y  N&lt;br /&gt;no modifier Y Y N  N&lt;br /&gt;private         Y N N  N&lt;br /&gt;&lt;br /&gt;Public – access allowed to public. E.g., constants&lt;br /&gt;Protected – allow child to access parent.&lt;br /&gt;No modifier – allow package member to access only.&lt;br /&gt;Private – non-accessible.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Static Initialize&lt;br /&gt;- init static constant variables or object&lt;br /&gt;- loaded before class is loaded &lt;br /&gt;- prevents lock scenario&lt;br /&gt;&lt;br /&gt;static&lt;br /&gt;{&lt;br /&gt; *action&lt;br /&gt;}&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3053352583694970340-9206775541563222081?l=itgeekhelp.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://itgeekhelp.blogspot.com/feeds/9206775541563222081/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://itgeekhelp.blogspot.com/2009/03/java-access-control.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3053352583694970340/posts/default/9206775541563222081'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3053352583694970340/posts/default/9206775541563222081'/><link rel='alternate' type='text/html' href='http://itgeekhelp.blogspot.com/2009/03/java-access-control.html' title='Java Access Control'/><author><name>Pedric Kng Aka Boon</name><uri>http://www.blogger.com/profile/07979744237794291200</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3053352583694970340.post-6010001079092002972</id><published>2009-03-10T21:00:00.000-07:00</published><updated>2009-03-12T00:44:58.488-07:00</updated><title type='text'>Install metro 1.4 on tomcat 5</title><content type='html'>&lt;pre&gt;1. Download metro-1.4.jar &lt;https: net="" 4=""&gt;&lt;br /&gt;2. java -jar metro-1_4.jar&lt;br /&gt;3.&lt;br /&gt;jars from extracted metro jar &lt;metro-dir&gt;/lib&lt;br /&gt;&lt;/metro-dir&gt;&lt;/https:&gt;&lt;/pre&gt;&lt;table border="1"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;th&gt;Jars&lt;/th&gt;                          &lt;th&gt;What?&lt;/th&gt;                          &lt;th&gt;Needed at runtime&lt;/th&gt;                    &lt;/tr&gt;       &lt;tr&gt;                          &lt;td&gt;           &lt;tt&gt;webservices-api.jar           &lt;br /&gt;webservices-extra-api.jar           &lt;/tt&gt;         &lt;/td&gt;                          &lt;td&gt;"javax.*" JCP APIs&lt;/td&gt;                          &lt;td&gt;Yes&lt;/td&gt;                    &lt;/tr&gt;       &lt;tr&gt;                          &lt;td&gt;           &lt;tt&gt;webservices-rt.jar           &lt;br /&gt;webservices-extra.jar           &lt;/tt&gt;         &lt;/td&gt;                          &lt;td&gt;Runtime code that implements the API&lt;/td&gt;                          &lt;td&gt;Yes&lt;/td&gt;                    &lt;/tr&gt;       &lt;tr&gt;                          &lt;td&gt;           &lt;tt&gt;webservices-tools.jar&lt;/tt&gt;         &lt;/td&gt;                          &lt;td&gt;Development time tools&lt;/td&gt;                          &lt;td&gt;No&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;pre&gt;&lt;br /&gt;&lt;code&gt;shared.loader&lt;/code&gt; property in &lt;tomcat-dir&gt;/&lt;code&gt;conf/catalina.properties&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;For Tomcat 5.0&lt;br /&gt;-&gt; &lt;tt&gt;copy webservices-api.jar, webservices-extra-api.jar&lt;/tt&gt;, &lt;tt&gt;webservices-rt.jar,&lt;br /&gt;webservices-extra.jar,webservices-tools.jar&lt;/tt&gt; to &lt;tomcat 5=""&gt;/shared/lib&lt;br /&gt;-&gt;&lt;code&gt;default: shared.loader=${catalina.base}/shared/classes,&lt;br /&gt;${catalina.base}/shared/lib/*.jar&lt;/code&gt;&lt;br /&gt;else if want to standardise w. tomcat 6&lt;br /&gt;-&gt; do not copy file to &lt;tomcat 5=""&gt;/shared/lib, extract into external folder&lt;br /&gt;c://metro/lib/*.jar&lt;br /&gt;-&gt;configure&lt;br /&gt;&lt;code&gt;shared.loader=${catalina.base}/shared/classes,${catalina.base}/shared/lib/*.jar,&lt;br /&gt;file:///c:/metro/lib/*.jar&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;For Tomcat 6.0&lt;br /&gt;-&gt; &lt;tt&gt;copy webservices-api.jar, webservices-extra-api.jar&lt;/tt&gt;, &lt;tt&gt;webservices-rt.jar,&lt;br /&gt;webservices-extra.jar,webservices-tools.jar&lt;/tt&gt; to c:/metro/lib/&lt;br /&gt;-&gt; configure &lt;code&gt;shared.loader=file:///c:/metro/lib/*.jar&lt;/code&gt;&lt;br /&gt;if using java 6 w. tomcat 6-&gt; copy &lt;code&gt;webservices-api.jar&lt;/code&gt; into &lt;code&gt;c:/jdk6/jre/lib/&lt;br /&gt;&lt;br /&gt;-Userful link for tutorial&lt;br /&gt;https://metro.dev.java.net/getting-started/basic.html&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/code&gt;&lt;/tomcat&gt;&lt;/tomcat&gt;&lt;/tomcat-dir&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3053352583694970340-6010001079092002972?l=itgeekhelp.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://itgeekhelp.blogspot.com/feeds/6010001079092002972/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://itgeekhelp.blogspot.com/2009/03/install-metro-14-on-tomcat-5.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3053352583694970340/posts/default/6010001079092002972'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3053352583694970340/posts/default/6010001079092002972'/><link rel='alternate' type='text/html' href='http://itgeekhelp.blogspot.com/2009/03/install-metro-14-on-tomcat-5.html' title='Install metro 1.4 on tomcat 5'/><author><name>Pedric Kng Aka Boon</name><uri>http://www.blogger.com/profile/07979744237794291200</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3053352583694970340.post-5600670721918479945</id><published>2009-03-10T20:32:00.001-07:00</published><updated>2009-03-10T20:36:54.774-07:00</updated><title type='text'>JUNIT Testing</title><content type='html'>For JUnit Testing,&lt;br /&gt;&lt;br /&gt;Each class that needs to be assertedEqual must overwrite the below 2 methods;&lt;span class="postbody"&gt;&lt;li class=""&gt;&lt;span&gt;&lt;span class="keyword"&gt;public&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span class="keyword"&gt;boolean&lt;/span&gt;&lt;span&gt; equals(Object obj) { &lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class=""&gt;&lt;span class="postbody"&gt;&lt;span&gt;&lt;span class="keyword"&gt;public&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span class="keyword"&gt;int&lt;/span&gt;&lt;span&gt; hashCode() { &lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Below information from http://www.geocities.com/technofundo/tech/java/equalhash.html&lt;br /&gt;&lt;br /&gt;&lt;div class="topic"&gt;Introduction&lt;/div&gt;&lt;br /&gt;The Java super class &lt;b&gt;&lt;code&gt;java.lang.Object&lt;/code&gt;&lt;/b&gt; has two very important methods defined in it. They are - &lt;ul&gt;&lt;li&gt;&lt;code&gt;public boolean equals(Object obj)&lt;/code&gt;&lt;/li&gt;&lt;li&gt;&lt;code&gt;public int hashCode()&lt;/code&gt;&lt;/li&gt;&lt;/ul&gt; These methods prove very important when user classes are confronted with other Java classes, when objects of such classes are added to collections etc. These two methods have become part of Sun Certified Java Programmer 1.4 exam (SCJP 1.4) objectives. This article intends to provide the necessary information about these two methods that would help the SCJP 1.4 exam aspirants. Moreover, this article hopes to help you understand the mechanism and general contracts of these two methods; irrespective of whether you are interested in taking the SCJP 1.4 exam or not. This article should help you while implementing these two methods in your own classes.&lt;br /&gt;&lt;br /&gt; &lt;div class="topic"&gt;&lt;code&gt;public boolean equals(Object obj)&lt;/code&gt;&lt;/div&gt;&lt;br /&gt;This method checks if some other object passed to it as an argument is &lt;i&gt;equal&lt;/i&gt; to the object on which this method is invoked. The default implementation of this method in &lt;code&gt;Object&lt;/code&gt; class simply checks if two object references x and y refer to the same object. i.e. It checks if &lt;code&gt;x == y&lt;/code&gt;. This particular comparison is also known as "shallow comparison". However, the classes providing their own implementations of the &lt;code&gt;equals&lt;/code&gt; method are supposed to perform a "deep comparison"; by actually comparing the relevant data members. Since &lt;code&gt;Object&lt;/code&gt; class has no data members that define its state, it simply performs shallow comparison.&lt;br /&gt;&lt;br /&gt; This is what the JDK 1.4 API documentation says about the &lt;code&gt;equals&lt;/code&gt; method of &lt;code&gt;Object&lt;/code&gt; class-&lt;br /&gt;&lt;br /&gt; &lt;div class="quote"&gt; Indicates whether some other object is "equal to" this one.  &lt;ul&gt;The equals method implements an equivalence relation: &lt;li&gt;It is &lt;b&gt;reflexive&lt;/b&gt;: for any reference value x, x.equals(x) should return true.&lt;/li&gt;&lt;li&gt;It is &lt;b&gt;symmetric&lt;/b&gt;: for any reference values x and y, x.equals(y) should return true if and only if y.equals(x) returns true.&lt;/li&gt;&lt;li&gt;It is &lt;b&gt;transitive&lt;/b&gt;: for any reference values x, y, and z, if x.equals(y) returns true and y.equals(z) returns true, then x.equals(z) should return true.&lt;/li&gt;&lt;li&gt;It is &lt;b&gt;consistent&lt;/b&gt;: for any reference values x and y, multiple invocations of x.equals(y) consistently return true or consistently return false, provided no information used in equals comparisons on the object is modified.&lt;/li&gt;&lt;li&gt;For any non-null reference value x, x.equals(null) should return false.&lt;/li&gt;&lt;/ul&gt; The equals method for class Object implements the most discriminating possible equivalence relation on objects; that is, for any reference values x and y, this method returns true if and only if x and y refer to the same object (x==y has the value true).&lt;br /&gt;&lt;br /&gt;Note that it is generally necessary to override the hashCode method whenever this method is overridden, so as to maintain the general contract for the hashCode method, which states that equal objects must have equal hash codes. &lt;/div&gt;&lt;br /&gt; The contract of the &lt;code&gt;equals&lt;/code&gt; method precisely states what it requires. Once you understand it completely, implementation becomes relatively easy, moreover it would be correct. Let's understand what each of this really means.&lt;br /&gt;&lt;br /&gt; &lt;ol&gt;&lt;li&gt;&lt;b&gt;Reflexive - &lt;/b&gt;It simply means that the object must be equal to itself, which it would be at any given instance; unless you intentionally override the &lt;code&gt;equals&lt;/code&gt; method to behave otherwise.&lt;/li&gt;&lt;li&gt;&lt;b&gt;Symmetric - &lt;/b&gt;It means that if object of one class is equal to another class object, the other class object must be equal to this class object. In other words, one object can not unilaterally decide whether it is equal to another object; two objects, and consequently the classes to which they belong, must bilaterally decide if they are equal or not. They BOTH must agree.&lt;br /&gt;Hence, it is improper and incorrect to have your own class with &lt;code&gt;equals&lt;/code&gt; method that has comparison with an object of &lt;code&gt;java.lang.String&lt;/code&gt; class, or with any other built-in Java class for that matter. It is very important to understand this requirement properly, because it is quite likely that a naive implementation of &lt;code&gt;equals&lt;/code&gt; method may violate this requirement which would result in undesired consequences.&lt;/li&gt;&lt;li&gt;&lt;b&gt;Transitive - &lt;/b&gt;It means that if the first object is equal to the second object and the second object is equal to the third object; then the first object is equal to the third object. In other words, if two objects agree that they are equal, and follow the symmetry principle, one of them can not decide to have a similar contract with another object of different class. All three must agree and follow symmetry principle for various permutations of these three classes.&lt;br /&gt;Consider this example - A, B and C are three classes. A and B both implement the &lt;code&gt;equals&lt;/code&gt; method in such a way that it provides comparison for objects of class A and class B. Now, if author of class B decides to modify its &lt;code&gt;equals&lt;/code&gt; method such that it would also provide equality comparison with class C; he would be violating the transitivity principle. Because, no proper &lt;code&gt;equals&lt;/code&gt; comparison mechanism would exist for class A and class C objects.&lt;/li&gt;&lt;li&gt;&lt;b&gt;Consistent - &lt;/b&gt;It means that if two objects are equal, they must remain equal as long as they are not modified. Likewise, if they are not equal, they must remain non-equal as long as they are not modified. The modification may take place in any one of them or in both of them.&lt;/li&gt;&lt;li&gt;&lt;b&gt;null comparison - &lt;/b&gt;It means that any instantiable class object is not equal to &lt;code&gt;null&lt;/code&gt;, hence the &lt;code&gt;equals&lt;/code&gt; method must return &lt;i&gt;false&lt;/i&gt; if a &lt;code&gt;null&lt;/code&gt; is passed to it as an argument. You have to ensure that your implementation of the &lt;code&gt;equals&lt;/code&gt; method returns &lt;code&gt;false&lt;/code&gt; if a &lt;code&gt;null&lt;/code&gt; is passed to it as an argument.&lt;/li&gt;&lt;!-- valid only for final classes  As long as you make sure that you check the &lt;code&gt;equals&lt;/code&gt; method argument with &lt;code&gt;instanceof&lt;/code&gt; operator for the correct class or interface, this requirement will be taken care of. Because, &lt;a href="http://java.sun.com/docs/books/jls/second_edition/html/expressions.doc.html#80289" target="_blank"&gt;JLS 15.20.2&lt;/a&gt; specifies that if the left hand side (LHS) operand of &lt;code&gt;instanceof&lt;/code&gt; is &lt;code&gt;null&lt;/code&gt;, then it will return &lt;i&gt;false&lt;/i&gt; irrespective of the operand on the right hand side (RHS).  --&gt;&lt;li&gt;&lt;b&gt;Equals &amp;amp; Hash Code relationship - &lt;/b&gt; The last note from the API documentation is very important, it states the relationship requirement between these two methods. It simply means that if two objects are equal, then they must have the same hash code, however the opposite is NOT true. This is discussed in details later in this article.&lt;/li&gt;&lt;/ol&gt; The details about these two methods are interrelated and how they should be overridden correctly is discussed later in this article.&lt;br /&gt;&lt;br /&gt; &lt;div class="topic"&gt;&lt;code&gt;public int hashCode()&lt;/code&gt;&lt;/div&gt;&lt;br /&gt;This method returns the hash code value for the object on which this method is invoked. This method returns the hash code value as an integer and is supported for the benefit of hashing based collection classes such as Hashtable, HashMap, HashSet etc. This method must be overridden in every class that overrides the &lt;code&gt;equals&lt;/code&gt; method.&lt;br /&gt;&lt;br /&gt; This is what the JDK 1.4 API documentation says about the &lt;code&gt;hashCode&lt;/code&gt; method of &lt;code&gt;Object&lt;/code&gt; class-&lt;br /&gt;&lt;br /&gt; &lt;div class="quote"&gt; Returns a hash code value for the object. This method is supported for the benefit of hashtables such as those provided by java.util.Hashtable.&lt;br /&gt; &lt;ul&gt;The general contract of &lt;code&gt;hashCode&lt;/code&gt; is:     &lt;li&gt;Whenever it is invoked on the same object more than once during an execution of a Java application, the hashCode method must consistently return the same integer, provided no information used in equals comparisons on the object is modified. This integer need not remain consistent from one execution of an application to another execution of the same application.&lt;/li&gt;&lt;li&gt;If two objects are equal according to the equals(Object) method, then calling the hashCode method on each of the two objects must produce the same integer result.&lt;/li&gt;&lt;li&gt;It is not required that if two objects are unequal according to the equals(java.lang.Object) method, then calling the hashCode method on each of the two objects must produce distinct integer results. However, the programmer should be aware that producing distinct integer results for unequal objects may improve the performance of hashtables.&lt;/li&gt;&lt;/ul&gt; As much as is reasonably practical, the hashCode method defined by class Object does return distinct integers for distinct objects. (This is typically implemented by converting the internal address of the object into an integer, but this implementation technique is not required by the Java&lt;sup&gt;TM&lt;/sup&gt; programming language.) &lt;/div&gt;&lt;br /&gt; As compared to the general contract specified by the &lt;code&gt;equals&lt;/code&gt; method, the contract specified by the &lt;code&gt;hashCode&lt;/code&gt; method is relatively simple and easy to understand. It simply states two important requirements that must be met while implementing the &lt;code&gt;hashCode&lt;/code&gt; method. The third point of the contract, in fact is the elaboration of the second point. Let's understand what this contract really means. &lt;ol&gt;&lt;li&gt;&lt;b&gt;Consistency during same execution - &lt;/b&gt;Firstly, it states that the hash code returned by the &lt;code&gt;hashCode&lt;/code&gt; method must be consistently the same for multiple invocations during the same execution of the application as long as the object is not modified to affect the &lt;code&gt;equals&lt;/code&gt; method.   &lt;/li&gt;&lt;li&gt;&lt;b&gt;Hash Code &amp;amp; Equals relationship - &lt;/b&gt;The second requirement of the contract is the &lt;code&gt;hashCode&lt;/code&gt; counterpart of the requirement specified by the &lt;code&gt;equals&lt;/code&gt; method. It simply emphasizes the same relationship - equal objects must produce the same hash code. However, the third point elaborates that unequal objects &lt;i&gt;need not&lt;/i&gt; produce distinct hash codes. &lt;/li&gt;&lt;/ol&gt; After reviewing the general contracts of these two methods, it is clear that the relationship between these two methods can be summed up in the following statement -&lt;br /&gt;&lt;br /&gt; &lt;div style="padding: 2px 5px; font-family: verdana; background-color: rgb(192, 192, 192);"&gt;&lt;b&gt;Equal objects must produce the same hash code as long as they are equal, however unequal objects need not produce distinct hash codes.&lt;/b&gt;&lt;/div&gt;&lt;br /&gt;The rest of the requirements specified in the contracts of these two methods are specific to those methods and are not directly related to the relationship between these two methods. Those specific requirements are discussed earlier. This relationship also enforces that whenever you override the &lt;code&gt;equals&lt;/code&gt; method, you must override the &lt;code&gt;hashCode&lt;/code&gt; method as well. Failing to comply with this requirement usually results in undetermined, undesired behavior of the class when confronted with Java collection classes or any other Java classes.&lt;br /&gt;&lt;br /&gt; &lt;div class="topic"&gt;Correct Implementation Example&lt;/div&gt;&lt;br /&gt; The following code exemplifies how all the requirements of &lt;code&gt;equals&lt;/code&gt; and &lt;code&gt;hashCode&lt;/code&gt; methods should be fulfilled so that the class behaves correctly and consistently with other Java classes. This class implements the &lt;code&gt;equals&lt;/code&gt; method in such a way that it only provides equality comparison for the objects of the same class, similar to built-in Java classes like String and other wrapper classes.&lt;br /&gt;&lt;br /&gt; &lt;div class="code"&gt; &lt;pre&gt;1. public class Test&lt;br /&gt;2. {&lt;br /&gt;3.  private int num;&lt;br /&gt;4.  private String data;&lt;br /&gt;5.&lt;br /&gt;6.  public boolean equals(Object obj)&lt;br /&gt;7.  {&lt;br /&gt;8.   if(this == obj)&lt;br /&gt;9.    return true;&lt;br /&gt;10.   if((obj == null) || (obj.getClass() != this.getClass()))&lt;br /&gt;11.    return false;&lt;br /&gt;12.   // object must be Test at this point&lt;br /&gt;13.   Test test = (Test)obj;&lt;br /&gt;14.   return num == test.num &amp;amp;&amp;amp;&lt;br /&gt;15.   (data == test.data || (data != null &amp;amp;&amp;amp; data.equals(test.data)));&lt;br /&gt;16.  }&lt;br /&gt;17.&lt;br /&gt;18.  public int hashCode()&lt;br /&gt;19.  {&lt;br /&gt;20.   int hash = 7;&lt;br /&gt;21.   hash = 31 * hash + num;&lt;br /&gt;22.   hash = 31 * hash + (null == data ? 0 : data.hashCode());&lt;br /&gt;23.   return hash;&lt;br /&gt;24.  }&lt;br /&gt;25.&lt;br /&gt;26.  // other methods&lt;br /&gt;27. }&lt;br /&gt;&lt;/pre&gt; &lt;/div&gt;&lt;br /&gt; Now, let's examine why this implementation is the correct implementation. The class Test has two member variables - &lt;code&gt;num&lt;/code&gt; and &lt;code&gt;data&lt;/code&gt;. These two variables define state of the object and they also participate in the &lt;code&gt;equals&lt;/code&gt; comparison for the objects of this class. Hence, they should also be involved in calculating the hash codes of this class objects.&lt;br /&gt;&lt;br /&gt; Consider the &lt;code&gt;equals&lt;/code&gt; method first. We can see that at line 8, the passed object reference is compared with &lt;code&gt;this&lt;/code&gt; object itself, this approach usually saves time if both the object references are referring to the same object on the heap and if the equals comparison is expensive. Next, the &lt;code&gt;if&lt;/code&gt; condition at line 10 first checks if the argument is &lt;code&gt;null&lt;/code&gt;, if not, then (due to the short-circuit nature of the OR &lt;code&gt;||&lt;/code&gt; operator) it checks if the argument is of type &lt;code&gt;Test&lt;/code&gt; by comparing the classes of the argument and this object. This is done by invoking the &lt;code&gt;getClass()&lt;/code&gt; method on both the references. If either of these conditions fails, then &lt;code&gt;false&lt;/code&gt; is returned. This is done by the following code -&lt;br /&gt;&lt;code style="color: rgb(0, 0, 240); margin-left: 30px;"&gt;if((obj == null) || (obj.getClass() != this.getClass())) return false;  &lt;b&gt;// prefer&lt;/b&gt;&lt;/code&gt;&lt;br /&gt;This conditional check should be preferred instead of the conditional check given by -&lt;br /&gt;&lt;code style="color: rgb(240, 0, 0); margin-left: 30px;"&gt;if(!(obj instanceof Test)) return false;  &lt;b&gt;// avoid&lt;/b&gt;&lt;/code&gt;&lt;br /&gt; This is because, the first condition (code in blue) ensures that it will return &lt;code&gt;false&lt;/code&gt; if the argument is a subclass of the class &lt;code&gt;Test&lt;/code&gt;. However, in case of the second condition (code in red) it fails. The &lt;code&gt;instanceof&lt;/code&gt; operator condition fails to return &lt;code&gt;false&lt;/code&gt; if the argument is a subclass of the class &lt;code&gt;Test&lt;/code&gt;. Thus, it might violate the symmetry requirement of the contract. The &lt;code&gt;instanceof&lt;/code&gt; check is correct only if the class is &lt;code&gt;final&lt;/code&gt;, so that no subclass would exist. The first condition will work for both, final and non-final classes. Note that, both these conditions will return &lt;code&gt;false&lt;/code&gt; if the argument is &lt;code&gt;null&lt;/code&gt;. The &lt;code&gt;instanceof&lt;/code&gt; operator returns &lt;code&gt;false&lt;/code&gt; if the left hand side (LHS) operand is &lt;code&gt;null&lt;/code&gt;, irrespective of the operand on the right hand side (RHS) as specified by &lt;a href="http://java.sun.com/docs/books/jls/second_edition/html/expressions.doc.html#80289" target="_blank"&gt;JLS 15.20.2&lt;/a&gt;. However, the first condition should be preferred for better type checking.&lt;br /&gt;&lt;br /&gt; This class implements the &lt;code&gt;equals&lt;/code&gt; method in such a way that it provides equals comparison only for the objects of the same class. Note that, this is not mandatory. But, if a class decides to provide equals comparison for other class objects, then the other class (or classes) must also agree to provide the same for this class so as to fulfill the symmetry and reflexivity requirements of the contract. This particular &lt;code&gt;equals&lt;/code&gt; method implementation does not violate both these requirements. The lines 14 and 15 actually perform the equality comparison for the data members, and return true if they are equal. Line 15 also ensures that invoking the &lt;code&gt;equals&lt;/code&gt; method on String variable &lt;code&gt;data&lt;/code&gt; will not result in a &lt;code&gt;NullPointerException&lt;/code&gt;.&lt;br /&gt; While implementing the &lt;code&gt;equals&lt;/code&gt; method, primitives can be compared directly with an equality operator (&lt;code&gt;==&lt;/code&gt;) after performing any necessary conversions (Such as float to &lt;code&gt;Float.floatToIntBits&lt;/code&gt; or double to &lt;code&gt;Double.doubleToLongBits&lt;/code&gt;). Whereas, object references can be compared by invoking their &lt;code&gt;equals&lt;/code&gt; method recursively. You also need to ensure that invoking the &lt;code&gt;equals&lt;/code&gt; method on these object references does not result in a &lt;code&gt;NullPointerException&lt;/code&gt;.&lt;br /&gt;&lt;br /&gt; Here are some useful guidelines for implementing the &lt;code&gt;equals&lt;/code&gt; method correctly.&lt;br /&gt; &lt;ol&gt;&lt;li&gt;Use the equality &lt;code&gt;==&lt;/code&gt; operator to check if the argument is the reference to this object, if yes. return true. This saves time when actual comparison is costly.&lt;/li&gt;&lt;li&gt;Use the following condition to check that the argument is not &lt;code&gt;null&lt;/code&gt; and it is of the correct type, if not then return &lt;code&gt;false&lt;/code&gt;.&lt;br /&gt;&lt;code style="margin-left: 30px;"&gt;if((obj == null) || (obj.getClass() != this.getClass())) return false;&lt;/code&gt;&lt;br /&gt;Note that, correct type does not mean the same type or class as shown in the example above. It could be any class or interface that one or more classes agree to implement for providing the comparison.&lt;/li&gt;&lt;li&gt;Cast the method argument to the correct type. Again, the correct type may not be the same class. Also, since this step is done after the above type-check condition, it will not result in a &lt;code&gt;ClassCastException&lt;/code&gt;.&lt;/li&gt;&lt;li&gt;Compare significant variables of both, the argument object and this object and check if they are equal. If *all* of them are equal then return true, otherwise return false. Again, as mentioned earlier, while comparing these class members/variables; primitive variables can be compared directly with an equality operator (&lt;code&gt;==&lt;/code&gt;) after performing any necessary conversions (Such as float to &lt;code&gt;Float.floatToIntBits&lt;/code&gt; or double to &lt;code&gt;Double.doubleToLongBits&lt;/code&gt;). Whereas, object references can be compared by invoking their &lt;code&gt;equals&lt;/code&gt; method recursively. You also need to ensure that invoking &lt;code&gt;equals&lt;/code&gt; method on these object references does not result in a &lt;code&gt;NullPointerException&lt;/code&gt;, as shown in the example above (Line 15).&lt;br /&gt;It is neither necessary, nor advisable to include those class members in this comparison which can be calculated from other variables, hence the word "significant variables". This certainly improves the performance of the &lt;code&gt;equals&lt;/code&gt; method. Only you can decide which class members are significant and which are not.&lt;/li&gt;&lt;li&gt;Do not change the type of the argument of the &lt;code&gt;equals&lt;/code&gt; method. It takes a &lt;code&gt;java.lang.Object&lt;/code&gt; as an argument, do not use your own class instead. If you do that, you will not be overriding the &lt;code&gt;equals&lt;/code&gt; method, but you will be overloading it instead; which would cause problems. It is a very common mistake, and since it does not result in a compile time error, it becomes quite difficult to figure out why the code is not working properly.&lt;/li&gt;&lt;li&gt;Review your &lt;code&gt;equals&lt;/code&gt; method to verify that it fulfills all the requirements stated by the general contract of the &lt;code&gt;equals&lt;/code&gt; method.&lt;/li&gt;&lt;li&gt;Lastly, do not forget to override the &lt;code&gt;hashCode&lt;/code&gt; method whenever you override the &lt;code&gt;equals&lt;/code&gt; method, that's unpardonable. ;)&lt;/li&gt;&lt;/ol&gt;  Now, let's examine the &lt;code&gt;hashCode&lt;/code&gt; method of this example. At line 20, a non-zero constant value 7 (arbitrary) is assigned to an int variable &lt;code&gt;hash&lt;/code&gt;. Since the class members/variables &lt;code&gt;num&lt;/code&gt; and &lt;code&gt;data&lt;/code&gt; do participate in the &lt;code&gt;equals&lt;/code&gt; method comparison, they should also be involved in the calculation of the hash code. Though, this is not mandatory. You can use subset of the variables that participate in the &lt;code&gt;equals&lt;/code&gt; method comparison to improve performance of the &lt;code&gt;hashCode&lt;/code&gt; method. Performance of the &lt;code&gt;hashCode&lt;/code&gt; method indeed is very important. But, you have to be very careful while selecting the subset. The subset should include those variables which are most likely to have the greatest diversity of the values. Sometimes, using all the variables that participate in the &lt;code&gt;equals&lt;/code&gt; method comparison for calculating the hash code makes more sense.&lt;br /&gt;This class uses both the variables for computing the hash code. Lines 21 and 22 calculate the hash code values based on these two variables. Line 22 also ensures that invoking &lt;code&gt;hashCode&lt;/code&gt; method on the variable &lt;code&gt;data&lt;/code&gt; does not result in a &lt;code&gt;NullPointerException&lt;/code&gt; if &lt;code&gt;data&lt;/code&gt; is &lt;code&gt;null&lt;/code&gt;. This implementation ensures that the general contract of the &lt;code&gt;hashCode&lt;/code&gt; method is not violated. This implementation will return consistent hash code values for different invocations and will also ensure that equal objects will have equal hash codes.&lt;br /&gt;While implementing the &lt;code&gt;hashCode&lt;/code&gt; method, primitives can be used directly in the calculation of the hash code value after performing any necessary conversions, such as float to &lt;code&gt;Float.floatToIntBits&lt;/code&gt; or double to &lt;code&gt;Double.doubleToLongBits&lt;/code&gt;. Since return type of the &lt;code&gt;hashCode&lt;/code&gt; method is &lt;code&gt;int&lt;/code&gt;, long values must to be converted to the integer values. As for hash codes of the object references, they should be calculated by invoking their &lt;code&gt;hashCode&lt;/code&gt; method recursively. You also need to ensure that invoking the &lt;code&gt;hashCode&lt;/code&gt; method on these object references does not result in a &lt;code&gt;NullPointerException&lt;/code&gt;.&lt;br /&gt;&lt;br /&gt; Writing a very good implementation of the &lt;code&gt;hashCode&lt;/code&gt; method which calculates hash code values such that the distribution is uniform is not a trivial task and may require inputs from mathematicians and theoretical computer scientist. Nevertheless, it is possible to write a decent and correct implementation by following few simple rules.&lt;br /&gt;&lt;br /&gt; Here are some useful guidelines for implementing the &lt;code&gt;hashCode&lt;/code&gt; method correctly.&lt;br /&gt; &lt;ol&gt;&lt;li&gt; Store an arbitrary non-zero constant integer value (say 7) in an &lt;code&gt;int&lt;/code&gt; variable, called &lt;code&gt;hash&lt;/code&gt;.&lt;/li&gt;&lt;li&gt;Involve significant variables of your object in the calculation of the hash code, all the variables that are part of equals comparison should be considered for this. Compute an individual hash code &lt;code&gt;int var_code&lt;/code&gt; for each variable &lt;code&gt;var&lt;/code&gt; as follows -   &lt;ol style="list-style-type: lower-alpha;"&gt;&lt;li&gt;If the variable&lt;code&gt;(var)&lt;/code&gt; is &lt;code&gt;byte, char, short&lt;/code&gt; or &lt;code&gt;int&lt;/code&gt;, then      &lt;code&gt;var_code = (int)var;&lt;/code&gt;&lt;/li&gt;&lt;li&gt;If the variable&lt;code&gt;(var)&lt;/code&gt; is &lt;code&gt;long&lt;/code&gt;, then &lt;code&gt;var_code = (int)(var ^ (var &gt;&gt;&gt; 32));&lt;/code&gt;&lt;/li&gt;&lt;li&gt;If the variable&lt;code&gt;(var)&lt;/code&gt; is &lt;code&gt;float&lt;/code&gt;, then &lt;code&gt;var_code = Float.floatToIntBits(var);&lt;/code&gt;&lt;/li&gt;&lt;li&gt;If the variable&lt;code&gt;(var)&lt;/code&gt; is &lt;code&gt;double&lt;/code&gt;, then -&lt;br /&gt;  &lt;code&gt;long bits = Double.doubleToLongBits(var);&lt;br /&gt;  var_code = (int)(bits ^  (bits &gt;&gt;&gt; 32));&lt;/code&gt;&lt;/li&gt;&lt;li&gt;If the variable&lt;code&gt;(var)&lt;/code&gt; is &lt;code&gt;boolean&lt;/code&gt;, then &lt;code&gt;var_code = var ? 1 : 0;&lt;/code&gt;&lt;/li&gt;&lt;li&gt;If the variable&lt;code&gt;(var)&lt;/code&gt; is an object reference, then check if it is &lt;code&gt;null&lt;/code&gt;, if yes then &lt;code&gt;var_code = 0;&lt;/code&gt; otherwise invoke the &lt;code&gt;hashCode&lt;/code&gt; method recursively on this object reference to get the hash code. This can be simplified and given as -&lt;br /&gt;&lt;code&gt;var_code = (null == var ? 0 : var.hashCode());&lt;/code&gt;&lt;/li&gt;&lt;/ol&gt;  &lt;/li&gt;&lt;li&gt;Combine this individual variable hash code &lt;code&gt;var_code&lt;/code&gt; in the original hash code &lt;code&gt;hash&lt;/code&gt; as follows -&lt;br /&gt;&lt;code&gt;hash = 31 * hash + var_code;&lt;/code&gt;&lt;/li&gt;&lt;li&gt;Follow these steps for all the significant variables and in the end return the resulting integer &lt;code&gt;hash&lt;/code&gt;.&lt;/li&gt;&lt;li&gt;Lastly, review your &lt;code&gt;hashCode&lt;/code&gt; method and check if it is returning equal hash codes for equal objects. Also, verify that the hash codes returned for the object are consistently the same for multiple invocations during the same execution.&lt;/li&gt;&lt;/ol&gt;  The guidelines provided here for implementing &lt;code&gt;equals&lt;/code&gt; and &lt;code&gt;hashCode&lt;/code&gt; methods are merely useful as guidelines, these are not absolute laws or rules. Nevertheless, following them while implementing these two methods will certainly give you correct and consistent results.&lt;br /&gt;&lt;br /&gt; &lt;div class="topic"&gt;Summary &amp;amp; Miscellaneous Tips&lt;/div&gt;&lt;br /&gt; &lt;ul&gt;&lt;li&gt;Equal objects must produce the same hash code as long as they are equal, however unequal objects need not produce distinct hash codes.&lt;/li&gt;&lt;li&gt;The &lt;code&gt;equals&lt;/code&gt; method provides "deep comparison" by checking if two objects are logically equal as opposed to the "shallow comparison" provided by the equality operator &lt;code&gt;==&lt;/code&gt;.&lt;/li&gt;&lt;li&gt;However, the &lt;code&gt;equals&lt;/code&gt; method in &lt;code&gt;java.lang.Object&lt;/code&gt; class only provides "shallow comparison", same as provided by the equality operator &lt;code&gt;==&lt;/code&gt;.&lt;/li&gt;&lt;li&gt;The &lt;code&gt;equals&lt;/code&gt; method only takes Java objects as an argument, and not primitives; passing primitives will result in a compile time error.&lt;/li&gt;&lt;li&gt;Passing objects of different types to the &lt;code&gt;equals&lt;/code&gt; method will never result in a compile time error or runtime error.&lt;/li&gt;&lt;li&gt;For standard Java wrapper classes and for &lt;code&gt;java.lang.String&lt;/code&gt;, if the &lt;code&gt;equals&lt;/code&gt; argument type (class) is different from the type of the object on which the &lt;code&gt;equals&lt;/code&gt; method is invoked, it will return false.&lt;/li&gt;&lt;li&gt;The class &lt;code&gt;java.lang.StringBuffer&lt;/code&gt; does not override the &lt;code&gt;equals&lt;/code&gt; method, and hence it inherits the implementation from &lt;code&gt;java.lang.Object&lt;/code&gt; class.&lt;/li&gt;&lt;li&gt;The &lt;code&gt;equals&lt;/code&gt; method must not provide equality comparison with any built in Java class, as it would result in the violation of the symmetry requirement stated in the general contract of the &lt;code&gt;equals&lt;/code&gt; method.&lt;/li&gt;&lt;li&gt;If &lt;code&gt;null&lt;/code&gt; is passed as an argument to the &lt;code&gt;equals&lt;/code&gt; method, it will return false.&lt;/li&gt;&lt;li&gt;Equal hash codes do not imply that the objects are equal.&lt;/li&gt;&lt;li&gt;&lt;code&gt;return 1;&lt;/code&gt; is a legal implementation of the &lt;code&gt;hashCode&lt;/code&gt; method, however it is a very bad implementation. It is legal because it ensures that equal objects will have equal hash codes, it also ensures that the hash code returned will be consistent for multiple invocations during the same execution. Thus, it does not violate the general contract of the &lt;code&gt;hashCode&lt;/code&gt; method. It is a bad implementation because it returns &lt;i&gt;same&lt;/i&gt; hash code for all the objects. This explanation applies to all implementations of the &lt;code&gt;hashCode&lt;/code&gt; method which return same constant integer value for all the objects.&lt;/li&gt;&lt;li&gt;In standard JDK 1.4, the wrapper classes &lt;code&gt;java.lang.Short, java.lang.Byte, java.lang.Character&lt;/code&gt; and &lt;code&gt;java.lang.Integer&lt;/code&gt; simply return the value they represent as the hash code by typecasting it to an &lt;code&gt;int&lt;/code&gt;.&lt;/li&gt;&lt;li&gt;Since JDK version 1.3, the class &lt;code&gt;java.lang.String&lt;/code&gt; caches its hash code, i.e. it calculates the hash code only once and stores it in an instance variable and returns this value whenever the &lt;code&gt;hashCode&lt;/code&gt; method is called. It is legal because &lt;code&gt;java.lang.String&lt;/code&gt; represents an immutable string.&lt;/li&gt;&lt;li&gt;It is incorrect to involve a random number directly while computing the hash code of the class object, as it would not consistently return the same hash code for multiple invocations during the same execution.&lt;/li&gt;&lt;/ul&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3053352583694970340-5600670721918479945?l=itgeekhelp.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://itgeekhelp.blogspot.com/feeds/5600670721918479945/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://itgeekhelp.blogspot.com/2009/03/junit-testing.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3053352583694970340/posts/default/5600670721918479945'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3053352583694970340/posts/default/5600670721918479945'/><link rel='alternate' type='text/html' href='http://itgeekhelp.blogspot.com/2009/03/junit-testing.html' title='JUNIT Testing'/><author><name>Pedric Kng Aka Boon</name><uri>http://www.blogger.com/profile/07979744237794291200</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3053352583694970340.post-5758376116981167512</id><published>2008-12-23T22:14:00.000-08:00</published><updated>2008-12-23T22:17:20.862-08:00</updated><title type='text'>ext library Glassfish and netbeans deployment</title><content type='html'>Ext application library used is contained in this folder &lt;glassfish&gt;/domains/&lt;domainnum&gt;/lib/applibs&lt;br /&gt;-Using netbeans to deploy, the application library would also be contained in the war file, therefore the library should not be in glassfish lib folder to prevent confusion.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3053352583694970340-5758376116981167512?l=itgeekhelp.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://itgeekhelp.blogspot.com/feeds/5758376116981167512/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://itgeekhelp.blogspot.com/2008/12/ext-library-glassfish-and-netbeans.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3053352583694970340/posts/default/5758376116981167512'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3053352583694970340/posts/default/5758376116981167512'/><link rel='alternate' type='text/html' href='http://itgeekhelp.blogspot.com/2008/12/ext-library-glassfish-and-netbeans.html' title='ext library Glassfish and netbeans deployment'/><author><name>Pedric Kng Aka Boon</name><uri>http://www.blogger.com/profile/07979744237794291200</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3053352583694970340.post-6854034580160801134</id><published>2008-12-22T22:45:00.000-08:00</published><updated>2008-12-23T00:44:25.213-08:00</updated><title type='text'>setup mysql in glassfish</title><content type='html'>1) Copy mysql-connector-java-[version].jar to &lt;glassfish&gt;/domain/&lt;domainnum&gt;/lib&lt;br /&gt;2) GlassfishAdmin:4848&gt;Resources&gt;JDBC/connection Pools/ New JDBC Connection Pool&lt;br /&gt;-Name: &lt;__mysqlpool&gt;&lt;br /&gt;-ResourceType:&lt;javax.sql.datasource&gt;&lt;br /&gt;-DatabaseVendor:&lt;mysql&gt;&lt;br /&gt;&lt;br /&gt;Click next&gt; Additional Properties&lt;br /&gt;&lt;br /&gt;Setup 5 parameters below:&lt;br /&gt;-databaseName:&lt;dbsample&gt;&lt;br /&gt;-user:&lt;usrsample&gt;&lt;br /&gt;-password:&lt;pswd&gt;&lt;br /&gt;-serverName:&lt;localhost&gt;&lt;br /&gt;-portNumber:&lt;3306&gt;&lt;br /&gt;&lt;br /&gt;Click Finish. Try ping the connection pool.&lt;br /&gt;&lt;br /&gt;3)Goto Resources/JDBC/JDBC Resources Click New.&lt;br /&gt;-JNDI Name:&lt;jdbc/mysqlpool&gt;&lt;br /&gt;-Pool Name: &lt;__mysqlpool&gt;&lt;br /&gt;-status: &lt;enabled&gt;&lt;br /&gt;Create New.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3053352583694970340-6854034580160801134?l=itgeekhelp.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://itgeekhelp.blogspot.com/feeds/6854034580160801134/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://itgeekhelp.blogspot.com/2008/12/setup-mysql-in-glassfish.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3053352583694970340/posts/default/6854034580160801134'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3053352583694970340/posts/default/6854034580160801134'/><link rel='alternate' type='text/html' href='http://itgeekhelp.blogspot.com/2008/12/setup-mysql-in-glassfish.html' title='setup mysql in glassfish'/><author><name>Pedric Kng Aka Boon</name><uri>http://www.blogger.com/profile/07979744237794291200</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3053352583694970340.post-2891556000803447922</id><published>2008-12-22T18:30:00.000-08:00</published><updated>2010-04-01T02:23:49.324-07:00</updated><title type='text'>import/export mysql database between window and linux</title><content type='html'>C: &gt; mysqldump -u&lt;username&gt; -p&lt;password&gt; database_name &gt;  /path/to/filename.sql&lt;br /&gt;&lt;br /&gt;This should create filename.sql which you can then run on the Linux machine as follows:&lt;br /&gt;&lt;br /&gt;Start the mysql client and then, at the mysql prompt:&lt;br /&gt;&lt;br /&gt;mysql&gt; CREATE DATABASE database_name;&lt;br /&gt;&lt;br /&gt;mysql&gt; USE database_name;&lt;br /&gt;&lt;br /&gt;mysql&gt; source /path/to/filename.sql&lt;br /&gt;&lt;br /&gt;This should execute filename.sql which will recreate the database.&lt;/password&gt;&lt;/username&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3053352583694970340-2891556000803447922?l=itgeekhelp.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://itgeekhelp.blogspot.com/feeds/2891556000803447922/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://itgeekhelp.blogspot.com/2008/12/importexport-mysql-database-between.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3053352583694970340/posts/default/2891556000803447922'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3053352583694970340/posts/default/2891556000803447922'/><link rel='alternate' type='text/html' href='http://itgeekhelp.blogspot.com/2008/12/importexport-mysql-database-between.html' title='import/export mysql database between window and linux'/><author><name>Pedric Kng Aka Boon</name><uri>http://www.blogger.com/profile/07979744237794291200</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3053352583694970340.post-8618892129064657469</id><published>2008-12-18T18:00:00.000-08:00</published><updated>2008-12-18T18:25:22.368-08:00</updated><title type='text'>Glassfish commands</title><content type='html'>find / -name mysql&lt;br /&gt;&lt;br /&gt;./asadmin start-domain domain1&lt;br /&gt;&lt;br /&gt;./asadmin create-domain --portbase 1000 domain2&lt;br /&gt;Using port 1048 for Admin.&lt;br /&gt;Using port 1080 for HTTP Instance.&lt;br /&gt;Using port 1076 for JMS.&lt;br /&gt;Using port 1037 for IIOP.&lt;br /&gt;Using port 1081 for HTTP_SSL.&lt;br /&gt;Using port 1038 for IIOP_SSL.&lt;br /&gt;Using port 1039 for IIOP_MUTUALAUTH.&lt;br /&gt;Using port 1086 for JMX_ADMIN.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3053352583694970340-8618892129064657469?l=itgeekhelp.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://itgeekhelp.blogspot.com/feeds/8618892129064657469/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://itgeekhelp.blogspot.com/2008/12/glassfish-commands.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3053352583694970340/posts/default/8618892129064657469'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3053352583694970340/posts/default/8618892129064657469'/><link rel='alternate' type='text/html' href='http://itgeekhelp.blogspot.com/2008/12/glassfish-commands.html' title='Glassfish commands'/><author><name>Pedric Kng Aka Boon</name><uri>http://www.blogger.com/profile/07979744237794291200</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3053352583694970340.post-6953518272680917575</id><published>2008-12-18T01:03:00.001-08:00</published><updated>2009-03-17T02:51:41.497-07:00</updated><title type='text'>install/uninstall mysql on fedora</title><content type='html'>&lt;p&gt;Installations created from MySQL AB's Linux RPM distributions result in files  under the following system directories: &lt;/p&gt; &lt;div class="informaltable"&gt; &lt;table border="1"&gt; &lt;colgroup&gt; &lt;col&gt; &lt;col&gt;&lt;/colgroup&gt; &lt;tbody&gt; &lt;tr&gt; &lt;td&gt;&lt;span class="bold"&gt;&lt;strong&gt;Directory&lt;/strong&gt;&lt;/span&gt;&lt;/td&gt; &lt;td&gt;&lt;span class="bold"&gt;&lt;strong&gt;Contents of Directory&lt;/strong&gt;&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td&gt;&lt;code class="filename"&gt;/usr/bin&lt;/code&gt;&lt;/td&gt; &lt;td&gt;Client programs and scripts&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td&gt;&lt;code class="filename"&gt;/usr/sbin&lt;/code&gt;&lt;/td&gt; &lt;td&gt;The &lt;span&gt;&lt;strong class="command"&gt;mysqld&lt;/strong&gt;&lt;/span&gt; server&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td&gt;&lt;code class="filename"&gt;/var/lib/mysql&lt;/code&gt;&lt;/td&gt; &lt;td&gt;Log files, databases&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td&gt;&lt;code class="filename"&gt;/usr/share/info&lt;/code&gt;&lt;/td&gt; &lt;td&gt;Manual in Info format&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td&gt;&lt;code class="filename"&gt;/usr/share/man&lt;/code&gt;&lt;/td&gt; &lt;td&gt;Unix manual pages&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td&gt;&lt;code class="filename"&gt;/usr/include/mysql&lt;/code&gt;&lt;/td&gt; &lt;td&gt;Include (header) files&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td&gt;&lt;code class="filename"&gt;/usr/lib/mysql&lt;/code&gt;&lt;/td&gt; &lt;td&gt;Libraries&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td&gt;&lt;code class="filename"&gt;/usr/share/mysql&lt;/code&gt;&lt;/td&gt; &lt;td&gt;Error message and character set files&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td&gt;&lt;code class="filename"&gt;/usr/share/sql-bench&lt;/code&gt;&lt;/td&gt; &lt;td&gt;Benchmarks&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;h2 class="contentheading"&gt;Applicable to &lt;b style="color: black; background-color: rgb(255, 255, 102);"&gt;Fedora&lt;/b&gt; Versions&lt;/h2&gt; &lt;ul&gt;&lt;li&gt;&lt;strong&gt;&lt;b style="color: black; background-color: rgb(255, 255, 102);"&gt;Fedora&lt;/b&gt; 6, 7, 8, 9&lt;/strong&gt;&lt;/li&gt;&lt;li&gt;&lt;strong&gt;CentOS 4, 4.5, 5, 5.1&lt;/strong&gt;&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt; &lt;h2 class="heading"&gt;Requirements&lt;/h2&gt; &lt;div&gt; &lt;ol start="1"&gt;&lt;li&gt;Login to a terminal as root using one of these options: (&lt;strong&gt;su --login&lt;/strong&gt; | &lt;strong&gt;su -l&lt;/strong&gt; | or: &lt;strong&gt;su -&lt;/strong&gt;)&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Yum must also be installed and functional&lt;br /&gt;&lt;/li&gt;&lt;/ol&gt; &lt;/div&gt; &lt;h2 class="Heading"&gt;Doing the Work&lt;/h2&gt; &lt;div class="contentheading"&gt; &lt;ol start="1"&gt;&lt;li&gt;&lt;b style="color: black; background-color: rgb(160, 255, 255);"&gt;Install&lt;/b&gt; &lt;b style="color: black; background-color: rgb(153, 255, 153);"&gt;mysql&lt;/b&gt; &lt;b style="color: black; background-color: rgb(153, 255, 153);"&gt;mysql&lt;/b&gt;-server:&lt;/li&gt;&lt;pre&gt;# yum &lt;b style="color: black; background-color: rgb(160, 255, 255);"&gt;install&lt;/b&gt; &lt;b style="color: black; background-color: rgb(153, 255, 153);"&gt;mysql&lt;/b&gt; &lt;b style="color: black; background-color: rgb(153, 255, 153);"&gt;mysql&lt;/b&gt;-server&lt;br /&gt;Loading "priorities" plugin&lt;br /&gt;Loading "changelog" plugin&lt;br /&gt;Loading "fastestmirror" plugin&lt;br /&gt;Loading "allowdowngrade" plugin&lt;br /&gt;Loading "kernel-module" plugin&lt;br /&gt;Loading "fedorakmod" plugin&lt;br /&gt;Loading "installonlyn" plugin&lt;br /&gt;Loading "protectbase" plugin&lt;br /&gt;Setting up &lt;b style="color: black; background-color: rgb(160, 255, 255);"&gt;Install&lt;/b&gt; Process&lt;br /&gt;Setting up repositories&lt;br /&gt;livna                     100% |=========================| 1.1 kB    00:00 &lt;br /&gt;updates                   100% |=========================| 1.2 kB    00:00 &lt;br /&gt;core                      100% |=========================| 1.1 kB    00:00 &lt;br /&gt;extras                    100% |=========================| 1.1 kB    00:00 &lt;br /&gt;Loading mirror speeds from cached hostfile&lt;br /&gt;Reading repository metadata in from local files&lt;br /&gt;primary.xml.gz            100% |=========================| 1.8 MB    00:06 &lt;br /&gt;extras    : ################################################## 5594/5594&lt;br /&gt;0 packages excluded due to repository priority protections&lt;br /&gt;0 packages excluded due to repository protections&lt;br /&gt;Parsing package &lt;b style="color: black; background-color: rgb(160, 255, 255);"&gt;install&lt;/b&gt; arguments&lt;br /&gt;Resolving Dependencies&lt;br /&gt;--&gt; Populating transaction set with selected packages. Please wait.&lt;br /&gt;---&gt; Downloading header for &lt;b style="color: black; background-color: rgb(153, 255, 153);"&gt;mysql&lt;/b&gt; to pack into transaction set.&lt;br /&gt;&lt;b style="color: black; background-color: rgb(153, 255, 153);"&gt;mysql&lt;/b&gt;-5.0.27-1.fc6.i386.r 100% |=========================|  36 kB    00:00 &lt;br /&gt;---&gt; Package &lt;b style="color: black; background-color: rgb(153, 255, 153);"&gt;mysql&lt;/b&gt;.i386 0:5.0.27-1.fc6 set to be updated&lt;br /&gt;---&gt; Downloading header for &lt;b style="color: black; background-color: rgb(153, 255, 153);"&gt;mysql&lt;/b&gt;-server to pack into transaction set.&lt;br /&gt;&lt;b style="color: black; background-color: rgb(153, 255, 153);"&gt;mysql&lt;/b&gt;-server-5.0.27-1.fc6 100% |=========================|  33 kB    00:00 &lt;br /&gt;---&gt; Package &lt;b style="color: black; background-color: rgb(153, 255, 153);"&gt;mysql&lt;/b&gt;-server.x86_64 0:5.0.27-1.fc6 set to be updated&lt;br /&gt;---&gt; Downloading header for &lt;b style="color: black; background-color: rgb(153, 255, 153);"&gt;mysql&lt;/b&gt; to pack into transaction set.&lt;br /&gt;&lt;b style="color: black; background-color: rgb(153, 255, 153);"&gt;mysql&lt;/b&gt;-5.0.27-1.fc6.x86_64 100% |=========================|  36 kB    00:00 &lt;br /&gt;---&gt; Package &lt;b style="color: black; background-color: rgb(153, 255, 153);"&gt;mysql&lt;/b&gt;.x86_64 0:5.0.27-1.fc6 set to be updated&lt;br /&gt;--&gt; Running transaction check&lt;br /&gt;--&gt; Processing Dependency: perl-DBI for package: &lt;b style="color: black; background-color: rgb(153, 255, 153);"&gt;mysql&lt;/b&gt;-server&lt;br /&gt;--&gt; Processing Dependency: perl(DBI) for package: &lt;b style="color: black; background-color: rgb(153, 255, 153);"&gt;mysql&lt;/b&gt;&lt;br /&gt;--&gt; Processing Dependency: perl(DBI) for package: &lt;b style="color: black; background-color: rgb(153, 255, 153);"&gt;mysql&lt;/b&gt;-server&lt;br /&gt;--&gt; Processing Dependency: perl-DBD-&lt;b style="color: black; background-color: rgb(153, 255, 153);"&gt;MySQL&lt;/b&gt; for package: &lt;b style="color: black; background-color: rgb(153, 255, 153);"&gt;mysql&lt;/b&gt;-server&lt;br /&gt;--&gt; Restarting Dependency Resolution with new changes.&lt;br /&gt;--&gt; Populating transaction set with selected packages. Please wait.&lt;br /&gt;---&gt; Downloading header for perl-DBI to pack into transaction set.&lt;br /&gt;perl-DBI-1.52-1.fc6.x86_6 100% |=========================|  16 kB    00:00 &lt;br /&gt;---&gt; Package perl-DBI.x86_64 0:1.52-1.fc6 set to be updated&lt;br /&gt;---&gt; Downloading header for perl-DBD-&lt;b style="color: black; background-color: rgb(153, 255, 153);"&gt;MySQL&lt;/b&gt; to pack into transaction set.&lt;br /&gt;perl-DBD-&lt;b style="color: black; background-color: rgb(153, 255, 153);"&gt;MySQL&lt;/b&gt;-3.0007-1.f 100% |=========================| 8.5 kB    00:00 &lt;br /&gt;---&gt; Package perl-DBD-&lt;b style="color: black; background-color: rgb(153, 255, 153);"&gt;MySQL&lt;/b&gt;.x86_64 0:3.0007-1.fc6 set to be updated&lt;br /&gt;--&gt; Running transaction check&lt;br /&gt;&lt;br /&gt;Dependencies Resolved&lt;br /&gt;&lt;br /&gt;=============================================================================&lt;br /&gt;Package                 Arch       Version          Repository        Size&lt;br /&gt;=============================================================================&lt;br /&gt;Installing:&lt;br /&gt;&lt;b style="color: black; background-color: rgb(153, 255, 153);"&gt;mysql&lt;/b&gt;                   i386       5.0.27-1.fc6     updates           3.3 M&lt;br /&gt;&lt;b style="color: black; background-color: rgb(153, 255, 153);"&gt;mysql&lt;/b&gt;                   x86_64     5.0.27-1.fc6     updates           3.3 M&lt;br /&gt;&lt;b style="color: black; background-color: rgb(153, 255, 153);"&gt;mysql&lt;/b&gt;-server            x86_64     5.0.27-1.fc6     updates            10 M&lt;br /&gt;Installing for dependencies:&lt;br /&gt;perl-DBD-&lt;b style="color: black; background-color: rgb(153, 255, 153);"&gt;MySQL&lt;/b&gt;          x86_64     3.0007-1.fc6     core              147 k&lt;br /&gt;perl-DBI                x86_64     1.52-1.fc6       core              605 k&lt;br /&gt;&lt;br /&gt;Transaction Summary&lt;br /&gt;=============================================================================&lt;br /&gt;&lt;b style="color: black; background-color: rgb(160, 255, 255);"&gt;Install&lt;/b&gt;      5 Package(s)     &lt;br /&gt;Update       0 Package(s)     &lt;br /&gt;Remove       0 Package(s)     &lt;br /&gt;&lt;br /&gt;Total download size: 18 M&lt;br /&gt;Is this ok [y/N]:&lt;/pre&gt;&lt;li&gt;Start &lt;b style="color: black; background-color: rgb(153, 255, 153);"&gt;MySQL&lt;/b&gt; server daemon (mysqld):&lt;/li&gt;&lt;pre&gt;# chkconfig --level 2345 mysqld on; service mysqld start&lt;br /&gt;Initializing &lt;b style="color: black; background-color: rgb(153, 255, 153);"&gt;MySQL&lt;/b&gt; database:  Installing all prepared tables&lt;br /&gt;Fill help tables&lt;br /&gt;&lt;br /&gt;To start mysqld at boot time you have to copy support-files/&lt;b style="color: black; background-color: rgb(153, 255, 153);"&gt;mysql&lt;/b&gt;.server&lt;br /&gt;to the right place for your system&lt;br /&gt;&lt;br /&gt;PLEASE REMEMBER TO SET A PASSWORD FOR THE &lt;b style="color: black; background-color: rgb(153, 255, 153);"&gt;MySQL&lt;/b&gt; root USER !&lt;br /&gt;To do so, start the server, then issue the following commands:&lt;br /&gt;/usr/bin/mysqladmin -u root password 'new-password'&lt;br /&gt;/usr/bin/mysqladmin -u root -h angstrom password 'new-password'&lt;br /&gt;See the manual for more instructions.&lt;br /&gt;&lt;br /&gt;You can start the &lt;b style="color: black; background-color: rgb(153, 255, 153);"&gt;MySQL&lt;/b&gt; daemon with:&lt;br /&gt;cd /usr ; /usr/bin/mysqld_safe &amp;amp;&lt;br /&gt;&lt;br /&gt;You can test the &lt;b style="color: black; background-color: rgb(153, 255, 153);"&gt;MySQL&lt;/b&gt; daemon with the benchmarks in the 'sql-bench' directory:&lt;br /&gt;cd sql-bench ; perl run-all-tests&lt;br /&gt;&lt;br /&gt;Please report any problems with the /usr/bin/mysqlbug script!&lt;br /&gt;&lt;br /&gt;The latest information about &lt;b style="color: black; background-color: rgb(153, 255, 153);"&gt;MySQL&lt;/b&gt; is available on the web at&lt;br /&gt;http://www.&lt;b style="color: black; background-color: rgb(153, 255, 153);"&gt;mysql&lt;/b&gt;.com&lt;br /&gt;Support &lt;b style="color: black; background-color: rgb(153, 255, 153);"&gt;MySQL&lt;/b&gt; by buying support/licenses at http://shop.&lt;b style="color: black; background-color: rgb(153, 255, 153);"&gt;mysql&lt;/b&gt;.com&lt;br /&gt;                                                       [  OK  ]&lt;br /&gt;Starting &lt;b style="color: black; background-color: rgb(153, 255, 153);"&gt;MySQL&lt;/b&gt;:                                            [  OK  ]&lt;/pre&gt;&lt;li&gt;Login as root database admin to &lt;b style="color: black; background-color: rgb(153, 255, 153);"&gt;MySQL&lt;/b&gt; server:&lt;/li&gt;&lt;pre&gt;# &lt;b style="color: black; background-color: rgb(153, 255, 153);"&gt;mysql&lt;/b&gt; -u root&lt;br /&gt;Welcome to the &lt;b style="color: black; background-color: rgb(153, 255, 153);"&gt;MySQL&lt;/b&gt; monitor.  Commands end with ; or \g.&lt;br /&gt;Your &lt;b style="color: black; background-color: rgb(153, 255, 153);"&gt;MySQL&lt;/b&gt; connection id is 2 to server version: 5.0.27&lt;br /&gt;&lt;br /&gt;Type 'help;' or '\h' for help. Type '\c' to clear the buffer.&lt;br /&gt;&lt;br /&gt;&lt;b style="color: black; background-color: rgb(153, 255, 153);"&gt;mysql&lt;/b&gt;&gt;&lt;/pre&gt;&lt;li&gt;Delete ALL users who are &lt;em&gt;&lt;strong&gt;not&lt;/strong&gt;&lt;/em&gt; root:&lt;/li&gt;&lt;pre&gt;&lt;b style="color: black; background-color: rgb(153, 255, 153);"&gt;mysql&lt;/b&gt;&gt; delete from &lt;b style="color: black; background-color: rgb(153, 255, 153);"&gt;mysql&lt;/b&gt;.user where not (host="localhost" and user="root");&lt;br /&gt;Query OK, 5 rows affected (0.15 sec)&lt;br /&gt;&lt;br /&gt;&lt;b style="color: black; background-color: rgb(153, 255, 153);"&gt;mysql&lt;/b&gt;&gt; FLUSH PRIVILEGES;&lt;br /&gt;Query OK, 0 rows affected (0.00 sec)&lt;br /&gt;&lt;br /&gt;&lt;b style="color: black; background-color: rgb(153, 255, 153);"&gt;mysql&lt;/b&gt;&gt;&lt;br /&gt;&lt;/pre&gt;&lt;li&gt;Change root database admin password: (&lt;em&gt;note:&lt;/em&gt; once this step is complete you'll need to login with: &lt;b style="color: black; background-color: rgb(153, 255, 153);"&gt;mysql&lt;/b&gt; -p -u root)&lt;br /&gt;&lt;/li&gt;&lt;pre&gt;&lt;b style="color: black; background-color: rgb(153, 255, 153);"&gt;mysql&lt;/b&gt;&gt; SET PASSWORD FOR 'root'@'localhost' = PASSWORD('mypass');&lt;br /&gt;Query OK, 0 rows affected (0.00 sec)&lt;br /&gt;&lt;br /&gt;&lt;b style="color: black; background-color: rgb(153, 255, 153);"&gt;mysql&lt;/b&gt;&gt; FLUSH PRIVILEGES;&lt;br /&gt;Query OK, 0 rows affected (0.00 sec)&lt;br /&gt;&lt;br /&gt;&lt;b style="color: black; background-color: rgb(153, 255, 153);"&gt;mysql&lt;/b&gt;&gt;&lt;/pre&gt;&lt;li&gt;Change root username to something less guessable for higher security.&lt;br /&gt;&lt;/li&gt;&lt;pre&gt;&lt;b style="color: black; background-color: rgb(153, 255, 153);"&gt;mysql&lt;/b&gt;&gt; update &lt;b style="color: black; background-color: rgb(153, 255, 153);"&gt;mysql&lt;/b&gt;.user set user="mydbadmin" where user="root";&lt;br /&gt;Query OK, 2 rows affected (0.00 sec)&lt;br /&gt;Rows matched: 2  Changed: 2  Warnings: 0&lt;br /&gt;&lt;br /&gt;&lt;b style="color: black; background-color: rgb(153, 255, 153);"&gt;mysql&lt;/b&gt;&gt; FLUSH PRIVILEGES;&lt;br /&gt;Query OK, 0 rows affected (0.00 sec)&lt;br /&gt;&lt;br /&gt;&lt;b style="color: black; background-color: rgb(153, 255, 153);"&gt;mysql&lt;/b&gt;&gt;&lt;/pre&gt;&lt;li&gt;Remove anonymous access to the database(s):&lt;/li&gt;&lt;pre&gt;&lt;b style="color: black; background-color: rgb(153, 255, 153);"&gt;mysql&lt;/b&gt;&gt; DELETE FROM &lt;b style="color: black; background-color: rgb(153, 255, 153);"&gt;mysql&lt;/b&gt;.user WHERE User = '';&lt;br /&gt;Query OK, 2 rows affected (0.00 sec)&lt;br /&gt;&lt;br /&gt;&lt;b style="color: black; background-color: rgb(153, 255, 153);"&gt;mysql&lt;/b&gt;&gt; FLUSH PRIVILEGES;&lt;br /&gt;Query OK, 0 rows affected (0.00 sec)&lt;br /&gt;&lt;br /&gt;&lt;b style="color: black; background-color: rgb(153, 255, 153);"&gt;mysql&lt;/b&gt;&gt;&lt;/pre&gt;&lt;li&gt;Add a new user with database admin privs for all databases:&lt;/li&gt;&lt;pre&gt;&lt;b style="color: black; background-color: rgb(153, 255, 153);"&gt;mysql&lt;/b&gt;&gt; GRANT ALL PRIVILEGES ON *.* TO 'warren'@'localhost' IDENTIFIED BY 'mypass' WITH GRANT OPTION;&lt;br /&gt;Query OK, 0 rows affected (0.00 sec)&lt;br /&gt;&lt;br /&gt;&lt;b style="color: black; background-color: rgb(153, 255, 153);"&gt;mysql&lt;/b&gt;&gt; FLUSH PRIVILEGES;&lt;br /&gt;Query OK, 0 rows affected (0.00 sec)&lt;br /&gt;&lt;br /&gt;&lt;b style="color: black; background-color: rgb(153, 255, 153);"&gt;mysql&lt;/b&gt;&gt;&lt;br /&gt;&lt;/pre&gt;&lt;li&gt;Add a new user with database admin privs for a specific database, in this case the database is called "bugzilla": (&lt;em&gt;note:&lt;/em&gt; The 'bugzilla' database must first be added, see below.)&lt;br /&gt;&lt;/li&gt;&lt;pre&gt;&lt;b style="color: black; background-color: rgb(153, 255, 153);"&gt;mysql&lt;/b&gt;&gt; GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, INDEX, ALTER, CREATE TEMPORARY TABLES, LOCK TABLES ON bugzilla.* TO 'warren'@'localhost' IDENTIFIED BY 'mypass';&lt;br /&gt;Query OK, 0 rows affected (0.00 sec)&lt;br /&gt;&lt;br /&gt;&lt;b style="color: black; background-color: rgb(153, 255, 153);"&gt;mysql&lt;/b&gt;&gt; FLUSH PRIVILEGES;&lt;br /&gt;Query OK, 0 rows affected (0.00 sec)&lt;br /&gt;&lt;br /&gt;&lt;b style="color: black; background-color: rgb(153, 255, 153);"&gt;mysql&lt;/b&gt;&gt;&lt;br /&gt;&lt;/pre&gt;&lt;li&gt;Add a &lt;b style="color: black; background-color: rgb(153, 255, 153);"&gt;MySQL&lt;/b&gt; database:&lt;/li&gt;&lt;pre&gt;&lt;b style="color: black; background-color: rgb(153, 255, 153);"&gt;mysql&lt;/b&gt;&gt; create database bugzilla;&lt;br /&gt;Query OK, 1 row affected (0.15 sec)&lt;br /&gt;&lt;br /&gt;&lt;b style="color: black; background-color: rgb(153, 255, 153);"&gt;mysql&lt;/b&gt;&gt; FLUSH PRIVILEGES;&lt;br /&gt;Query OK, 0 rows affected (0.00 sec)&lt;br /&gt;&lt;br /&gt;&lt;b style="color: black; background-color: rgb(153, 255, 153);"&gt;mysql&lt;/b&gt;&gt; quit&lt;br /&gt;Bye&lt;/pre&gt;&lt;li&gt;Installing &lt;b style="color: black; background-color: rgb(153, 255, 153);"&gt;mysql&lt;/b&gt;-administrator (&lt;em&gt;note:&lt;/em&gt; This tool can be found in the gnome main menu under 'System &lt;b style="color: black; background-color: rgb(255, 102, 255);"&gt;Tools&lt;/b&gt;' once installed):&lt;/li&gt;&lt;pre&gt;# yum &lt;b style="color: black; background-color: rgb(160, 255, 255);"&gt;install&lt;/b&gt; &lt;b style="color: black; background-color: rgb(153, 255, 153);"&gt;mysql&lt;/b&gt;-administrator&lt;br /&gt;Loading "priorities" plugin&lt;br /&gt;Loading "changelog" plugin&lt;br /&gt;Loading "fastestmirror" plugin&lt;br /&gt;Loading "allowdowngrade" plugin&lt;br /&gt;Loading "kernel-module" plugin&lt;br /&gt;Loading "fedorakmod" plugin&lt;br /&gt;Loading "installonlyn" plugin&lt;br /&gt;Loading "protectbase" plugin&lt;br /&gt;Setting up &lt;b style="color: black; background-color: rgb(160, 255, 255);"&gt;Install&lt;/b&gt; Process&lt;br /&gt;Setting up repositories&lt;br /&gt;Loading mirror speeds from cached hostfile&lt;br /&gt;Reading repository metadata in from local files&lt;br /&gt;0 packages excluded due to repository priority protections&lt;br /&gt;0 packages excluded due to repository protections&lt;br /&gt;Parsing package &lt;b style="color: black; background-color: rgb(160, 255, 255);"&gt;install&lt;/b&gt; arguments&lt;br /&gt;Resolving Dependencies&lt;br /&gt;--&gt; Populating transaction set with selected packages. Please wait.&lt;br /&gt;---&gt; Downloading header for &lt;b style="color: black; background-color: rgb(153, 255, 153);"&gt;mysql&lt;/b&gt;-administrator to pack into transaction set.&lt;br /&gt;&lt;b style="color: black; background-color: rgb(153, 255, 153);"&gt;mysql&lt;/b&gt;-administrator-1.1.1 100% |=========================|  25 kB    00:00 &lt;br /&gt;---&gt; Package &lt;b style="color: black; background-color: rgb(153, 255, 153);"&gt;mysql&lt;/b&gt;-administrator.x86_64 0:1.1.10-3.fc6 set to be updated&lt;br /&gt;--&gt; Running transaction check&lt;br /&gt;--&gt; Processing Dependency: libsigc-2.0.so.0()(64bit) for package: &lt;b style="color: black; background-color: rgb(153, 255, 153);"&gt;mysql&lt;/b&gt;-administrator&lt;br /&gt;--&gt; Processing Dependency: &lt;b style="color: black; background-color: rgb(153, 255, 153);"&gt;mysql&lt;/b&gt;-&lt;b style="color: black; background-color: rgb(255, 153, 153);"&gt;gui&lt;/b&gt;-common for package: &lt;b style="color: black; background-color: rgb(153, 255, 153);"&gt;mysql&lt;/b&gt;-administrator&lt;br /&gt;--&gt; Processing Dependency: libgdkmm-2.4.so.1()(64bit) for package: &lt;b style="color: black; background-color: rgb(153, 255, 153);"&gt;mysql&lt;/b&gt;-administrator&lt;br /&gt;--&gt; Processing Dependency: libpangomm-1.4.so.1()(64bit) for package: &lt;b style="color: black; background-color: rgb(153, 255, 153);"&gt;mysql&lt;/b&gt;-administrator&lt;br /&gt;--&gt; Processing Dependency: libglibmm-2.4.so.1()(64bit) for package: &lt;b style="color: black; background-color: rgb(153, 255, 153);"&gt;mysql&lt;/b&gt;-administrator&lt;br /&gt;--&gt; Processing Dependency: libcairomm-1.0.so.1()(64bit) for package: &lt;b style="color: black; background-color: rgb(153, 255, 153);"&gt;mysql&lt;/b&gt;-administrator&lt;br /&gt;--&gt; Processing Dependency: libatkmm-1.6.so.1()(64bit) for package: &lt;b style="color: black; background-color: rgb(153, 255, 153);"&gt;mysql&lt;/b&gt;-administrator&lt;br /&gt;--&gt; Processing Dependency: libgtkmm-2.4.so.1()(64bit) for package: &lt;b style="color: black; background-color: rgb(153, 255, 153);"&gt;mysql&lt;/b&gt;-administrator&lt;br /&gt;--&gt; Restarting Dependency Resolution with new changes.&lt;br /&gt;--&gt; Populating transaction set with selected packages. Please wait.&lt;br /&gt;---&gt; Downloading header for gtkmm24 to pack into transaction set.&lt;br /&gt;gtkmm24-2.10.5-1.fc6.x86_ 100% |=========================| 7.8 kB    00:00 &lt;br /&gt;---&gt; Package gtkmm24.x86_64 0:2.10.5-1.fc6 set to be updated&lt;br /&gt;---&gt; Downloading header for cairomm to pack into transaction set.&lt;br /&gt;cairomm-1.2.4-1.fc6.x86_6 100% |=========================| 5.2 kB    00:00 &lt;br /&gt;---&gt; Package cairomm.x86_64 0:1.2.4-1.fc6 set to be updated&lt;br /&gt;---&gt; Downloading header for libsigc++20 to pack into transaction set.&lt;br /&gt;libsigc++20-2.0.17-2.x86_ 100% |=========================| 6.1 kB    00:00 &lt;br /&gt;---&gt; Package libsigc++20.x86_64 0:2.0.17-2 set to be updated&lt;br /&gt;---&gt; Downloading header for glibmm24 to pack into transaction set.&lt;br /&gt;glibmm24-2.12.3-1.x86_64. 100% |=========================| 6.1 kB    00:00 &lt;br /&gt;---&gt; Package glibmm24.x86_64 0:2.12.3-1 set to be updated&lt;br /&gt;---&gt; Downloading header for &lt;b style="color: black; background-color: rgb(153, 255, 153);"&gt;mysql&lt;/b&gt;-&lt;b style="color: black; background-color: rgb(255, 153, 153);"&gt;gui&lt;/b&gt;-common to pack into transaction set.&lt;br /&gt;&lt;b style="color: black; background-color: rgb(153, 255, 153);"&gt;mysql&lt;/b&gt;-&lt;b style="color: black; background-color: rgb(255, 153, 153);"&gt;gui&lt;/b&gt;-common-1.1.10-3 100% |=========================|  17 kB    00:00 &lt;br /&gt;---&gt; Package &lt;b style="color: black; background-color: rgb(153, 255, 153);"&gt;mysql&lt;/b&gt;-&lt;b style="color: black; background-color: rgb(255, 153, 153);"&gt;gui&lt;/b&gt;-common.x86_64 0:1.1.10-3.fc6 set to be updated&lt;br /&gt;--&gt; Running transaction check&lt;br /&gt;&lt;br /&gt;Dependencies Resolved&lt;br /&gt;&lt;br /&gt;=============================================================================&lt;br /&gt;Package                 Arch       Version          Repository        Size&lt;br /&gt;=============================================================================&lt;br /&gt;Installing:&lt;br /&gt;&lt;b style="color: black; background-color: rgb(153, 255, 153);"&gt;mysql&lt;/b&gt;-administrator     x86_64     1.1.10-3.fc6     extras            1.5 M&lt;br /&gt;Installing for dependencies:&lt;br /&gt;cairomm                 x86_64     1.2.4-1.fc6      extras             40 k&lt;br /&gt;glibmm24                x86_64     2.12.3-1         extras            145 k&lt;br /&gt;gtkmm24                 x86_64     2.10.5-1.fc6     extras            1.1 M&lt;br /&gt;libsigc++20             x86_64     2.0.17-2         extras             49 k&lt;br /&gt;&lt;b style="color: black; background-color: rgb(153, 255, 153);"&gt;mysql&lt;/b&gt;-&lt;b style="color: black; background-color: rgb(255, 153, 153);"&gt;gui&lt;/b&gt;-common        x86_64     1.1.10-3.fc6     extras            208 k&lt;br /&gt;&lt;br /&gt;Transaction Summary&lt;br /&gt;=============================================================================&lt;br /&gt;&lt;b style="color: black; background-color: rgb(160, 255, 255);"&gt;Install&lt;/b&gt;      6 Package(s)     &lt;br /&gt;Update       0 Package(s)     &lt;br /&gt;Remove       0 Package(s)     &lt;br /&gt;&lt;br /&gt;Total download size: 3.1 M&lt;br /&gt;Is this ok [y/N]:&lt;br /&gt;&lt;/pre&gt;&lt;li&gt;Improving local file security (after saving and exiting remember to: service mysqld restart for changes to take effect):&lt;/li&gt;&lt;pre&gt;The next change is to disable the use of &lt;strong&gt;LOAD DATA LOCAL INFILE&lt;/strong&gt; command, which will help to&lt;br /&gt;prevent against unauthorized reading from local files. This matters especially when new SQL&lt;br /&gt;Injection vulnerabilities in PHP applications are found.&lt;br /&gt;&lt;br /&gt;For that purpose, the following parameter should be added in the [&lt;strong&gt;mysqld] section in:&lt;br /&gt;/etc/my.cnf&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;&lt;br /&gt;set-variable=local-infile=0&lt;/strong&gt;&lt;/pre&gt;&lt;li&gt;Disabling remote access to the &lt;b style="color: black; background-color: rgb(153, 255, 153);"&gt;MySQL&lt;/b&gt; server (after saving and exiting remember to: service mysqld restart for changes to take effect).&lt;br /&gt;&lt;/li&gt;&lt;pre&gt;This change applies to the 3306/tcp port, on which &lt;b style="color: black; background-color: rgb(153, 255, 153);"&gt;MySQL&lt;/b&gt; listens by default. Because,&lt;br /&gt;according to the initial assumptions, the database will be used only by locally installed PHP&lt;br /&gt;applications, we can freely disable listening on that port. This will limit possibilities of&lt;br /&gt;attacking the &lt;b style="color: black; background-color: rgb(153, 255, 153);"&gt;MySQL&lt;/b&gt; database by direct TCP/IP connections from other hosts. Local communication&lt;br /&gt;will be still possible throw the &lt;b style="color: black; background-color: rgb(153, 255, 153);"&gt;mysql&lt;/b&gt;.sock socket. In order to disable listening on the&lt;br /&gt;mentioned port, the following parameter should be added to the &lt;strong&gt;[mysqld] section of /etc/my.cnf&lt;/strong&gt;:&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;skip-networking&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;If, for some reason, remote access to the database is still required (e.g. to perform remote&lt;br /&gt;data backup), the SSH protocol can be used as follows:&lt;br /&gt;&lt;br /&gt;(modify to your needs)&lt;br /&gt;&lt;strong&gt;backuphost$ ssh mysqlserver /usr/local/&lt;b style="color: black; background-color: rgb(153, 255, 153);"&gt;mysql&lt;/b&gt;/bin/mysqldump -A &gt; backup&lt;/strong&gt;&lt;br /&gt;&lt;/pre&gt;&lt;/ol&gt; &lt;/div&gt; &lt;h2 class="contentheading"&gt;Troubleshooting&lt;/h2&gt; &lt;h3 class="contentheading"&gt;How to test&lt;/h3&gt; &lt;div&gt; &lt;ol start="1"&gt;&lt;li&gt;Make sure &lt;b style="color: black; background-color: rgb(153, 255, 153);"&gt;mysql&lt;/b&gt; and &lt;b style="color: black; background-color: rgb(153, 255, 153);"&gt;mysql&lt;/b&gt; server are indeed installed and that they are the correct versions:&lt;/li&gt;&lt;pre&gt;# rpm -qa | grep &lt;b style="color: black; background-color: rgb(153, 255, 153);"&gt;mysql&lt;/b&gt; &amp;amp;&amp;amp; chkconfig --list | grep &lt;b style="color: black; background-color: rgb(153, 255, 153);"&gt;mysql&lt;/b&gt;&lt;br /&gt;&lt;b style="color: black; background-color: rgb(153, 255, 153);"&gt;mysql&lt;/b&gt;-5.0.27-1.fc6&lt;br /&gt;&lt;b style="color: black; background-color: rgb(153, 255, 153);"&gt;mysql&lt;/b&gt;-5.0.27-1.fc6&lt;br /&gt;&lt;b style="color: black; background-color: rgb(153, 255, 153);"&gt;mysql&lt;/b&gt;-&lt;b style="color: black; background-color: rgb(255, 153, 153);"&gt;gui&lt;/b&gt;-common-1.1.10-3.fc6&lt;br /&gt;&lt;b style="color: black; background-color: rgb(153, 255, 153);"&gt;mysql&lt;/b&gt;-server-5.0.27-1.fc6&lt;br /&gt;&lt;b style="color: black; background-color: rgb(153, 255, 153);"&gt;mysql&lt;/b&gt;-administrator-1.1.10-3.fc6&lt;br /&gt;mysqld          0:off   1:off   2:off   3:off   4:off   5:off   6:off&lt;br /&gt;&lt;/pre&gt;&lt;li&gt;Starting mysqld on boot:&lt;/li&gt;&lt;pre&gt;# chkconfig --level 2345 mysqld on &amp;amp;&amp;amp; service mysqld restart &amp;amp;&amp;amp; chkconfig --list | grep mysqld&lt;br /&gt;Stopping &lt;b style="color: black; background-color: rgb(153, 255, 153);"&gt;MySQL&lt;/b&gt;:                                            [  OK  ]&lt;br /&gt;Starting &lt;b style="color: black; background-color: rgb(153, 255, 153);"&gt;MySQL&lt;/b&gt;:                                            [  OK  ]&lt;br /&gt;mysqld          0:off   1:off   2:on    3:on    4:on    5:on    6:off&lt;br /&gt;&lt;/pre&gt;&lt;li&gt;Clear &lt;b style="color: black; background-color: rgb(153, 255, 153);"&gt;MySQL&lt;/b&gt; scrollback history (so sensitive data such as passwords cannot be seen by others with access):&lt;/li&gt;&lt;pre&gt;]# cat /dev/null &gt; ~/.mysql_history&lt;/pre&gt;&lt;li&gt;Show all users in the &lt;b style="color: black; background-color: rgb(153, 255, 153);"&gt;MySQL&lt;/b&gt; Server database:&lt;/li&gt;&lt;pre&gt;&lt;b style="color: black; background-color: rgb(153, 255, 153);"&gt;mysql&lt;/b&gt;&gt; select * from &lt;b style="color: black; background-color: rgb(153, 255, 153);"&gt;mysql&lt;/b&gt;.user;&lt;br /&gt;8 rows in set (0.00 sec)&lt;br /&gt;&lt;/pre&gt;&lt;li&gt;Delete a user from the &lt;b style="color: black; background-color: rgb(153, 255, 153);"&gt;MySQL&lt;/b&gt; Server database:&lt;/li&gt;&lt;pre&gt;&lt;b style="color: black; background-color: rgb(153, 255, 153);"&gt;mysql&lt;/b&gt;&gt; delete from &lt;b style="color: black; background-color: rgb(153, 255, 153);"&gt;mysql&lt;/b&gt;.user where host = "dev.mydomain.com";&lt;br /&gt;Query OK, 2 rows affected (0.00 sec)&lt;br /&gt;&lt;/pre&gt;&lt;li&gt;Delete a null user (user without a username) from the &lt;b style="color: black; background-color: rgb(153, 255, 153);"&gt;MySQL&lt;/b&gt; Server database:&lt;/li&gt;&lt;pre&gt;&lt;b style="color: black; background-color: rgb(153, 255, 153);"&gt;mysql&lt;/b&gt;&gt; delete from &lt;b style="color: black; background-color: rgb(153, 255, 153);"&gt;mysql&lt;/b&gt;.user where user = ' ';&lt;br /&gt;Query OK, 1 rows affected (0.00 sec)&lt;br /&gt;&lt;/pre&gt;&lt;/ol&gt; &lt;/div&gt; &lt;h3 class="contentheading"&gt;Common problems and fixes&lt;/h3&gt;yum remove mysql\*&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3053352583694970340-6953518272680917575?l=itgeekhelp.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://itgeekhelp.blogspot.com/feeds/6953518272680917575/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://itgeekhelp.blogspot.com/2008/12/install-mysql-on-fedora.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3053352583694970340/posts/default/6953518272680917575'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3053352583694970340/posts/default/6953518272680917575'/><link rel='alternate' type='text/html' href='http://itgeekhelp.blogspot.com/2008/12/install-mysql-on-fedora.html' title='install/uninstall mysql on fedora'/><author><name>Pedric Kng Aka Boon</name><uri>http://www.blogger.com/profile/07979744237794291200</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3053352583694970340.post-8385696516667228415</id><published>2008-12-18T00:51:00.000-08:00</published><updated>2009-04-06T00:37:51.437-07:00</updated><title type='text'>Install SUN Glassfish on Fedora 9</title><content type='html'>1. yum install libstdc++.so.5&lt;br /&gt;2. Download glassfish bin&lt;br /&gt;&lt;glassfish.bin&gt;&lt;/glassfish.bin&gt;&lt;br /&gt;&lt;h4&gt;Instructions to unbundle and configure GlassFish &lt;/h4&gt; &lt;p&gt;To install and configure GlassFish you need to have &lt;a href="http://java.sun.com/javase/downloads/index_jdk5.jsp"&gt;JDK 5&lt;/a&gt; or &lt;a href="http://java.sun.com/javase/downloads/index.jsp"&gt;JDK 6&lt;/a&gt; installed on your system. The configuration processing depends on Ant (1.6.5).  The bundle includes an Ant distribution that has been extended with tasks to facilitate developing Java EE 5 applications for the application server. &lt;/p&gt; &lt;ol&gt;&lt;li&gt;Download one of the bundles to disk, set JAVA_HOME to the JDK you have installed on your system.&lt;br /&gt;  &lt;/li&gt;&lt;li&gt;Run:     &lt;pre&gt;   % java -Xmx256m -jar &lt;i&gt;filename.jar&lt;/i&gt;&lt;/pre&gt; This command will unbundle GlassFish and create a new directory structure rooted under a directory named 'glassfish'. &lt;/li&gt;&lt;li&gt;     &lt;pre&gt; % cd glassfish&lt;/pre&gt;   &lt;/li&gt;&lt;li&gt;If you are using a machine with an operating system that is a derivative of UNIX(tm), set the execute permission for the Ant binaries that are included with the GlassFish bundle.     &lt;pre&gt;% chmod -R +x lib/ant/bin&lt;/pre&gt;     &lt;pre&gt;% lib/ant/bin/ant -f setup.xml &lt;/pre&gt; OR for Windows:&lt;br /&gt;    &lt;pre&gt;% lib\ant\bin\ant -f setup.xml &lt;/pre&gt;   &lt;/li&gt;&lt;/ol&gt; &lt;p&gt;For GlassFish V2 with Clustering supported installation, just change step 4 from the above installation&lt;/p&gt; &lt;pre style="margin-left: 40px;"&gt;% lib/ant/bin/ant -f setup-cluster.xml &lt;/pre&gt; OR  for Windows:&lt;br /&gt;&lt;pre style="margin-left: 40px;"&gt;% lib\ant\bin\ant -f setup-cluster.xml &lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3053352583694970340-8385696516667228415?l=itgeekhelp.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://itgeekhelp.blogspot.com/feeds/8385696516667228415/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://itgeekhelp.blogspot.com/2008/12/install-sun-glassfish-on-fedora-9.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3053352583694970340/posts/default/8385696516667228415'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3053352583694970340/posts/default/8385696516667228415'/><link rel='alternate' type='text/html' href='http://itgeekhelp.blogspot.com/2008/12/install-sun-glassfish-on-fedora-9.html' title='Install SUN Glassfish on Fedora 9'/><author><name>Pedric Kng Aka Boon</name><uri>http://www.blogger.com/profile/07979744237794291200</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3053352583694970340.post-1608868776760075188</id><published>2008-12-17T23:10:00.000-08:00</published><updated>2008-12-17T23:43:43.220-08:00</updated><title type='text'>Configuring VNC on fedora 9</title><content type='html'>1. #Yum vnc-server //installation&lt;br /&gt;2. #vncserver :1 //run desktop 1&lt;br /&gt;3. #vncserver -kill :1 // kill desktop 1&lt;br /&gt;4. #service vncserver status //check for vncserver status&lt;br /&gt;5. #chkconfig vncserver on //start vncserver upon bootup&lt;br /&gt;6. #vi /root/.vnc/xstartup file //configure startup vnc desktop&lt;br /&gt;&lt;pre&gt;//xstartup file&lt;br /&gt;#!/bin/sh&lt;br /&gt;&lt;br /&gt;# Uncomment the following two lines for normal desktop:&lt;br /&gt;unset SESSION_MANAGER&lt;br /&gt;exec /etc/X11/xinit/xinitrc&lt;br /&gt;&lt;br /&gt;[ -x /etc/vnc/xstartup ] &amp;amp;&amp;amp; exec /etc/vnc/xstartup&lt;br /&gt;[ -r $HOME/.Xresources ] &amp;amp;&amp;amp; xrdb $HOME/.Xresources&lt;br /&gt;xsetroot -solid grey&lt;br /&gt;vncconfig -iconic &amp;amp;&lt;br /&gt;xterm -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &amp;amp;&lt;br /&gt;twm &amp;amp;&lt;br /&gt;&lt;br /&gt;If you want to force to load Gnome or KDE Desktop on remote access,&lt;br /&gt;edit the last line from ‘twm &amp;amp;’ to ’startx &amp;amp;’ for Gnome and&lt;br /&gt;’startkde &amp;amp;’ for KDE Desktop.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;font-size:130%;" &gt;7.&lt;/span&gt;#vncserver :1 -extension XFIXES //Restart vnc&lt;br /&gt;8. connect using realvnc ipaddress:1&lt;br /&gt;9. #vi &lt;strong&gt;/etc/sysconfig/vncservers //configure bootup vnc image desktop&lt;br /&gt;&lt;br /&gt;&lt;/strong&gt;VNCSERVERS="1:tiger 2:albatros 3:leopard"&lt;br /&gt;VNCSERVERARGS[1]="-geometry 1024x768 -depth 16" //port 5901&lt;br /&gt;VNCSERVERARGS[2]="-geometry 800x600 -depth 8" //port 5902&lt;br /&gt;VNCSERVERARGS[3]="-geometry 1024x768 -depth 16" //pot 5903&lt;br /&gt;&lt;br /&gt;10. # service vncserver [restart|start|stop|status]&lt;br /&gt;11. startup script to start up program upon vnc&lt;br /&gt;&lt;br /&gt;//&lt;strong&gt; /home/&lt;user&gt;/.vnc/xstartup&lt;br /&gt;&lt;/user&gt;&lt;/strong&gt;xsetroot -solid grey&lt;br /&gt;vncconfig -iconic &amp;amp;&lt;br /&gt;xterm -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" -e ./menu &amp;amp;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;EXT_PROGRAM&lt;/span&gt; &amp;amp;&lt;br /&gt;&lt;strong&gt;&lt;span style="font-family:Georgia,serif;"&gt;&lt;br /&gt;12. /root/.vnc/&lt;localhost.localdomain&gt;:&lt;port&gt;.log&lt;br /&gt;&lt;/port&gt;&lt;/localhost.localdomain&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3053352583694970340-1608868776760075188?l=itgeekhelp.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://itgeekhelp.blogspot.com/feeds/1608868776760075188/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://itgeekhelp.blogspot.com/2008/12/configuring-vnc-on-fedora-9.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3053352583694970340/posts/default/1608868776760075188'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3053352583694970340/posts/default/1608868776760075188'/><link rel='alternate' type='text/html' href='http://itgeekhelp.blogspot.com/2008/12/configuring-vnc-on-fedora-9.html' title='Configuring VNC on fedora 9'/><author><name>Pedric Kng Aka Boon</name><uri>http://www.blogger.com/profile/07979744237794291200</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>
