Docker – How to Install NodeJS on Docker

This article represents quick instructions on how to install NodeJS on CentOS Docker Image. The detailed instructions of installing NodeJS on linux could be found on this page. Please feel free to comment/suggest if I missed to mention one or more important points. Also, sorry for the typos. Following is the set of instructions: Install the docker on your machine. Pull the Centos docker image Create a container using the Centos docker image. Following command could be used: docker run -ti -dP –name centos -v /c/Users:/mnt/Users centos:latest /bin/bash Start the docker container and attach. Following command can be used: # Starts the docker container docker start centos # Attach docker …

Continue reading

Posted in Javascript, Virtualization. Tagged with .

RPM – How to Build RPM Package

This article represents tips to build RPM package using rpmbuild command. Please feel free to comment/suggest if I missed to mention one or more important points. Also, sorry for the typos. Following are the key points described later in this article: Install RPMBuild Package Instructions to Create RPMs Install RPMBuild Package Make sure that rpmbuild exists. Type rpmbuild in command line and confirm that usage text appears. In case, rpmbuild does not exists, download it using command, “yum -y install rpm-build” Instructions to Create RPMs Create a top level folder such as “rpmbuild” within home directory. Go to rpmbuild folder using command such as “cd rpmbuild” Create following folder within …

Continue reading

Posted in IT Automation. Tagged with .

Docker – How to Install NodeJS on Docker

This article represents quick instructions on how to install NodeJS on CentOS Docker Image. The detailed instructions of installing NodeJS on linux could be found on this page. Please feel free to comment/suggest if I missed to mention one or more important points. Also, sorry for the typos. Following is the set of instructions: Install the docker on your machine. Pull the Centos docker image Create a container using the Centos docker image. Following command could be used: docker run -ti -dP –name centos -v /c/Users:/mnt/Users centos:latest /bin/bash Start the docker container and attach. Following command can be used: # Starts the docker container docker start centos # Attach docker …

Continue reading

Posted in Virtualization. Tagged with .

ReactJS – Controlled Component Code Example

This article represents code sample for ReactJS UI controlled components along with related details. Please feel free to comment/suggest if I missed to mention one or more important points. Also, sorry for the typos. The code sample represents an input field consisting of “Calvin”. Once you change the text, the “calvin” written with “Hello” would also change. Following are the key points described later in this article: What are controlled components? Code Example – Controlled Component What are Controlled Component? As per the ReactJS Form page, An <input> with “value” set is a controlled component. In a controlled <input>, the value of the rendered element will always reflect the value …

Continue reading

Posted in Javascript, Web. Tagged with , .

ReactJS – How to Think & Program Hello World – Part 1

This article represents Hello World example in ReactJS with explanation on how one could think in component-oriented manner when working with ReactJS. Please feel free to comment/suggest if I missed to mention one or more important points. Also, sorry for the typos. Following are the key points described later in this article: Hello World Code Sample Thinking & Programming Hello World Hello World Code Sample Paste the code below in an HTML file and open up in a browser. The text, “Hello, Calvin” will get printed. <!DOCTYPE html> <html> <head> <title>Hello ReactJS!</title> <script src=”https://cdnjs.cloudflare.com/ajax/libs/react/0.13.3/react.js”></script> <script src=”https://cdnjs.cloudflare.com/ajax/libs/react/0.13.3/JSXTransformer.js”></script> </head> <body> <div id=”content”></div> <script type=”text/jsx”> var HelloMessage = React.createClass({ render: function() { return …

Continue reading

Posted in Javascript, Web. Tagged with , .

Docker – How to SSH to Running Container

This article represents instructions on how you could get a docker container connect with other docker container using SSH. Please feel free to comment/suggest if I missed to mention one or more important points. Also, sorry for the typos. Following are the key points described later in this article: Instructions to Install SSH Techniques to Enable SSH on the Existing Container Techniques to SSH to Running Container Instructions to Install SSH If you already have a running container, and you would like to put SSH on it and allow other docker container to connect via SSH, following is a set of instructions to install SSH: ## ## Install the openssh-server …

Continue reading

Posted in Virtualization. Tagged with , .

AngularJS – Two Different Ways to Bind Model Data to HTML Element

This article represents two different techniques using which application data (model) could be bound to HTML element in AngularJS. Either of the technique is used to replace the text content of the specified HTML element with the value of a given expression, and to update the text content when the value of that expression changes. Please feel free to comment/suggest if I missed to mention one or more important points. Also, sorry for the typos. Following are the key points described later in this article: Bind data using {{ expression }} syntax Bind data using ng-bind directive Recommended way of binding data Bind Data using {{ expression }} Syntax Following …

Continue reading

Posted in Javascript, Web. Tagged with , .

How to Install Oracle 11g (EE) on Docker

This article represents instructions on how to install & configure Oracle 11g Database (Enterprise Edition) on Docker. Well, I could have lived with installing Oracle 11g express edition, had I have the requirement of testing my application with Oracle database for single user. The primary reason for installing Oracle enterprise edition was to test the high availability using Oracle Data Guard solution. As we may knowing that Oracle Data Guard does not come with Oracle XE Database, thus, it becomes mandatory to work with Oracle EE Database edition which comes bundled with Data Guard solution. The primary challenge in installing Oracle EE database on Docker is the disk space problem …

Continue reading

Posted in Virtualization. Tagged with , , .

Casperjs Hello World in 10 Minutes

This article represents instructions on how to get started with programming casperjs scripts within 10 minutes. In this article, the sample program is written for scraping Amazon.com homepage and printing title of the page. One of the biggest issues or hurdle, I would say, in getting started with any framework is related with downloading the tool/library, installing and configuring the environment in order to execute the program. Thanks to Docker creators, this is taken care in a very neat manner so much so that one could do following to set up the development environment in literally no time. Download the image of the development environment. Create a Docker container using …

Continue reading

Posted in Javascript, Virtualization, Web. Tagged with , .

Dummies Notes – Get Started with Docker Hello World

This article represents instructions to get started with Docker on Windows. For detailed documentation on Docker, access the Dockers Help page. For detailed instructions on installation of boot2docker, refer following page. Please feel free to comment/suggest if I missed to mention one or more important points. Also, sorry for the typos. Following are the key points described later in this article: What is Boot2Docker? Download & Install Boot2Docker Docker Hello World Configure Putty Environment   What is Boot2Docker? Docker Engine uses Linux-specific kernel features. Thus, to run docker engine on Windows, Boot2Docker application is developed. This application creates a Linux virtual machine on Windows to run Docker on a Linux …

Continue reading

Posted in Virtualization. Tagged with .

Learn R – How to Define Function in R

This article represents code examples in relation with how to write function in R. Please feel free to comment/suggest if I missed to mention one or more important points. Also, sorry for the typos. Following are the key points described later in this article: Function Definition Code Examples for Functions   How to Define Function Function in R looks like following: # Function definition funcName <- function( a, b, c ) { return(v) # or simply v } # This is how a function is invoked var1 <- funcName(x,y,x) In above code, funcName is the name of the function. a, b, c are parameters. v is return variable Code Examples …

Continue reading

Posted in Data Science. Tagged with .

Learn R – How to Create Multiple Density Plots using GGPlot

This article represents code samples which could be used to create multiple density curve or plots using ggplot2 package in R programming language. Please feel free to comment/suggest if I missed to mention one or more important points. Also, sorry for the typos. Multiple Density Curves/Graphs with GGPlot The code samples given below works for “diamonds” dataset which is loaded as part of ggplot2 package. Following are two different types of plots shown below: Density plots with multiple fills Density plot with single fill Density Plots with Multiple Fills:Following code represents density plots with multiple fills. Pay attention to the “fill” parameter passed to “aes” method. # Create density plots for …

Continue reading

Posted in Data Science. Tagged with .

Learn R – How to Create Density Plot over Histogram

This article represents code examples for overlaying or creating density curve on Histogram using ggplot2 package in R programming. Please feel free to comment/suggest if I missed to mention one or more important points. Also, sorry for the typos. Code Samples to Overlay Density Curve on Histogram In the code examples below, diamonds data set belonging to ggplot2 package is used. One must load the ggplot2 package (require(“ggplot2”)) before executing the code samples given below. # Most simplistic density curve ggplot(diamonds, aes(x=carat)) + geom_histogram(aes(y=..density..)) + geom_density() + labs(title=”Histogram & Density Curve”, x=”Carat”) Following diagram would get displayed by executing the above code. # Density curve with histogram painted using body …

Continue reading

Posted in Data Structure. Tagged with .

Learn R – 3 Commands to Generate Random Numbers

This article represents 3 different commands with code examples which could be used to generate random numbers in R programming language. Please feel free to comment/suggest if I missed to mention one or more important points. Also, sorry for the typos. Following are the key points described later in this article: Runif command Sample command Rnorm command Difference between runif and rnorm command Runif: Generate Random Numbers based on Uniform Distribution “Runif” command can be used for generating random numbers based on uniform distribution. One can generate one or more random numbers within a range of numbers. One should note that the random numbers generated using runif commands are all …

Continue reading

Posted in Data Science. Tagged with .

Learn R – Extract Data Frame with One Column

This article represents code sample that could be used to create/extract data frame with one column from existing data frame. Please feel free to comment/suggest if I missed to mention one or more important points. Also, sorry for the typos. Extract Data Frame with One Column In the code sample below, diamonds dataset from ggplot2 package is used. To work with the example below, one needs to load the ggplot2 library using command such as require(“ggplot2”). In the command below, method as.data.frame is used. Make a note of drop=false parameter passed to as.data.frame method. dfn1 <- as.data.frame(diamonds[,c(1)], drop=false)

Posted in Data Science. Tagged with .

Learn R – How to Create Histogram using GGPlot

This article represents techniques (commands samples) which could be used to create histogram using ggplot2 package in R programming. Please feel free to comment/suggest if I missed to mention one or more important points. Also, sorry for the typos. Following is the summary of commands used to create histogram using ggplot: Using simplistic ggplot and geom_histogram method Using ggplot and geon_histogram command with attributes such as col, fill, alpha Using ggplot, geom_histogram and  scale_fill_gradient method Common Techniques to Create Histogram using ggplot2 In the code examples below, diamonds dataset from ggplot2 package is used. To work with examples below, load the ggplot2 library prior to executing the commands given below. …

Continue reading

Posted in Data Science. Tagged with .