Posts

Monolithic vs Micro Services

Monolithic : Developing and maintaining   the whole application into a Single unit. Micro Services : Developing and maintaining individual services and   deploying as single application using light weight protocols for communication. Feature Monolithic Micro Services Language Constraint We have to write entire application in a single language. Micro services can be developed using multiple languages. We can go with multiple persistent databases and frameworks which is best suitable for a business need.   Digestion It is not possible one developer to digest all the modules in the entire application. Micro services are pieces of application. So, digestion is not a problem. Developer can easily concentrate on the assigned service only. Deployment Deployment is easy but we have to deploy the entire application for a small change. Micro serv...

Python and DJango Installation

Image
 Python and DJango Installation Steps Download Python latest version which is compatible to your OS. And then follow below commands through Windows Powershell > pip install virtualenvwrapper-win   -- To install virtual environment > mkvirtualenv myproject   -- create Project you virtual Environment > workon myproject   -- to shift and work on your project > pip install django  -- Install Django using pip > python -m django --version  -- to check installed Django version To create your project                               PS >  django-admin startproject myfirst To run python server                               PS >  python manage.py runserver To apply those changes to the database.     ...

AngularJS Flow

AngularJS  is a very powerful JavaScript Framework. It is used in Single Page Application (SPA) projects. It extends HTML DOM with additional attributes and makes it more responsive to user actions. AngularJS is open source, completely free, and used by thousands of developers around the world. It is licensed under the Apache license version 2.0. AngularJS flow with a simple example <!doctype html> <html> <head> <script src = "https://ajax.googleapis.com/ajax/libs/angularjs/1.5.2/angular.min.js" ></script> </head> <body ng-app = "myapp" > <div ng-controller = "HelloController" > <h2> Welcome {{helloTo.title}} to the world of Tutorialspoint! </h2> </div> <script> angular . module ( "myapp" , []) . controller ( "HelloController" , function ( $scope...

How to get the tweets using Kafka producer and Consume it using MongoDB

Kafka_Mongo_Integration Sample POC on Kafka which will pull tweets from twitter and persist in to the MongoDB Technologies: Kafka Zookeeper MongoDB For full code  https://github.com/BrahmaR/KafkaMongoIntegration Kafka Producer: package com.royal.twitter.kafka; import java.util.Properties; import java.util.concurrent.BlockingQueue; import java.util.concurrent.LinkedBlockingQueue; import kafka.javaapi.producer.Producer; import kafka.producer.KeyedMessage; import kafka.producer.ProducerConfig; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import com.google.common.collect.Lists; import com.twitter.hbc.ClientBuilder; import com.twitter.hbc.core.Constants; import com.twitter.hbc.core.endpoint.StatusesFilterEndpoint; import com.twitter.hbc.core.processor.StringDelimitedProcessor; import com.twitter.hbc.httpclient.BasicClient; import com.twitter.hbc.httpclient.auth.Authentication; import com.twitter.hbc.httpcl...

Security breaches on Web Application

Security Breaches on Web Application Basically we have several types of security breaches on Web application 1. Session Fixation 2. CSRF 3. Click Jacking Session Fixation Session fixation, by most definitions, is a subclass of session hijacking. The most common basic flow is: Step 1. Attacker gets a valid session ID from an application Step 2. Attacker forces the victim to use that same session ID Step 3. Attacker now knows the session ID that the victim is using and can gain access to the victim’s account Step 2, which requires forcing the session ID on the victim, is the only real work the attacker needs to do. And even this action on the attacker’s part is often performed by simply sending the victim a link to a website with the session ID attached to the URL. We need to make sure about Fortunately, resolving session fixation is usually fairly simple. The basic advice is: Invalidate the user session once a successful login has occurred. The usual ...

Gradle vs Maven

Image
Gradle vs Maven vs Ant A simple snippet on Maven and Gradle as well.

Identify cursor leak in Oracle

As a developer it is important to know which Oracle cursor is not being closed or reused on each execution that leads to the following Oracle error: "ORA-01000: maximum open cursors exceeded." We can identify these type of leaks by using some tools but this is a bit hectic to identify in code level. So the solution is we can diagnose these from oracle database side with a minimal queries... 1. Identify the session by its Oracle username to retrieve the sid value. SQL> SELECT sid FROM v$session WHERE username = 'BRAHMA'; sid ----------- 1234 2. List the session's SQL statement addresses, which have more than one active reference. Using the sid value from the previous statement, execute a query against the v$open_cursor view. SQL> SELECT COUNT(*), address FROM v$open_cursor WHERE sid = 1234 GROUP BY address HAVING COUNT(address) > 1 ORDER BY COUNT(*); COUNT(*) ADDRESS ---------------- ---------------- 2 35E6083C 2 ...