Friday, November 08, 2013

Example Spring MVC, JPA, Hibernate Project with Maven

Here is the github link for sample Spring MVC, JPA, Hibernate Project with Maven. You can download and build your project on top of it.

sample-spring-mvc-jpa

Happy Hacking..

Thursday, October 03, 2013

Write Text file to network drive


First you have to download CIFS Client library from http://jcifs.samba.org/

if you use domain then you have to use user variable like below,
    String user = "domain;user:password";

else use below code,
    String user = "user:password";

rest of the code should be like below,
    NtlmPasswordAuthentication auth = new NtlmPasswordAuthentication(user);
    String path = "smb://server/D/MyLocation/data.txt";
    SmbFile sFile = new SmbFile(path, auth);
    SmbFileOutputStream sfos = new SmbFileOutputStream(sFile);
    sfos.write("Test".getBytes());

There you go, data.txt should be there in your locatoin :-)

Sunday, August 25, 2013

Change/ Modify Image meta data in Linux


Assume you need to change Image meta data like Date Taken etc. Believe me you may need to change something like this in some cases ;-)
Step 1.) sudo apt-get install libimage-exiftool-perl
Step 2.) exiftool -AllDates='2013:08:08 15:35:33' -overwrite_original image.jpg
Hope this tip would help you in one day :-)

State Machine implementation for Spring Boot Project

Well I do not write a lot about it. You have plenty of resources to read about it. The behavior of state machines can be observed in many d...