Wednesday, May 18, 2022
My Motor bike
2020 March I brought a new motorbike.It was made in India.It's Honda brand.It is the last motor bike available in Stafford Company.Stafford Motors is the Sri Lankan agent for Honda brand.
This motorbike is small and easy to travel in the colombo city traffic time.It run with 35 km - 40 km per petrol one liter.
Monday, May 2, 2022
Coconut shell charcoal cooker
In 2022 March ,when our house gas finish,we were unable to buy new gas,due to Sri Lanka economy failure after covid 19 pandamic situation.Then I search for other options.
Then I found this Coconut shell charcoal cooker.
It need 8 kg of cocount shell every week for my home.My home there are 5 members.
It's main row material is coconut shell.
We need to create all the curry and once.
Then start the cooker.
It's best option for cooking with out gas.
Friday, December 10, 2021
First Angular Program
first check whether machine has Angularjs install
ng --version
ng new hello-world
this will create new project
load this web site
ng serve
Tuesday, September 14, 2021
react js ui and Microsoft Rest api connection
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.1.2.RELEASE</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<groupId>com.app</groupId>
<artifactId>highmaturity</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>highmaturity</name>
<description>Demo project for Spring Boot</description>
<properties>
<java.version>1.8</java.version>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.microsoft.azure</groupId>
<artifactId>azure-active-directory-spring-boot-starter</artifactId>
<version>2.1.5</version>
</dependency>
<dependency>
<groupId>org.json</groupId>
<artifactId>json</artifactId>
<version>20180813</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-security</artifactId>
</dependency>
<dependency>
<groupId>io.jsonwebtoken</groupId>
<artifactId>jjwt</artifactId>
<version>0.9.0</version>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<version>3.7</version>
</dependency>
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<version>2.6</version>
</dependency>
<dependency>
<groupId>org.quartz-scheduler</groupId>
<artifactId>quartz</artifactId>
<version>2.2.1</version>
</dependency>
<dependency>
<groupId>org.quartz-scheduler</groupId>
<artifactId>quartz-jobs</artifactId>
<version>2.2.1</version>
</dependency>
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
<version>4.5.3</version>
</dependency>
<dependency>
<groupId>io.swagger</groupId>
<artifactId>swagger-annotations</artifactId>
<version>1.5.15</version>
</dependency>
<dependency>
<groupId>javax.ws.rs</groupId>
<artifactId>javax.ws.rs-api</artifactId>
<version>2.0.1</version>
</dependency>
<dependency>
<groupId>org.springframework.session</groupId>
<artifactId>spring-session-core</artifactId>
</dependency>
<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
<version>2.8.2</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>jul-to-slf4j</artifactId>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>log4j-over-slf4j</artifactId>
</dependency>
</dependencies>
<build>
<resources>
<resource>
<directory>src/main/resources</directory>
<filtering>false</filtering>
<includes>
<include>ui/build/**</include>
<include>static/**</include>
<include>application.properties</include>
<include>logback.xml</include>
</includes>
</resource>
</resources>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<excludes>
<exclude>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
</exclude>
</excludes>
</configuration>
</plugin>
<plugin>
<groupId>com.github.eirslett</groupId>
<artifactId>frontend-maven-plugin</artifactId>
<version>1.6</version>
<executions>
<execution>
<id>install node and npm</id>
<goals>
<goal>install-node-and-npm</goal>
</goals>
<phase>generate-resources</phase>
<configuration>
<nodeVersion>v14.16.0</nodeVersion>
<npmVersion>6.14.11</npmVersion>
<!--<npmDownloadRoot>http://registry.npmjs.org/npm/-/</npmDownloadRoot>-->
<!--<npmRegistryURL>http://registry.npmjs.org/</npmRegistryURL>-->
</configuration>
</execution>
<execution>
<id>npm install</id>
<goals>
<goal>npm</goal>
</goals>
<phase>generate-resources</phase>
<configuration>
<arguments>install</arguments>
</configuration>
</execution>
<execution>
<id>npm run build</id>
<goals>
<goal>npm</goal>
</goals>
<phase>generate-resources</phase>
<configuration>
<arguments>run build</arguments>
</configuration>
</execution>
</executions>
<configuration>
<workingDirectory>src/main/resources/ui</workingDirectory>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<executions>
<execution>
<id>Copy my react frontend to the static folder of my spring application</id>
<phase>process-resources</phase>
<configuration>
<target>
<copy todir="target/classes/static">
<fileset dir="src/main/resources/ui/build"/>
</copy>
</target>
</configuration>
<goals>
<goal>run</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
Thursday, July 15, 2021
Create a SSL Certificate on Nginx for Ubuntu
1. create ssl folder
sudo mkdir /etc/nginx/ssl
2. go to nginx /ssl folder using below command
cd /etc/nginx/ssl 3.The first file that we need to create is the private key. While creating the key, we will be asked for a passphrase. We must make sure to remember the passphrase since we will not be able to access the certificate without it. sudo openssl genrsa -des3 -out server.key 1024
4.Once we have the key created, we will use the key on order to create Certificate Signing Request. 5.We have to run below command to create certificationsudo openssl req -new -key server.key -out server.csr It will ask your old pass pharse value and Company Name,City like wise Questions.you may refer screenshot.
6.If we have a passphrase it has to be typed in manually, so if there is not person available to do it, the website will be offline for a long time. That is why we are going to remove the passphrase from the key file, using the following command # sudo cp server.key server.key.org
# sudo openssl rsa -in server.key.org -out server.key
7.Now we are ready to create and sign our certificate by below command
sudo openssl x509 -req -days 365 -in server.csr -signkey server.key
8.It will be valid for 1 year (365 days). That is something that can be
changed if needed. Now we can use the certificate and assign to a
virtual host. We can copy the Nginx sample configuration file in a new
file and use that. 9.most important part to be change are as followsserver {
listen 443;
server_name our-domain.com;
root /var/www;
index index.html index.htm;
ssl on;
ssl_certificate /etc/nginx/ssl/server.crt;
ssl_certificate_key /etc/nginx/ssl/server.key;
} After making the changes and saving the file, we should copy the virtual host configuration file into /etc/nginx/sites-enabled/default file.
Before change it ,please take a backup of it.
and then restart Nginx.
# sudo service nginx restart
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












