Saturday 16 April 2016

linux export not a valid identifier

-bash: export: `=': not a valid identifier

Hen making an export. remove the in between spaces.

export JAVA_HOME = "/usr/...". (with spaces)

export JAVA_HOME="/usr/profile" (without spaces).

Find Out Which Process Is Listening Upon a Port

Find Out Which Process Is Listening Upon a Port

for check what port the tomcat server is using

use : netstat – a command-line tool that displays network connections, routing tables, and a number of network interface statistics.

ex : netstat -tulpn

Get a list of the installed services in linux


Get a list of the installed services in linux

To get a list of the installed services on the shell, you may use this command linux

chkconfig --list

start,stop tomcat server on linux

start tomcat server on linux

command : sudo service tomcat start

stop tomcat server on linux

command : sudo service tomcat start

Re-start tomcat server on linux

command : sudo service tomcat restart


Find Out Which Process Is Listening Upon a Port

check what port the tomcat server is using

use : netstat – a command-line tool that displays network connections, routing tables, and a number of network interface statistics.

ex : netstat -tulpn

REF: cybercitz

Jenkins GitHub Hooks Problems


GitHub Hooks Problems

1)
This page shows hooks problems and ignored projects. You can view detailed stacktrace of any problem in system log. For better debug in jenkins interface, enable this logs:

com.cloudbees.jenkins.GitHubWebHook - ALL
org.jenkinsci.plugins.github.webhook.WebhookManager - ALL
org.jenkinsci.plugins.github.admin.GitHubHookRegisterProblemMonitor - ALL
This table shows problems with registering/removing hooks for corresponding repo. Message will be dismissed if Jenkins will receive PING hook for repo, or if you add this repo to ignore list. This messages will not be saved to the disk, so all of them will be
cleared after jenkins restart

1.a)
github.com:username/repo There is no credentials with admin acces
s to manage hooks on GitHubRepositoryName[host=github.com,username=username,repository=repo]

solution :
1) go to jenkins homepage.
2) click on manage jenkins
3) click on configure system
4) go to
GitHub -> GitHub Servers
uncheck "manage hooks"
5) restart the jenkins


Ref : stackoverflow 

Friday 15 April 2016

Failed to connect to repository : Could not init /tmp/hudson

Failed to connect to repository : Could not init /tmp/hudson

1) There's no such executable git in PATH: /sbin, /usr/sbin, /bin, /usr/bin.
In the jenkins job section.
Advanced...
Source Code Management.
got git.
2) Failed to connect to repository : Could not init /tmp/hudson

solution : please install git(as below ) or provide the git exe file path (/usr/bin/git).  

Install git on linux.

command : sudo yum install git-all

ref : https://git-scm.com/book/en/v2/Getting-Started-Installing-Git

now check the git version.
cmd : git --version

Know tomcat version on linux

Know tomcat version on linux

sudo rpm -qa | grep tomcat

output : tomcat-7.x.x.

Create job in jenkins

Create job in jenkins

1) Go to jenkins homepage
2) create job/New item.
3)Create a item name an choose type of project you want it can be.
a) Freestyle project
b) Maven project
c) External Job
d) Multi-configuration project
e) Copy existing Item
we are using option b.
3) In the configuration page fill following
a) Maven project name
since we are using github repository as CVS. Install the plugin if not avaialble.
to install github plugin
a.1) go to jenkins->manage plugin->manage plugin->search from "github plugin" from available plugin. check and install.
b)  click on "GitHub project" provide project URL. and description.
c) Source Code Management.
c.1) choose project URL of the github
c.2) and enter the username and pwassoer of the repositroy (define it global/system)
d)Build Triggers choose
d.1)Build whenever a SNAPSHOT dependency is built
d.2) Build when a change is pushed to GitHub
e) Build
e.1) root pom.xml
e.2) Goals and options (clean and install)
f) Intall tomcat plugin for Capitomcat plugin deploy the WAR file to multiple remote Tomcat servers.
g) install “Deploy to container Plugin" to deplloy the war file in tomcat container.
This plugin takes a war/ear file and deploys that to a running remote application server at the end of a build
h) In the post build action choose "Deploy to container Plugin"

1) 

javax.mail.MessagingException: Could not connect to SMTP host: smtpout.secureserver.net, port: 465;
  nested exception is:
javax.net.ssl.SSLHandshakeException: Remote host closed connection during handshake


2)  Check username and password are correct or not

javax.mail.AuthenticationFailedException: 535-5.7.8 Username and Password not accepted. Learn more at 535 5.7.8  https://support.google.com/mail/answer/14257 q4sm64058194pfi.94 - gsmtp


3) an error occurred while sending mail (534-5.7.14 redmin gmail

step 1) go to select Access for less secure apps as "turn of"

step 2)  go to and  Allow access to your Google account : click on continue
REF : Stackoverflow

JDK installations in jenkins


error : /usr/java/jdk1.8.0_45 is not a directory on the Jenkins master (but perhaps it exists on some slaves)


Set the path JAVA_HOME : /usr/java/jdk1.8.0_45




Install maven on redhat linux

Install maven on redhat  linux

wget : to retrieve content from server

REF : maven mirror

1) wget http://mirror.olnevhost.net/pub/apache/maven/binaries/apache-maven-3.2.1-bin.tar.gz

1.1)
create the apache-maven if not exist.
command :
sudo mkdir -m a=rwx /usr/local/apache-maven

1.2) Go to apache-maven directory and execute the command.
maven

1.3) extract the file
command : tar xvf apache-maven-3.2.1-bin.tar.gz

1.4) export the path
1.4.1) export M2_HOME=/usr/local/apache-maven/apache-maven-3.2.1
1.4.2)export M2=$M2_HOME/bin
1.4.3) export PATH=$M2:$PATH

1.5) verify maven version
mvn -version

output :

Maven home: /usr/local/apache-maven/apache-maven-3.2.1
Java version: 1.8.0_45, vendor
Java home: /usr/java/jdk1.8.0_45/jre
Default locale:
OS name: "linux",

REF : 1) stackoverflow
           2) linux

Thursday 14 April 2016

Basic of UML diagram

Basic of UML diagram

Actors :  It can be a role played by the user or who is participating.
REF :
1)  wikipedia Actor_(UML) 
2) actor
userCase : define the functionality/operation to be perfomed.

Ex : We have a customer and want to open an account at a bank.

Let us look at use case "open account" which will perform  operation to create an account. while the actor is customer who want an bank account.

Extenal tool for creating the UML : draw.io
Main ref : UML


Manage the users in jenkins

Manage  users in jenkins :

1) go to jenkins page
2) go to "configure global security"
3) go to authorization select the option "Matrix-based security"
if no user is added, add the user/group and define access level of user/group like
a) be admin
b)  manage domains
c) slave
d) jobs
e) run and view
4) to check if new user is added or not
a) go to jenkins home page.
b) click on people
c) see the user.



Wednesday 13 April 2016

security configuraton in jenkins

security configuraton in jenkins

1) click on manage jenkins

2) From the list of option choose "Configure Global Security".
this will allow user Secure "Jenkins" and  define who is allowed to access/use the system.

3) Click on Enable security
(If enabled, you have to login with a username and a password that has the "admin" role before changing the configuration)
options :
a) TCP port for JNLP slave agents
a.1) Jenkins uses a TCP port to communicate with slave agents launched via JNLP
a.2) Alternatively, you can specify the fixed port number so that you can configure your firewall accordingly.
a.3) Disable remember me : Select this option to remove the “Remember me on this computer” checkbox from the login screen.

4) Access Control
4.1) Security Realm
options :
a) Delegate to servlet container :  Use the servlet container to authenticate users, as per defined by the servlet spec.
b)  Jenkins’ own user database : Use Jenkins's own user list for authentication, instead of delegating that to an external system. for small system .
c)  LDAP :

5) Authorization
a) Anyone can do anything :
b) legacy mode
c) Logged-in users can do anything
d) Matrix-based security : In this scheme, you can configure who can do what by using a big table.
e) Project-based Matrix Authorization Strategy
(This allows you to say things like "Joe can access project A, B, and C but he can't see D." See the help of "Matrix-based security" for the concept of matrix-based security in general. ACLs are additive, so the access rights granted below will be effective for all the projects.)

6)
click on save  and will be redirected to signup page, provide the details and login


Getting started with Facebook oauth2 api using postman

Facebook oauth2/

go the facebook developer
URL : https://developers.facebook.com/
Login/register
Register as facebook developer and click on basic setup

a) Create a New App ID  by providing the basic details and submit
b) get the appid , api version, app secret, Client Token
c) Enter the above details in postman client.
c.1) auth URL : https://graph.facebook.com/oauth/authorize
c.2) Access Token URL : https://graph.facebook.com/oauth/access_token
c.3) client id : "facebook App ID"
c.4) client secret : "facebook app secret "

d) You will be redirected to linked page
Authenticating the LinkedIn Account
enter the credentails and allow access

to access basic profile of the user

ex :  https://graph.facebook.com/me?access_token="genrated token"

append genrated token.

e) weill be able to see basic user details as response

Tuesday 12 April 2016


Getting started with linkedin api using postman

1) Create an application on linkedin
url : https://www.linkedin.com/secure/developer?newapp=

2) provide the details OAuth 2.0
Authorized Redirect URLs for postman :
URL : https://www.getpostman.com/oauth2/callback

REF : postman helpers (https://www.getpostman.com/docs/helpers)
 

3) Get the Authentication Keys.
a) Client ID:
b) Client Secret:

4) start the postman client
a) go to authorization select the OAuth 2 fill the following

Auth URL :  https://www.linkedin.com/uas/oauth2/authorization
Access Token URL :  https://www.linkedin.com/uas/oauth2/accessToken
Client ID : "provide the genrated client id"
Client Secret : "provide the genrated client secret"
Scope : r_basicprofile
Token Name : TokenName
Grant Type :  Authorization code

and click on : request access token locally

5) now click on Request token

6) You will be redirected to linked page
Authenticating the LinkedIn Account
enter the credentails and allow access

org.apache.catalina.LifecycleException: Failed to start component [StandardServer[8005]]A child container failed during start

solution : clean the tomcat server on eclipse and restart the server.


Monday 11 April 2016

Find the folder in ubuntu.

"find" is the command to find the folder or directory.

ex : find / -name "voice"
Jenkins installation on redhat for aws

REF  : wiki.jenkins-ci.org