Posts

Showing posts from 2015

MongoDB for Java Developer Course

I successfully completed MongoDB for Java Developer course on 12/09/2015.

The course completion certificate is at: http://university.mongodb.com/course_completion/24540ba216594c40ac7f3686d79a1046
(this pdf file will be stored in MongoDB GridFS).

I obtained 77% grade and grade for being certified was 65%.

The course spanned over 3 months from October to December 2015 and following was the syllabus:

Week1 - Introduction - Overview, Design Goals, the Mongo Shell, JSON Intro, Installing Tools, Overview of Blog Project. Maven, Spark and Freemarker Intro
Week 2 - CRUD - Mongo Shell, Query Operators, Update Operators and a Few Commands
Week 3 - Schema Design - Patterns, Case Studies & Tradeoffs
Week 4 - Using Indexes, Monitoring And Understanding Performance. Performance In Sharded Environments
Week 5 - Aggregation Framework - Goals, The Use Of The Pipeline, Comparison With SQL Facilities.
Week 6 - Application Engineering - Drivers, Impact Of Replication And Sharding On Design And Development…

Understanding Docker

LXC (Linux Container) 2 unique traits of containers are: Namespace - is for: ls -al /proc/1341/ns - isilates Filesystem and mount points (mnt)Process space (pid)Network (net)Network devicesRoutesFirewall RulesHostname (uts)Inter process communication (ipc)
Control Groups - cat /proc/cgroupsManages what portion of the resources each container can consumeCertain cpusEtc - check notes


/container --- is where the containers live.
Under each container: Separate namespace for containers - Rootfs - represents the / (root) file systemWhich has /bin, /boot etc./container/mycontainer1/rootfs/tmp/newfile - is seen under container mycontainer1 as /tmp/newfileSo host can copy a file between 2 containers. Within a container (once logged in) we can only go upto / and cannot cd .. Beyond it. So one container cannot see files of another container.Separate namespaces for processes - Each lxc-start process will spawn lxc-init process wi…

OpenStack cloud service project demo

Image

Setting up Dropwizard

Generate self signed certificate.
$ keytool -genkey -alias selfsigned -keyalg RSA -keystore keystore.jks -keysize 2048Export the keystore as certificate (.crt): $ keytool -export -alias selfsigned -file selfsigned.crt -keystore keystore.jks
Import that certificate into your cacerts, the default Java keystore. You may need to do this as root, or with sudo. Go to the $JAVA_HOME/jre/lib/security directory, and run:
$ keytool -import -trustcacerts -alias selfsigned -file $SSL_FOLDER/selfsigned.crt -keystore cacerts
Put the following config in config.yml of dropwizard:
config.yml: server: adminMinThreads: 1 adminMaxThreads: 64 adminContextPath: /admin applicationContextPath: / applicationConnectors:- type: http port: 8080 - type: https port: 8443 keyStorePath: ./keystore.jks keyStorePassword: password trustStorePath: $JAVA_HOME/jre/lib/security/cacerts trustStorePassword: changeit certAlias: selfsigned adminConnectors:- type: http po…

Setting up OpenStack python SDK on Oracle Enterprise Linux 6

To setup openstacksdk on Oracle VM Server 3.3.3 or Oracle Enterprise Linux 6:

Oracle Enterprise Linux 6 comes with python 2.6.6 by default.

OpenStackSDK requires at least python 2.7 or 3.3.

Following are the steps to upgrade local python to 2.7.10 and 3.5.0 (the latest as of this writing) and install openstacksdk for development.

It is assumed that OpenStack is hosted on the same host where the test program is being executed.

$ sudo su - # cd /etc/yum.repos.d # rm -f * # wget http://public-yum.oracle.com/public-yum-ol6.repo # yum clean all # yum makecache # yum install gcc
The above step may take quite some time and is only required to install gcc. If one already has gcc installed then skip to the following step.

# yum groupinstall "Development tools" # yum install zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel readline-devel tk-devel gdbm-devel db4-devel libpcap-devel xz-devel # cd /usr/src # wget https://www.python.org/ftp/python/2.7.10/Python-2.7.10.tgz # wget https:…

Integrating Morphia and Dropwizard

Recently i had the pleasure of using mongodb's document object mapper framework morphia and the REST webservice framework dropwizard (well it is more than simply for REST but that is the primary purpose of it).

Dropwizard comes with the following essential thirdparty libraries:

Jackson - for JSON parsingJetty - as embedded light weight Java EE web containerJersey - JAX-RS 2.0 implementationand some more...  Morphia has annotations for POJO model classes that can be persisted in mongodb and is a nice framework that simplifies the development of a mongodb client application. At the same time we can use the same POJO model classes for REST endpoint implementations as well. So there is no need to have separate DTO and entity classes. The same POJO model classes are annotated as entities (using morphia's annotations) and as DTO (using Jackson's annotations).
A simple example for such a model class is given below:

@Entity(value = "students" , noClassnameStored = true, c…

Using VNC with Ubuntu on VirtualBox

Create an Ubuntu 64 bit VM on VirtualBox with following specs:CPU - 1Memory - 1GBHDD - 20GB (VDI, Dynamic allocation)Network - NAT with Port forwarding - TCP, 5900 (on local host) forwarded to 5900 (on VM)Download Ubuntu desktop 15.04 and install it on the VM.Once installation completes, search for Desktop Sharing applet. Enable sharing, provide password.Now launch a VNC viewer and specify the IP of the parent host on which VirtualBox is installed with port 5900.If connecting from same host where virtual box is installed then you may use localhost:5900. It will prompt for password then connect.

AngularJS Introduction

AngularJS 1.5

Directive is a marker on an HTML tag that tells Angular to run or reference some Javascript code.
HTML page: <html ng-app="studentModule"><head><link rel="stylesheet" type="text/css" href="css/bootstrap.min.css" /><script type="text/javascript" src="js/angular.min.js"></script><script type="text/javascript" src="js/app.js"></script></head><body class="container" ng-controller="StudentController as s"><ul class="list group"><li class="list group item" ng-repeat="student in s.students"><h3> {{student.firstName}} {{student.lastName}} <em class="pull-right">{{student.emailId}}</em></h3></li></ul></body></html> Javascript: (function() { var app = angular.module('studentModule', []); …