1. To set the environment variables:
echo ‘export JAVA_HOME=/usr/java/jdk1.6.0_21′ > /etc/profile.d/jdk.sh echo ‘export PATH=$JAVA_HOME/bin:$PATH’ >> /etc/profile.d/jdk.sh
2. You have to source the file you just created by typing:
source /etc/profile.d/jdk.sh
3. Test if Java environment is successfully installed by typing in this in the shell:
$ java -version java version “1.6.0_03″ Java(TM) SE Runtime Environment [...]
Setting up a GitHub subdomain to host your html website is very simple.
Start with creating a new repository on GitHub with the project name as yourusername.github.com.
Once you have created the repository you need to set it up on your local machine and push a master branch with index.html file. Follow the [...]
Personal Finance app is developed using Grails 2.0 and is running on cloud foundry. http://personalfinance.cloudfoundry.com/
This app makes use of following grails plugins.
jquery 1.7.1 (Grails 2.0 built-in plugin) resources 1.1.6 (Grails 2.0 built-in plugin) cached-resources 1.0 zipped-resources 1.0 yui-minify-resources 0.1.4 shiro 1.1.3 cloud-foundry 1.2.1 twitter-bootstarp 2.0.0.16 (Not using it [...]
I had a jquery change event attached to a checkbox which was part of a div.
<div id="test-div"> <input type="checkbox" checked="checked" value="1" class="test-chkbox" /> </div>
Using the following jquery code a change event was attached to the above checkbox
$(".test-chkbox").change(function () { $.ajax({ type: "GET", url: "some-action", data: this.value, cache: false, success: function(response){ $("#test-div").replaceWith(response); } [...]
In this blog we are going to discuss very basic usage of VIM editor.
What is VIM
Vim is an advanced text editor that seeks to provide the power of the de-facto Unix editor ‘VI’, in short VIM is an improved version of VI text editor.
Modes in VIM
VIM has six different modes, you [...]
Once in a while you want to reset your mysql root password, here is how you can do it.
Stop the MySql service
sudo /etc/init.d/mysql stop
Restart MySql in safe mode and skip grant table so that you can login with root without any password.
sudo mysqld_safe –skip-grant-tables &
Login with root
mysql -u root
[...]
This blog is a cheat sheet for using Cloud Foundry grails plugin. For details about the commands and how to install plugin please look at the guide.
Deploying Application Initial state
grails cf-apps – list of active deployed applications
grails cf-info – Details about resources in use (Memory, Services [...]
Here we are going to discuss some basic MySQL configuration parameter for tuning MySql
max_connection=50
max_connection defines the maximum number of simultaneous client connections. Default value is set to 100, you can start with a low value like 20 or 50 and increase them as your application grows.
table_cache=2048
table_cache determines how many [...]
By default renderErrors tag in grails supports list or xml to display errors, but if we want to display error next to the field as shown below then list is not the best way to go.
So to resolve this issue I extended the current grails ValidationTagLib and override the tag renderErrors to [...]
This blogs explains how you can improve the performance of your select queries by properly using indexes.
Consider the following query on a data base with no indexes.
select ci.Name, co.Name, cl.Language from city ci, country co, countrylanguage cl where ci.CountryCode=co.Code and cl.CountryCode=co.code and ci.CountryCode = ‘USA’;
Lets do an explain on the above query.
[...]

