Hitesh Bhatia

I am tech-enthusiast who likes to get his hands dirty with the latest technologies.

Technology

Fetching File From FTP in Background With Curl.

Last night I had to restore file with size greater than 220GB from our backup FTP server to our main server after OS re installation. Now I could have simply done “get” after logging into ftp out server, but that would have required my machine to stay awake all night unattended. Seems simple but everything I tried didn't seem...

09-May-2012

Grails

Restricting Access To Plugin’s Classes With Spring Security

Many of Grails plugin like searchable  and console can prove to be really dangerous if access to their URLs is not blocked. After adding searchable plugin to my project, I realized that access to its controllers was not defined and was open for all. Now this was a major security concern. There are many ways of restricting access like...

03-May-2012

Technology

Multiple Bootable OS in Single USB

Recently I have been knee deep into Linux installations. Installing through  USB is great process, there is no hassle of CD and its faster too. But problem is first we need bootable USB. Up till now I used "Start Disk Creator", which is bundled in Ubuntu and is great for creating bootable USB, major problem with it is that it ...

19-Apr-2012

Grails

Creating GIT Alias

Since Git is awesome. It also provides functionality of making aliases. Example [shell]git config --global alias.co checkout [/shell] Here we created co as an alias for checkout (All the aliases that are created goes into .gitconfig file under home folder). Now to checkout a branch named testBranch, We can also write [shell]git...

30-Dec-2011

Grails

GIT Maintenance

Since we use git numerous times a day over and over, hence needs maintenance. There are few commands that will help you to keep our git healthy. If you feel that you git has somewhat slowed down, these would do the trick for you. Since ours is a pretty big project . I run it once a week to make sure my git is healthy. 1.git fsck ...

30-Dec-2011

Grails

Grails:Domain Design Via Intellij Idea’s Diagrams

Here is an example of how to design Grails domain class with Intellij Idea.For this we need to have blank domain classes. So lets say we created  three Domain Classes Company,Book,Author To see relationship diagram, Selected Domain Class, and selected tab Domain Class Dependencies.It should look like this Lets assume the...

23-Nov-2011

AWS

Groovy : Find Index of Element in Map

Groovier way of finding index of element from Map. It can be obtained with findIndexOf Method, which accepts closure as argument. [groovy] Map map=["groovy":1,"grails":2,"index":3,"element":4] assert 3 == map.findIndexOf{it.key=="element"} assert 0...

10-Nov-2011

Grails

Creating a Perfect System in few minutes.

There might come up a case where you need to install same kind of OS and other Softwares( which are required for daily use) on multiple systems. One of the ways to do it is follow the same procedure on each of the machines, which is obviously a pain. Here's a easy way to do it by using Clonezilla. Now with clonezilla you will have...

22-Oct-2011

Grails

Create Image of System in USB, Using Clonezilla

Clonezilla is a software that can be used to make image of system that can later be used to install this image on new system, to make it a clone of former system. Here are the steps to create image of a system by clonezilla Create a Bootable USB drive Using Clonezilla. Follow the link to know more Boot the system you want you...

22-Oct-2011

Technology

Installing CloneZilla on USB drive using Ubuntu.

Clonezilla is a software that allows you to do bare metal backup and recovery. To install Clonezilla we would need following Softwares, all of which are available freely. 7zip ( p7zip-full_9.04~dfsg.1-1_i386.deb) Tuxboot (tuxboot-linux-8 ) Clonezilla (clonezilla-live-1.2.6-40-i686.iso) Here are the steps to install...

22-Oct-2011

Grails

Git – How to Change Master Branch

While working on Git with a big team, there are chances that a situation might arise when you want to set some other branch as master branch.Recently we were in a same situation. Several of branches were merged to master branch. And unfortunately one of the branches merged was created from an unstable branch. Making our master branch...

29-Aug-2011

Grails

How to Recover lost Commits in GIT

Recently while working on Git I had accidentally lost my commits. But since Git has a fantastic revision control system, it remembers what I committed. In other words, it records where its HEAD is every time user commits. Here's is the example of how I got my lost commits back. Below are my 5 recent Commits [shell]git log -5...

11-Apr-2011