Posts

Git

How to use Git bash with keys for Bit Bucket  open a git bash prompt   type 'ssh-keygen' accept default location   choose a passphrase  copy to server the key If you have already created the keys and need to use it in GitBash you need to do the following Open a git bash prompt type ssh-keygen and note the location it is pointing to ( in window it is c/Users/<User Name>/.ssh/id_rsa ) - id_rsa is the file name If you have the ppk file use the following steps to create a OpensSH key open PuTTygen and open the ppk key  once key is open select Conversions -> Expore OpenSSH key and save it to the previous default location where it was going to create the key After you have the key at that location Git bash will recognize the key and use it. For Tortoisegit   Open windows Explorer  Open the Contextmenu and go to TortoiseGit -> Settings  In the opened window navigator go to Git -> Remote ...

Reading Excel Sheet on client side and processing it

Image
If you ever want to process excel sheets on the client side (on the browser) then this will be useful for you.  This uses  http://oss.sheetjs.com  coed and the source files are in ( https://github.com/SheetJS/js-xls ,  https://github.com/SheetJS/js-xlsx ) it is licensed under Apache Licence, Version 2.0 (refer attached licence in the libraries in github) Steps to Follow, JS Files required: Copy the code for following files and make corresponding files locally, or download them from github,                 https://raw.github.com/SheetJS/js-xlsx/master/xlsx.js                 https://raw.github.com/SheetJS/js-xls/master/xls.js                 http://stuk.github.io/jszip/ We will be taking some javascript already in oss.sheetjs.com for our example particularly on the main page of oss.sheetjs.com. Sample Excel Sheet: Our exce...

DB Connection Issues

1. Application gives "1c86bdf0 SharedPool I J2CA0086W: Shareable connection MCWrapper id 686bbdf9 Managed connection com.ibm.ws.rsadapter.spi.WSRdbManagedConnectionImpl@6156bdf9 State:STATE_TRAN_WRAPPER_INUSE" message when trying to do a db update within loop which is querying a view and carrying out some operations. In IBM this problem is documented under the topic " Application hangs with prior J2CA0086W warning messages" The solutions are  1. The application must be modified to use serial reuse or 2. The connection pool can be changed to unshareable. Shareable connections are not allowed within a local transaction containment boundary. The above scenario suggests a possible problem in the application logic and how it is using the connection code. The J2CA0086 message is telling you that your application is using a shared connection in a LocalTransaction. Since the connection is enlisted in a Local Transaction, and not a Global Transaction, di...

Scheduling AWS Autoscaling to create Instance and run your tasks

        Introduction       The purpose of this exercise is to not have a instance running for one off tasks but create the               instance dynamically using a pre configured AMI image.       We use this insance to create reports and upload the reports to S3 bucket. The below details are           provided for configuring the instance and creating  autoscaling groups which will fire up an AMI                image and run at a specified time to achieve the goal.     Download and Configure Auto Scaling Command Line Tool              Google or use (http://ec2-downloads.s3.amazonaws.com/AutoScaling-2011-01-01.zip)       Follow instruction in the Auto scaling tool "Readme.txt" which indicates to set the,                Env...

Change timezone in EC2 instance

Change time Timezone Check the time of the ec2 instance by > date. Normally it has 14 hours difference cat /etc/sysconfig/clock ZONE="UTC" UTC=true cp /etc/localtime /etc/localtime.backup ln -sf /usr/share/zoneinfo/Australia/Sydney /etc/localtime Make the change permanent by adding the following line to the "/etc/sysconfig/clock" file:  ZONE="Australia/Sydney" After this this will show the correct Sydney time

Spring Interceptors

applicationContext-dispatcher.xml we can configure the interceptors as follows in this. < bean id = "visitedPageInterceptor" class = "au.com.vvv.oes.ui.controller.interceptor.VisitedPageInterceptor" /> < bean id = "trailingSlashInterceptor" class = "au.com.vvv.oes.ui.controller.interceptor.TrailingSlashInterceptor" /> < bean id = "breadcrumbInterceptor" class = "au.com.vvv.oes.ui.controller.interceptor.BreadcrumbInterceptor" /> < bean id = "ie6Interceptor" class = "au.com.vvv.oes.ui.controller.interceptor.IE6Interceptor" /> < bean id = "SEOInterceptor" class = "au.com.vvv.oes.ui.controller.interceptor.SEOInterceptor" /> These interceptors can be post interceptors or preinterceptors. example visitedPageInterceptor will be as follows, package au.com.vvv.oes.ui.controller.interceptor; public class VisitedPag...

How to Define a Property in xml files and use it in JSP

Files To Modify :  build.xml / env.properties /a_config.xml / main.jsp ServiceLocator.xml - has some stuff build.xml ---------------------------------- <filter token="omniture.sCodeJsFile" value="${omniture.sCodeJsFile}"/> env.properties ---------------------------------- omniture.sCodeJsFile=s_code_dev.js aldous_css_oes_config.xml ----------------------------------  <omniture>   <sCodeJsFile>@omniture.sCodeJsFile@</sCodeJsFile>  </omniture> main.jsp ---------------------------------- <script type="text/javascript" src="${pageContext.servletContext.contextPath}/javascript/<tag:xmlConfigProperty key="omniture.sCodeJsFile"/>?@js_css.version@"></script>  <%@ taglib prefix="tag" tagdir="/WEB-INF/tags" %> ServiceLocator.xml ----------------------------------  <bean id="xmlConfiguration" class="org.apache.commons.configu...