Thursday, July 15, 2021

Install Intellij IDEA IDE on Ubuntu 18.04

 1. go to https://www.jetbrains.com/idea/download/#section=linux 

and Download Linux version Community one.

you may refer screenshot.



2. go to download ideaIC-2019.1.4.tar.gz file and run the below command

sudo tar -zxvf ideaIC-2019.1.4.tar.gz -C /opt/

3. go to install location

cd /opt/idea-IC-191.8026.42/bin/


4. run the below command

./idea.sh


5. you will received below popup window and continue rest of the installation process.


6. Now your installation process completed 



 




Tuesday, July 6, 2021

setup react js on ubuntu 18

 1. run the below command to install nodejs


sudo apt install nodejs
 
2. run the below command to install npm (node package manager)
 
sudo apt install npm

 
3.  Next install Visual Studio code with below commands
 
wget -q https://packages.microsoft.com/keys/microsoft.asc -O- | sudo apt-key add - 
sudo add-apt-repository "deb [arch=amd64] https://packages.microsoft.com/repos/vscode stable main" 
 sudo apt install code
 
4. After that open Visual STudio Code IDE
Then Add Simple React Snippets  Extension
5. Then Add Prettier
Extension
 

 Now you can run reactjs project on your Ubuntu machine.Good luck

Monday, June 28, 2021

Install tomcat 8 on Ubuntu 18.04

 1. install jdk 8 or open jdk 8

2. create tomcat user account

sudo groupadd tomcat


3. run below command

sudo useradd -s /bin/false -g tomcat -d /opt/tomcat tomcat




4. move to tmp folder

5. run the below command to download tomcat tar file

wget ftp://apache.cs.utah.edu/apache.org/tomcat/tomcat-8/v8.5.68/bin/apache-tomcat-8.5.68.tar.gz
 

 

6. create folder on /opt/tomcat

cd /opt/

sudo mkdir /opt/tomcat
 

 

7. run below command - to extract tar file to /opt/tomcat

cd /tmp/

sudo tar xzvf apache-tomcat-8*tar.gz -C /opt/tomcat --strip-components=1
 

 8.tomcat extract to below folder
 

 

9.give the tomcat user control of the entire directory and make all the scripts in the bin location executable

 

sudo chown -R tomcat: /opt/tomcat
sudo sh -c 'chmod +x /opt/tomcat/bin/*.sh'
 

 

 10.run below command

sudo vi /opt/tomcat/conf/tomcat-users.xml

add the below lines

11. add below line to 

sudo vi /etc/systemd/system/tomcat.service

==============================

[Unit]
Description=Tomcat servlet container
After=network.target

[Service]
Type=forking

User=tomcat
Group=tomcat

Environment="JAVA_HOME=/usr/lib/jvm/default-java"
Environment="JAVA_OPTS=-Djava.security.egd=file:///dev/urandom"

Environment="CATALINA_BASE=/opt/tomcat"
Environment="CATALINA_HOME=/opt/tomcat"
Environment="CATALINA_PID=/opt/tomcat/temp/tomcat.pid"
Environment="CATALINA_OPTS=-Xms512M -Xmx1024M -server -XX:+UseParallelGC"

ExecStart=/opt/tomcat/bin/startup.sh
ExecStop=/opt/tomcat/bin/shutdown.sh

[Install]
WantedBy=multi-user.target
 
12. After that, run the commands below to reload systemd profiles and enable tomcat service
sudo systemctl daemon-reload 
--- not working below two line ---------- 
sudo systemctl start tomcat.service
sudo systemctl enable tomcat.service
 
13. run the tomcat using the below commands
sudo -s
cd /opt/tomcat/bin/ 
./startup.sh 
  

14. on the web browser run below command

http://localhost:8080




Thursday, June 24, 2021

create Elastic Search Database backup


1.Make a zip from elasticsearch folder by executing, `tar -czvf backup.tar.gz elasticsearch`

 =========


Existing database table values display as follows.



2. Stop elastic search db

3. rename it's db data folder to different name


4. extract previously taken db backup using below command

tar -xvf backup.tar.gz
 

 5. Now you can see the extract elasticsearch data folder as follows

 6.start elastic search db using below command
sudo service elasticsearch start
7. recheck the data using the postman

 



Wednesday, June 23, 2021

Uninstall MySQL On Ubuntu OS

 1. open Terminal and execute below command

sudo systemctl stop mysql

this command will stop mysql service

2. Next run below command

sudo apt-get purge mysql-server mysql-client mysql-common mysql-server-core-* mysql-client-core-*

3.Below command will remove MySQL configuration and data.

sudo rm -rf /etc/mysql /var/lib/mysql

 


4.

(Optional) Remove unnecessary packages.

sudo apt autoremove

(Optional) Remove apt cache.

sudo apt autoclean


MySQL Database DB Bakup from Ubuntu OS

MySQL DB back can be taken as below Terminal command

 

sudo mysqldump -p mailhub >/home/pasindu/a.sql




restore mysql DB using the below command


mysql -u username -p database_name < backup_name.sql

 

Below commands are used to stop mysql service

sudo service mysql stop

or 

sudo systemctl stop mysql
 

Below command is used to start mysql service

sudo service mysql start
 

Create mysql user for MySQL database

 Create new mysql user 

CREATE USER 'sunny'@'localhost' IDENTIFIED BY 'sunny';


GRANT ALL PRIVILEGES ON *.* TO 'sunny'@'localhost' WITH GRANT OPTION;


This user has all privileges

username : sunny

password: sunny