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
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.