Posts

Showing posts from 2014

Road to AngularJS

AngularJS is a great framework for developing single page responsive web applications. If you are a web application developer and work with front end, you should learn AngularJS. As there are too many ways to do a particular job, learning angular may seem difficult at the very beginning. If you read the tutorials that are available in internet, you might get confused seeing that same task is done in different ways by different people. I've been studying on AngularJS for last few months and trying to get a clear concept on how this works and what I should do to use AngularJS in my projects. In this post, I'll note down my experience of learning AngularJS so that I can follow in later. I hope this will also help others who want to learn AngularJS. Step 1: Follow the tutorial that is available in the  https://docs.angularjs.org/tutorial . There are 13 steps in this tutorial. Complete all of them. As they use Git for the codebase and node.js for server, it would be better if

JKS to PEM conversion

Situation: I've generated a private key using keytool. I've created a CSR file with this private key and signed it with a CA. I'm using this successfully in my java projects and with Tomcat. Now, I need to use this SSL certificate with Nginx server. To do so, I need to provide the private key and certificate file to Nginx. I've got the CRT files from CA. But the question is, how to use the keytool generated private key with Nginx or other servers?   Solution: We need to extract the private key from the keystore file and save it in a format so that other servers can recognize it. Extract the private key from keystore using this tool  https://code.google.com/p/java-exportpriv/wiki/Usage Use the following command to extract the private key in PKCS#8 format java ExportPriv .keystore mykey test123 You can use this private key with Nginx or Apache who does not support keytool generated private key.

Hello World in Struts 1

Follow this tutorial:  http://www.dzone.com/tutorials/java/struts/struts-tutorial/struts-tutorial-using-eclipse-1.html After following this, you will be able to create a project but with import error for javax.serveletapi To resolve this, you need to install tomcat and add it to project's build path. Install Tomcat 7 from here  http://tomcat.apache.org/download-70.cgi Add tomcat in the targetted runtime as described here  http://stackoverflow.com/a/9287149/997566 Set tomcat in the java build path: Right click on project ---> Properties ---> Java Build Path ---> Add Library... ---> Server Runtime ---> Apache Tomcat ----> Finish Now, run the application and you should see the hello world!

Implement SSL on Java

In order to implement SSL on server we need to do the following: 1. Generate a private key using Keytool. Here is the sample command for keytool keytool -genkey -alias tomcat -keyalg RSA -keystore keystore.jks This will ask several questions. The first question is what is your name and the answer must be the fully qualified name of the domain. For example, if the domain is reveim.com, the name should be reveim.com. If all other information is provided and a password is set, this will generate a file named keystore.jks and store a private-public key pair in this file. The alias name is important and  can be any word. This alias name will be required during certificating signing process. The generate keystore.jks file is called the self-signed certificate. This can be used with custom clients. But if the client is a browser, self signed certificate should not be used because user will see a warning message for their first visit. For production use, we need to

Hosting a Git Server

I've been searching for the last couple of days to find which software is best for hosting own git server like github , bitbucket or gitlab . I've found some solution and I'm going to share it will everyone. GitLab Another great software is GitLab. Most probably, this is the best of all choices. Installing it on Ubuntu is very easy and straightforward as they provide a deb package file. But installing from source is a long, complex process. Moreover you may face some trouble regarding dependency of other packages. GitLab can be downloaded for free from here . RhodeCode RhodeCode is another solution which is written in python. It also provides a nice installer script which will guide you through the installation process.  Gogs Gogs  is the very new solution written in Go language. It has a nice UI and is very easy to setup.  Bitbucket If you are interested to pay some money, choose the Bitbucket . Price is not high and you'll get all the awesome feat