Thursday, 10 March 2016

Linux

Linux Basic Commands :

  • uname -a  : Gives us OS information.

IBX AIX :
vi : Esc + x - to delete data
vi : Esc + I  - insert data

  • chmod 777 <file/directory>
0 – no permission
1 – execute
2 – write
3 – write and execute
4 – read
5 – read and execute
6 – read and write
7 – read, write, and execute

  • sudo - super user do - Sue dough
 Have you ever tried to run a command in terminal only to be given “Access Denied?”  Well this is the command for you!  But, with great power comes great responsibility!  It is much better than logging in as root, or using the su “switch user” command.

sudo –b will run the command in the background.  This is useful for commands that display a lot of output as they are running.
sudo –s will run the shell specified with elevated privlages, giving you the # prompt (don’t forget to exit!)
sudo su – will make you the root user and load your custom user environment variables.

https://linuxacademy.com/blog/linux/linux-commands-for-beginners-sudo/

  • ps -ef | grep <processName>
  • ps aux | grep <processName>
To run a file having different user priviliges:
sudo su -c "sh elasticsearch" -s /bin/sh aneela1
sudo -b su -c "sh elasticsearch" -s /bin/sh aneela1  - to run it background
sudo -b su -c "sh kibana" -s /bin/sh aneela1

something.sh -d -p pid    -to run a process as demon
ls -ltr | wc -l    -to see no of files existing

Monday, 29 February 2016

Cloud Introduction

Different flavors of Cloud:
IAAS -
SAAS -
PAAS -

OpenShift is a cloud Platform-as-a-Service (PaaS) developed by Red Hat. 
OpenShift Online is Red Hat's public cloud application development and hosting platform
 

Apache Axis Web Services


Apache Axis is an implementation of the SOAP ("Simple Object Access Protocol") submission to W3C.

From the draft W3C specification:
SOAP is a lightweight protocol for exchanging structured information in a decentralized, distributed environment. It is an XML based protocol that consists of three parts: an envelope that defines a framework for describing what is in a message and how to process it, a set of encoding rules for expressing instances of application-defined data types, and a convention for representing remote procedure calls and responses.

People are moving from Axis 1.4 to CFX since Axis 1.4 is too old.

is Axis 2 and CFX , both are same ? If they are different, then what is Axis2 and CFX.

CXF is a viable alternative to Axis. With CXF you can develop both SOAP and REST web services.
CXF implements both the JAX-WS and JAX-RS standards.


Web Services Development Frameworks - Apache Axis 2 , Apache CFX and Spring WS

Thursday, 4 February 2016

Maven Introduction



There are basically four types of repositories involved
  1. Local Repositories
  2. Global Repositories
  3. Project Repositories
  4. Custom Repositories

A snapshot version in Maven is one that has not been released. The idea is that before a 1.0 release (or any other release) is done, there exists a 1.0-SNAPSHOT . That version is what might become 1.0 . It's basically " 1.0 under development".

Downloading in Maven is triggered by a project declaring a dependency that is not present in the local repository (or for a SNAPSHOT, when the remote repository contains one that is newer). By default, Maven will download from the central repository.

Maven central repository : http://repo.maven.apache.org/maven2/
Maven central repository : http://central.maven.org/maven2
Maven central repository : http://uk.maven.org/maven2/

Maven Plug-In repository : http://repo1.maven.org/maven2/org/codehaus/mojo/


Maven reads both global settings as well as user setting file when you trigger install

C:\Users\vnemalik\Documents\001096043\b2b\code_base\newCodeHub\RB-2016.08.x>mvn clean install -X

Picked up JAVA_TOOL_OPTIONS: -Djava.vendor="Sun Microsystems Inc."
Apache Maven 3.2.5 (12a6b3acb947671f09b81f49094c53f426d8cea1; 2014-12-14T22:59:23+05:30)
Maven home: C:\Users\vnemalik\Documents\001096043\soft\apache-maven-3.2.5\bin\..
Java version: 1.8.0_60, vendor: Sun Microsystems Inc.
Java home: C:\Users\vnemalik\Documents\001096043\soft\jdk1.8.0_45\jre
Default locale: en_US, platform encoding: Cp1252
OS name: "windows 7", version: "6.1", arch: "x86", family: "dos"
[INFO] Error stacktraces are turned on.
[DEBUG] Reading global settings from C:\Users\vnemalik\Documents\001096043\soft\apache-maven-3.2.5\bin\..\conf\settings.xml
[DEBUG] Reading user settings from C:\Users\vnemalik\.m2\settings.xml


Monday, 1 February 2016

Regular Expressions

.   - Matches each and every character. 

bananas? - The last letter of the word is optional.


foo(bar)? - The enclosed string is optional.


1234?5678 - The digit 4 is optional.


[7-9] - Matches against numbers from 7-9.


[a-zA-Z0-9] - Matches against all alphanumeric characters/numbers.

fo+ - Letter 'O' can be repeated as many as number of times.


test(ing|er|ed)? - The word test can ends with ing , er or ed.


b(a|e|i)d - The middle letter of the word can be a,e or I.


[a-zA-Z1-9_]+@[a-zA-Z1-9]+\.(org|com|net) - Expression to validate Email address.

[a-z]{2} - No of times the characters can be repeated.

[a-z]{1,2} - No of times the characters can be repeated.

^foo$ - Starts with 'f' ends with 'o'


^\s* -  means any line beginning with whitespace.

(?:https?:\/\/)?(?:[a-zA-Z0-9])+\.(?:com|org|net) - Expression to evaluate web url.


<a href=["']([a-zA-Z1-9://\.]+)["']>(.+)<\/a> - Expression to evaluate hyper link



Following link is the excellent link where you can check the regular expressions. Also validate your expressions in very short time.

http://www.regexr.com/

Sunday, 31 January 2016

Maven Deploy Plug-in

<plugin>
      <!-- explicitly define maven-deploy-plugin after other to force exec order -->
      <artifactId>maven-deploy-plugin</artifactId>
      <executions>
        <execution>
          <id>deploy</id>
          <phase>deploy</phase>
          <goals><goal>deploy</goal></goals>
        </execution>
      </executions>
    </plugin>
  </plugins>
</build>

Monday, 16 November 2015

How to check wheather file exists

checking the code
        String filename = "test01.xml";
        URL url = getClass().getResource(filename);

        File file = new File(url.toURI());
        log.info("File exists: {}", file.exists());