Monday, December 5, 2016

Java Alternative Version For Ubantu

Choose Java Alternative Version :

When we have got multiple versions of Java installed, we can choose which one you want to use by running the update-alternatives command.
Running below command shows a list of installed Java JDKs and JREs allowing one to be selected as the default that is used when java needs to be executed.
$ sudo update-alternatives --config java
There are 2 choices for the alternative java (providing /usr/bin/java).

Selection Path Priority Status
------------------------------------------------------------
0 /usr/lib/jvm/java-6-openjdk/jre/bin/java 1061 auto mode
1 /usr/lib/jvm/java-6-openjdk/jre/bin/java 1061 manual mode
* 2 /usr/lib/jvm/java-7-openjdk-amd64/jre/bin/java 1051 manual mode

Press enter to keep the current choice[*], or type selection number: 2
To choose a default javac compiler, run the following command.
$ sudo update-alternatives --config javac
If we prefer to use a gui instead of the command line, we can execute galternatives instead and define the default versions of software with the following dialog.
$ sudo galternatives

Saturday, December 3, 2016

Eclipse IDE - If server option is disable due to some issue

If server option is disable due to some issue when we configure tomcat then..
  1. Close Eclipse
  2. In {workspace-directory}/.metadata/.plugins/org.eclipse.core.runtime/.settingsdelete the following two files:
    • org.eclipse.wst.server.core.prefs
    • org.eclipse.jst.server.tomcat.core.prefs
  3. Restart Eclipse

Friday, November 11, 2016

Rotate Tomcat catalina.out (If catalina.out becomes bulky in size, tomcat crashes and fails to start without any error message)

Rotate Tomcat catalina.out

If catalina.out becomes bulky in size, tomcat crashes and fails to start without any error message. 

To avoid this scenario you should rotate catalina.out frequently. 

Step - 1)
create file [any directory] with name "tomcatrotate"

Step - 2)
add content

/opt/apache-tomcat-7.0.67/logs/catalina.out  {
compress
copytruncate
daily
dateext
dateformat %Y-%m-%d
extension .out
missingok
rotate 14
size 100k
su root root
}

Step – 3)
after move to - /etc/logrotate.d/
sudo cp -i /home/minesh/Downloads/tomcatrotate /etc/logrotate.d/

Step - 4)
change the permission 777 to 644
sudo chmod -R 644 lportal

Step – 5)
after this test with below command it will do empty catalina.out and create its catalina2016-11-11.out.gz.

sudo /usr/sbin/logrotate -vf -s /var/log/logrotate-status /etc/logrotate.d/tomcatrotate

special thanks : https://masterinwebdev.blogspot.in/2016/11/tomcat-catalina.html

Sunday, May 31, 2015

Ubantu - Devloper Software Regarding Command

Basic Command:

To Inatall dpkg
sudo dpkg -i <softwareName.deb>

Extract Tar
sudo tar xzvf <softwareName.tar.*>

Permissio To user
1)chown -R <UserName> <Folder Name> →owner read permission is roll back and write permission→super user command
2.1)chmod -R 777 <Folder Name> → full permission → super user command
2.2)sudo chmod -R 777 *

To Remove Folder
echo $PATH
sudo rm -rf <folderName/filename>

Super User Login
sudo -i

To Exit Super User Login
exit

To See Hidden Folder
ctrl+H

To Move File
sudo mv <fileName> <file Location>

Refresh bashrc(same for .profile)
. ~/.bashrc

Remove dpkg
$ sudo apt-get remove softwarename
$ sudo apt-get --purge remove softwarename

Record my Desktop:\
Avaiable in ubantu store.
sudo apt-get install gtk-recordmydesktop

JDK 7
$ sudo apt-add-repository ppa:webupd8team/java
$ sudo apt-get update
$ sudo apt-get install oracle-java7-installer
$ java -version
   java version "1.7.0_56"

Now set environment variables for the installed JAVA version.
$ sudo apt-get install oracle-java7-set-default

OR Direct install from oracle site

  http://www.wikihow.com/Install-Oracle-Java-JDK-on-Ubuntu-Linux

Rabbit mq
http://bobcravens.com/2014/02/rabbitmq-install-unbuntu/
sudo apt-get remove rabbitmq-server
sudo apt-get install python-software-properties
sudo add-apt-repository "deb http://www.rabbitmq.com/debian/ testing main"
wget http://www.rabbitmq.com/rabbitmq-signing-key-public.asc
sudo apt-key add rabbitmq-signing-key-public.asc
sudo apt-get update
sudo apt-get install rabbitmq-server -y
sudo service rabbitmq-server start
sudo rabbitmq-plugins enable rabbitmq_management
sudo service rabbitmq-server restart
http://localhost:15672/
uname : guest
pwd : guest

SVN: http://tutorialforlinux.blogspot.in/2013/08/tutorial-install-rabbitvcbas-in-ubuntu.html

Hamachi
1)sudo apt-get install lsb
2)sudo add-apt-repository ppa:webupd8team/haguichi
3)sudo apt-get update && sudo apt-get install haguichi
4)Download .deb file as per pc
[LogMeIn Hamachi for Linux (Beta) command line version - > learn more ]
https://secure.logmein.com/labs/#HamachiforLinux
https://www.vpn.net/linux
5)serach "Haguichi" and run
6)connect
7)join network from menu client->join network
username:
pwd:
For more read :
https://help.ubuntu.com/community/Hamachi

Myslq

Remove Mysql in Linux:
sudo apt purge mysql-*
sudo apt autoremove

Install Mysql in Linux:
sudo apt-get install mysql-server
sudo apt-get install mysql-client

ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'root@1234';
FLUSH PRIVILEGES;
GRANT ALL PRIVILEGES ON *.* TO 'administrator'@'localhost' IDENTIFIED BY 'root@1234';

sudo apt-get install mysql-workbench

Allow access in network mysql
1)sudo /etc/init.d/mysql stop
2)sudo chmod 777 /etc/mysql/my.cnf
3)comment below lines
# localhost which is more compatible and is not less secure.
# bind-address  = 0.0.0.0
4)sudo chmod 0644 /etc/mysql/my.cnf
5)sudo /etc/init.d/mysql start

Wavemaker installation
wminstallers.s3.amazonaws.com/6.7.0+RELEASE/wavemaker-6.7.0.RELEASE.exe

Desktop Launcher
sudo gedit /usr/share/applications/appname.desktop
[Desktop Entry]
Version=6.7.0
Name=software name
Type=Application
Exec=bin path
Terminal=false
Icon=icon path which show in software
Name[en]=english name
Categories=Utility;Application;

Tomcat
http://tomcat.apache.org/download-70.cgi
$ cd /opt
$ sudo tar -xvzf ~/Downloads/apache-tomcat-*.tar.gz
$ sudo gedit ~/.bashrc
   # environment variable for tomcate
   export CATALINA_HOME=/opt/apache-tomcat-7.0.59
   # environment variable for JAVA
   export JAVA_HOME=/usr/lib/jvm/java-7-oracle
make sure you have set the environment variable properly.
To Start Tomcat :
   $sudo $CATALINA_HOME/bin/startup.sh
    Tomcat should be started.
To Stop Tomcat :
   $sudo $CATALINA_HOME/bin/shutdown.sh
    Tomcat should be shutdown.

Eclipse
https://eclipse.org/downloads/
open terminal
$ cd /opt
$ sudo tar -zxvf ~/Downloads/eclipse-*.tar.gz
sudo gedit /usr/share/applications/eclipse.desktop

[Desktop Entry]
Name=Eclipse 4
Type=Application
Exec=/opt/eclipse/eclipse
Terminal=false
Icon=/opt/eclipse/icon.xpm
Comment=Integrated Development Environment
NoDisplay=false
Categories=Development;IDE;
Name[en]=Eclipse 

Skype installation
1)sudo apt-get remove skype skype-bin
2)rm -rf ~/.skype
3)sudo apt-get update;
4)sudo apt-get install skype

iReport Desktop
open terminal
$ cd /opt
sudo tar -zxvf ~/Downloads/SW/iReport-5.6.0.tar.gz
sudo gedit /usr/share/applications/ireport.desktop

[Desktop Entry]
Version=5.5
Name=iReport
Comment=JasperReport
Exec=/opt/iReport-5.6.0/bin/ireport
Icon=/opt/iReport-5.6.0/bin/document.ico
Terminal=false
Type=Application
Categories=Utility;Application;

Postgresql
http://www.postgresql.org/download/linux/ubuntu/
sudo add-apt-repository "deb http://apt.postgresql.org/pub/repos/apt/ trusty-pgdg main"
https://wiki.postgresql.org/wiki/Apt
sudo apt-get install wget ca-certificates
wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add -
sudo apt-get update
sudo apt-get upgrade
sudo apt-get install postgresql-9.4 pgadmin3