DevOps Demystified
This is the ppt of my talk on devOps and Continuous Delivery using Chef which I had given in BeingAgile2013 Conference held at McKinsey
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.
Add twitter bootstrap to your app
In order to integrate twitter bootstrap into your app, follow these steps:
1.)Download from http://twitter.github.io/bootstrap/getting-started.html#download-bootstrap
2.)Inlcude bootstrap.min.js , all the images from img folder and bootstrap.min.css in the resources folder of your app.
3.)Inside your JSP/HTML file add including them.
You are done!
Adding my Spring MVC hibernate app to OpenShift
After developing my local app using Spring MVC and hibernate I decided to put it on openshift.
The technology stack of my app is:
1. Spring MVC v3.2.2.RELEASE
2. Hibernate v3.5.4-Final
3. MySQL
4. Tomcat
5. Maven
6. JQuery
7. Twitter Bootstrap for Responsive Web UI.
OS :Ubuntu 12.04
The source code can be checkout from here : git@github.com:anirudh83/TaskMaster1.1.git
Read More »
Get A Running Web App in 5 minutes using Maven.
Below I will provide the steps to create a web-app using maven and get it running on tomcat, in just 5 minutes and without downloading and setting anything explicitly.
What you need is :
1. jdk 1.5 and above
2. maven 3
3. Eclipse or any IDE
Maven Archetype
We would be using maven archetype to create initial setup of our project.
Read More »
Using verbs apart from HTTP verbs(PUT/POST..) in REST URL
As per REST, the URLs should make use of HTTP verbs to expose their REST based services via HTTP. (i.e GET/PUT/POST/DELETE)
So, a resource would be something like
GET ../foods/1 would get you the food with id 1. PUT ../foods/2 would update the food with id 2. POST ../foods will add a new food. DELETE ../foods/1 will delete the food resource with id 1.</span>
But in a real life complex application, we are faced with exposing many services such as approve, reject where it becomes inevitable to add verbs to the URL. What should we do? Should we just have the URLs like ../foods/1/approve ?
What would go wrong if we use verbs in REST URL.
Whether there is some rationale behind it or it just REST dogma..
Apparently, there is :
Read More »
Using Map Reduce to find the twitter trends
Few weeks back while preparing for our presentation for agileNCR 2013, Sanchit and I started working on an interesting problem statement to solve using MapReduce.
We thought of applying MapReduce algorithm to find the trends in Twitter.
A Tweet in a twitter can have hashTags (#helloTwitter) and a certain hashTag used most number of times in tweets globally is said to have highest trend. More details can be found here.
This data is huge and also keeps on increasing, so processing it in traditional manner would not be possible.
Hence we would require hadoop to help us solve this problem.
Twiiter uses Cassandra to store the data in key-value format. Lets assume for simplicity that the key value pair for tweet data looks something like this < twitterHandle,Tweet >.
Create RESTful app using JAX-RS
Today we are going to discuss few of the strategies which can be used to make RESTful applications in JAVA.
Introduction :
JSR 311 also called as JAX-RS; is the Java Specification for RESTful web services. The few of the major vendors which implement JAX-RS are :
Why would Agile fail for you?
This is not yet-another-agile-gaga blog, but a story, some of you might find it interesting as well.
Not A very long time ago and not in a galaxy far,far away, there were two teams.
One team was following Scrum without Agile Mindset and second had an agile mindset.
The ‘A’ team who were following Scrum, failed!! And ended up blaming agile, whereas the second team ‘B’, came out in flying colors and eventually moved to scrum.
Let’s delve into the details to see what exactly happened…
Read More »
Callbacks explained by hollywood principle
I thought of explaining the concept of callbacks via hollywood principle of : “Dont call us, we will call you, just leave your phone number (register callback) with us :)”
So, I made a small java program for the same.
Use case: SRK wants to apply for Hollywood movie.
Read More »