How to automatically recover Tomcat from crashes

Saturday, September 17, 2016

How to automatically start Tomcat if tomcat automatically down :-

There are 2 Process :-

1. if your tomcat running via /etc/init.d/tomcat than we can use below shell script

#! /bin/sh 
SERVICE=/etc/init.d/tomcat 
STOPPED_MESSAGE="Tomcat Servlet Container is not running." 
 
if [ "`$SERVICE status`" == "$STOPPED_MESSAGE"]; 
then 

  $SERVICE start 

fi 



2. if I don’t have /etc/init.d/tomcat* script than use below shell script


#! /bin/sh   
CATALINA_PID=/var/run/tomcat.pid; export CATALINA_PID

TOMCAT_HOME=/usr/local/tomcat   
if [ -f $TOMCAT_HOME/bin/tomcat.pid ] 
then 
  echo "PID file exists" 
  pid="`cat $TOMCAT_HOME/bin/tomcat.pid`" 
  if [ "X`ps -p $pid | awk '{print $1}' | tail -1`" != "XPID"] 
  then 
    echo "Tomcat is running" 
  else 
    echo "Tomcat had crashed" 
    $TOMCAT_HOME/bin/startup.sh 
  fi 
else 
  echo "PID file does not exist. Restarting..." 
  $TOMCAT_HOME/bin/startup.sh 
fi



Set your cron job via
crontab -e 

# monitor tomcat every 10 minutes 
*/10 * * * * /root/recover-tomcat.sh

or

# monitor tomcat every 2 minutes  
*/2 * * * * /root/recover-tomcat.sh  

 

Read more...

6 Graphical Interface for Git Client in Linux

Friday, September 9, 2016

6 Graphical Interface for Git Client in Linux : -

1. Git-cola :-
Git-cola comes with the usual pull, push, commit functions. and comes with a diff-viewer and file staging mode.



we can install Git Cola In Ubuntu via below command:-

sudo apt-get install git-cola

2. Gitg :-
Gitg comes commit changes and view the repositories in graphical display. and comes with diff viewer and a file browser.



we can install Gitg In Ubuntu via below command:-

sudo apt-get install gitg

3. SmartGit :-
SmartGit comes with pull, push, commit, track changes, clone, stage, branch and access remote repo. and also comes with support for GitHub, Beanstalk, Codebase and Unfuddle. it doesn’t work with BitBucket.



we can install SmartGit In Ubuntu via below steps :-

1. Download SmartGit.

2. Extract the tar file to your home folder.

3. Open a file manager and navigate to the bin folder inside the smartgit directory. Open the “smartgit.sh” file with a text editor.

Change the line

#SMARTGIT_JAVA_HOME=/usr/lib/java
to

SMARTGIT_JAVA_HOME=/usr/lib/jvm/java-1.6.0-openjdk/jre
At the last line of code, change the line:

$_JAVA_EXEC $_VM_PROPERTIES -Xmx${MAXIMUM_HEAP_SIZE} -Dsmartgit.vm-xmx=${MAXIMUM_HEAP_SIZE} -jar "$SMARTGIT_HOME/lib/smartgit.jar" "$@"
to

$_JAVA_EXEC $_VM_PROPERTIES -Xmx${MAXIMUM_HEAP_SIZE} -Dsmartgit.checkIncompatibleJava=false -Dsmartgit.vm-xmx=${MAXIMUM_HEAP_SIZE} -jar "$SMARTGIT_HOME/lib/smartgit.jar" "$@"
Save the file and close it.

4. Lastly, click the “smartgit.sh” file and select Run when prompted.


4. Giggle :-
Giggle comes with view the files and changes that you have previously committed, but you are not able to commit changes or pull/push from/to the git server.



we can install Giggle In Ubuntu via below command:-

sudo apt-get install giggle

5. Git Gui :-
Git Gui comes with stage, merge, commit, push changes to the remote server. It might not have a long feature list as SmartGit.



we can install Git Gui In Ubuntu via below command:-

sudo apt-get install git-gui

6. qGit :-
qgit is a git viewer based on the qt framework.



it comes with a diff viewer and a revision log viewer, and you can easily switch between both. also create Actions to pull, push, commit the changes rather than doing it on the terminal or other git client.

Read more...

Methods of Domain Control Validation (DCV)

Methods of Domain Control Validation (DCV) : -

All Comodo certificates must pass through DCV. before they are issued. Domain Control Validation is a mechanism used to prove ownership or control of a registered domain name.

There are 3 mechanisms for Domain Control Validation:

1. eMail-based DCV (Traditional) :-
You will be sent an email to an administrative contact for your domain. The email will contain a unique validation code and link. Clicking the link and entering the code will prove domain control.

Valid email addresses are:
Any email address which our system can scrape from a port 43 whois check;

The following generic admin type email addresses @ the domain for which the certificate is being applied:
admin@
administrator@
postmaster@
hostmaster@
webmaster@

2. DNS CNAME-based :-
The CSR you submit to Comodo will be hashed. The hash values are provided to you and must be entered as a DNS CNAME record for your domain.

The hashes are to be entered as follows:

.yourdomain.com. CNAME .comodoca.com.


Note: Please take notice the trailing period/fullstop at the tail end of each of the TLDs as this is required to make the entry fully-qualified.

Note2: yourdomain.com in the example above (and below in the HTTP(S) method instructions) means the Fully Qualified Domain Name (FQDN) contained in the certificate. If you are ordering a MDC or UCC certificate, separate CNAME records must be created for EACH FQDN in your order.

Examples:
.subdomain1.yourdomain.com. CNAME .comodoca.com.
.subdomain2.yourdomain.com. CNAME .comodoca.com.


3. HTTP(S)-based DCV :-
The CSR you submit to Comodo will be hashed. The hash values are provided to you and you must create a simple plain-text file and place this in the root of your webserver and served over HTTP-only! 

The file and it's content should be as follows:
http://yourdomain.com/.txt

Content (as a plain text file): 

 
comodoca.com

Note: The DCV will fail if any redirection is in place.

Note 2: yourdomain.com in the example above (and in the CNAME method instructions; above) means the Fully Qualifed Domain Name (FQDN) contained in the certificate. If you are ordering a MDC or UCC, each FQDN in the certificate MUST have the TXT file in place in its root folder.

Examples: 
     subdomain1.yourdomain.com/.txt
     subdomain2.yourdomain.com/.txt


this content is powered by comodo.com. and ref source of this article is below.
https://support.comodo.com/index.php?/Default/Knowledgebase/Article/View/791/0/alternative-methods-of-domain-control-validation-dcv

Read more...

Connecting mobile with display to tv

Connecting mobile with display to HD TV :-

 to connect mobile screen to TV/ projector for live demo purpose.

There are 3 ways to get this working - wired; wireless devices; wired/wireless with apps/ emulators. Among these, wired is the best - no lag and maximum reliability.

Wired:-
Slimport to hdmi cable - This is the best solution however there are few things to note.
Works with only a few devices; check the list here - http://www.slimportconnect.com/slimport-supported-devices/ I personally prefer a (refurbished) Nexus 5 for this (~$100 on Amazon). Fire HD 6 tablet is a cheap tablet (~$69) that works with this.
Not every HDMI cable works with this - HDMI 1.4 or above should work which practically means all the recent HDMI cables but I carry a compatible one just to be on the safer side.
HDMI to VGA converter paired with VGA cable doesn't work.
Slimport to VGA cable paired with VGA cable doesn't work for me.
MHL to hdmi cable - This is as good as the previous one. Only issue is that there are different standards within MHL compatible devices so cable-device combination needs to be carefully chosen. I use this one https://www.amazon.com/Aibocn-Adapter-Samsung-Galaxy-N9008V/dp/B00DUCB65I/
Supported devices - http://www.mhltech.org/devices.aspx?tid=1


Wireless:-
WiDi - This is like Chromecast but better; creates its own network. Works with Oneplus one/ Surface and other Wifi Direct compatible phones. Standards and compatibility all over the place. I use this one - https://www.amazon.com/gp/product/B00O14JG2Y/ref=oh_aui_detailpage_o05_s00?ie=UTF8&psc=1 with Oneplus phones.
Chromecast - Laggy, depends on wifi strength; not recommended.
Apps/ Emulators:
Laggy, high latency, has never worked satisfactorily for me.
Popular apps - Airdroid 3, Vysor, Mirror
PFB a note prepared by Arpit on how to use this.

Other:-
Chromebooks will soon be able to run play store apps; this can be a good solution in 3-6 months' time-frame.
App runtime for Chrome - ARC; this should work but hasn't for me. https://developer.chrome.com/apps/getstarted_arc
USB-C to hdmi / displayport - This should be ubiquitous in an year's time. This is a really good solution but currently only few devices support it a la HTC 10


Note on screen mirroring using ADB

Phones
1. We are using MotoG 3rd Gen devices. Everyone can collect them from Priyanka tomorrow at their own convenience.

2. Everyone should install their respective apps / demo content on their phones

3. Please ensure that USB debugging is enabled on the phones. For detailed instructions on activating USB debugging, please visit http://www.gizmotimes.com/smartphones/how-to/turn-usb-debugging-mode-on-moto-g-3rd-gen/1436

Macs
1. Please install Chrome browser on your systems (if not already installed).

2. Install Vysor chrome app from https://chrome.google.com/webstore/detail/vysor-beta/gidgenkbbabolejbgbpnhbimgjbffefm

Mirroring
1. To mirror the phone on the laptop screen, connect the phone to the laptop via USB and start the Vysor app.

Read more...

About This Blog

Lorem Ipsum

  © Copyright 2009 Linux-HelpLine.Blogspot.com

Back to TOP