Artikel Terbaru

Monday, 21 November 2016

Gulp javascript build automation tool overview

What is gulpjs build tool


Gulpjs is java script open source framework for automating the build tool for java script applications written in Node.js, angular and other java script frameworks.Gulp uses pipe streams concepts to improves the performances of the tasks

Gulp features


Gulp is plugin based architectures which provides different plugins for doing the tasks
GuplJS is command line JavaScript task runner which do the below collection of tasks.
Each tasks we can configured gulp plugin
  • · Minification of javascript files to remove spaces
  • · Concatanation
  • · Copying files 
  • · written in javascript
  • · Javascript compilation
GulpJS supports all browser and all operation systems

How to install gulp JavaScript tool


To install gulp JS too, Node js need to be installed

npm install -g gulp

npm is node package manager, -g option indicates install the package available globally
npm command retrieve the gulp package from node registry repository and installs local to your system, so that gulp can be accessed using command line.
Use below command to check whether gulp is installed or not

Gulp –v

How to add gulp to your javascript application


And also we can also use –save-dev option to npm command to install the dependencies

npm install --save-dev gulp


the above command add the dependency to package.json

Sunday, 7 August 2016

XML and JSON basics

JSON Basics:-

JSON is java script Object notation. JSON is independentent format for exchaning data JSON is simple format which contain key pair values. JSON and xml are data formats used to transfer data between different systems of enterprise applications . JSON is lightweight and simple to read

JSON Sample data file

{ "id" : 1.0, "name" : "Kiran", "sal" : 5000, }
     {
        "id" : 1.0,
        "name" : "Kiran",
        "sal" : 5000,
    }

XML Basic meaning:-

XML is extensive markeuplanguage which start and end tag and follows certain data validations. XML file can be validates with XML Schema. XML files has data attributes. Reading xml is very easy as most of browsers and editors support simple clicable readable format.

xml sample data file:

Sub tag
Most of companies which offers REST APIS expose the data in either XML or JSON. Clients consume those REST API's and use programming technicque to process xml/json data XML and JSON data can be read easily by programmers. Both xml and json are not similar. There are many ways to convert xml to json
We have many ways to convert json to xml in java

How to convert json to xml in java

com.gson.gson library provides for reading JSON object and XML class will convert into XML object
import org.json.JSONObject;
import org.json.XML;

public class JsonToXmlConvert {
 public static void main(String[] args) throws Exception {
  String jsonObject = "{'json key':'json value'}";  
  JSONObject json = new JSONObject(jsonObject);
  String xml = XML.toString(json);

 }
}

Wednesday, 13 July 2016

Top Yum command examples - linux tuorials

What is yum in linux?

Yum abbrivates as Yellowdog Updater Modified a free tool for managing packages in redhat Unix as well as CentOS. yum is popular packaging tool to manage the different packages in linux. Yum do install,update, remove the packages or rpm's in red hat and Cent OS Unix yum is similar apt-get tool in ubuntu operating system. yum install the dependencies automatically yum download the temporary files and store under /var/cache/yum folder, Once yum operation is finished, the data will be deleted. We will see the different yum examples in the following article


yum install command in linux - how to install package or rpm in unix

with yum install command, We can install package or rpmm in linux. We can also specify the multiple package names with separted space
yum install package-name
yum install package-name1 package-name2

yum uninstall command in linux - how to uninstall package or rpm

With yum remove compand, it removes the packages from system. We can also specify the multple packages in command
yum remove package-name
yum remove package-name1 package-name2

yum list command in linux - show list of installed packages

yum list all - show list of all packages
yum list package-name - show list of all packages for package
yum list package* - show list of packaes that name starts with package


yum update command in linux - update package with latest version

with yum update comand, It update all the packages with latest version if we need, we can update specific package
yum update
or 
yum update package-name

yum update command in linux - update package with latest version

yum clean command in linux - remove cache

Yum automatically clean the cache. use yum clean command to clear the cache manually, yum clean all finally yum help command Use
man yum
That about yum. If you like my arcticle please share to social media.

Sunday, 10 July 2016

Top nodejs node and npm command line tools tutorials

Basics of Nodejs Server



Nodejs is server platform for deploying web applications using java script. Nodejs server is very famous in current industry for asynchronous request processing We can use nodejs for streaming based applications. NodeJS is free and opensource application to develop server side applications
Nodejs is popular because of event driven and modularity based architecture


Nodejs installation comes node and node packaging manager (NPM) tools

How to find out nodejs server version in command line?

Nodejs version can be found using node command line tool. Node command displays the output to console as shown below node command with option -v or --version. node with option -v does not worked, use node with --version command

A:\nodework>node --version

v6.2.2

A:\nodework>node -v
v6.2.2


How to display out npm  tool version of nodejs server in command line?

npm version can be found using npm command line tool. npm reports result to console as shown below

Npm version will be showing using -v option or --version

A:\nodework>npm --version
3.9.5


A:\nodework>npm -v
3.9.5


How to get nodejs v8 server engine version in command line?

Nodejs built with google v8  javascript server engine. This is main engine for event driven feature. This is developed by google chrome team. V8 server engine basically compiles javascript code to native machine code. V8 code can be executed in browser as well as independent applications. V8  also used in monogdb


A:\nodework>node -p process.versions.v8
5.0.71.52

How to install packages/dependencies in nodejs environment?

Nodejs is popular for managing different  modules and packages. Npm install is usted to install to install packaeges
npm packages can be installed locally or globally. Based on the need of the requirement, We can go in anyway

how to do npm package install locally?

npm command install the packages locally by default. Npm install command copy the package contents to node_modules folder. To test whether package installed or not, Check packagename folder exists under node_module folder and make sure that packagename.json exists
npm install packagename

how to do npm package install globally?

npm command uses -g option to install package globally. package name contents shared under nodejs node_modules folder

npm install -g packagename

how to add packages using npm install --save option?

packages dependencies are not added to default under package.json in your application. with using --save option, depndencies are added to package.json under application code
npm install  packagename --save

and the output will be like the below content in package.json

{
name:package,
version:0.1,
dependencies
{sub_dep:0.1
}}

That's all basic nodejs commands. Please comment and share this post if you liked it.

how to do remote ssh connection to openshift using putty?

What is Openshift service?

Openshift is a platform as a server PAAS developed by Redhat company. Basically openshift is a cloud  computing platform provider for managing application development using several languages like php and nodejs framework. In current market cloud is famous buzz word with similar like amazon webservices.


OpenShift has different plans. You can choose plan based on your requirement. 


Openshift provides free plan which gives access to 3 small gears without credit card. So you will develop applications using your favorite language and can deploy to openshift cloud, map this hosted application to your domain created in other domain registers like godaddy.


OpenShift platform features and advantages

  • Applications development and deployment
  • Hosting provider 
  • Support different languages,databases and tools
  • No credit card required to jump start in
Once OpenShift selected, First step is to register in openshift online platform, you will get access to set of tools and all features above.

First you need to create application, In my case i created  online application by choosing PHP language and MySQL database.  your gear machine is created. We wlli see below how we login to Openshift gear. We will have different options to connect to Openshift


Remote SSH connection to Openshift via putty in windows

First you need putty, puttygen tools to connect to openshit gear.

Putty introdution


Putty is free client tool. It provides console to connect to different remote linux and ubutu systems.It supports different ssh,http Fttp protocals and authorization technique to connect remote server securely. You can download this tool from putty site.

puttyGen introduction

PuttyGen is also free opensource tool which you get as part of putty installation. It can be used to generate private and public keys to connect to remote server


With putty and puttyGen installed on your windows system. First Open puttyGen tool to generate private key

Generate private Key using PuttyGen client tool


PuttyGen tool is opened selecte SSH-2 RSA key type and finaly click to generate random key.

Random key generated by moving mouse over space as per given black rectangle shape

Generate public Key using PuttyGen client tool


Nex step, PuttyGen generated private key as shown below


generated public private key pair using PuttyGen

Save the private key to your windows file system which can be used in putty tool configuration

Go to OpenShift online  setting , create a public key as like below by coping the from above screenshot to below text area and save it.

add public key in openshift online settings


That's from openshift settings, Now your machine in openshift is ready to receive remote ssh connection. Next step is open putty tool,

Openshift source gear settings

copy the source code gear address with random password

openshift ssh remote connection using putty


After you click on open, You are able to connect to openshift gear in  windows using SSH Client tools. Please comment if you have any difficulty to do remote connection togear