Create an Ubuntu VM Using Vagrant and Virtual Box

I have been using Vagrant for some time with virtual box to play around with vms on my ubuntu machine.
Vagrant is a tool to help create and provision VirtualBox machines.Few of the reasons for using it would be:

1.) The development environment can be isolated from all the other junk that accumulates on my primary computer.
2.) The development environment can be tuned to match a production server environment as closely as possible.
3.) Provisioning scripts define the machine configuration in code. This means the configuration is repeatable and versionable.
So, lets play with it.
Read More »

Advertisement

Continuous Integration using Jenkins

Continuous Integration means that whenever a code is checked in it should :
1.)compile
2.)run unit test cases
3.) and create the build artifact.

In a project, many developers work on same files and if you don’t merge them daily or very frequently, chances are that it could become a huge task to merge the changes of each developer at a later stage. Moreover if something breaks it would be a nightmare to find out what went wrong.

By continuously integrating the code and compiling it we make sure that if something breaks it gets highlighted instantly and no new code comes on top of it until it is fixed.
Read More »

HTTP Caching explained

We all have noticed that opening of a webpage for the first time takes some time, but the second or third time it loads faster.

This happens because whenever we visit a webpage for the first time, our browser caches the content and need not have to make a call over the network to render it.

This caching ability of the browser saves a lot of network bandwidth and helps in cutting down the server load.
Read More »

10 Reasons why you should NOT write unit test cases!

Finaly, here is a blog in support of all those who feel writing unit test cases is a sheer waste of time.. or is it?? Lets see..

Below are few of the reasons:

1.) You are Neo (from The Matrix) , the ‘chosen one’

You can see the code getting executed as green binaries. You feel the code and understand every use case, you are just so rediculously genious that you don’t require any safety net of unit test cases to identify problems; you can see them with your naked eyes!

Read More »

Playing around with MongoDB – Part 1: setup

This is just a pointer blog to the mongoDB documentation and a basic guide to getting started with using MongoDB on the local system and playing around with it.

Lets first install MongoDB on the Mac and then make a sample app using it.

1.) Installation :
We can use brew to install mongoDB on the mac. Installation instructions can be found here.

Anirudhs-MacBook-Pro:~ anirudh$ brew install mongodb

By default mongodb uses the folder /data/db for the database, so make sure that the directory exists and has all the permissions required.

Once db folder is set, we can run mongodb by the command :

Anirudhs-MacBook-Pro:~ anirudh$ mongod

This will start the mongodb server listening at port 27017.

Once the server is up, we can open a mongo shell to perform the db operations just like using a mysql client.

Login to mongo shell

Anirudhs-MacBook-Pro:~ anirudh$ mongo
MongoDB shell version: 2.6.3
connecting to: test
Welcome to the MongoDB shell.

We can use the help command to see all the operations like create databases, indexes, insert rows, etc.

Lets see few basic examples which can be helpful for our stint with mongo:

To display the database we are using:

 db

To use the database

use <database>

To view all the collections in the db

db.getCollectionNames()

To find

db.collection.find()

More details of getting started are well documented at the mongodb site here.

In the next blog we will make a spring application talk to mongo DB.