Tools

How to Implement JWT Token Based Authentication in Spring Boot Microservices

Java, Spring Boot, Tools
JWT (JSON Web Token) tokens are an open, industry standard RFC 7519 method for representing claims securely between two parties. It is highly recommended and used authentication method for REST API & Webservices. Today we are going to see how to implement JWT token based authentication in spring boot microservices to securely communicate and transfer the data's between the client(any client applications, angular/react/vue in modern application world) and server side applications. Though process for Token Based Authentication Spring security is needed for JWT token based authentication Ensure the signup / login REST API accesses are allowed in spring security (or disable these two API's) During signup, save the captured user details in the user table then generate and res

How to change Global Access Control from Google login to jenkins login ?

Docker, Tools
How to change Global Access Control from Google login to jenkins login ? Google login is really helpful to control the jenkins access to specific domain users with secured way. But the problem is if you have not configured your google login properly in jenkins > configure global access > google login, then you will face a login problem. In this case, you will not be able to login to your jenkins dashboard using both "jenkins own database" as well as "google login". <securityRealm class="org.jenkinsci.plugins.googlelogin.GoogleOAuth2SecurityRealm" plugin="google-login@1.5"> <clientId>CLIENT_ID</clientId> <clientSecret>CLIENT_SECRET</clientSecret> <domain>ONLY_DOMAIN_NAMES</domain> </securityRealm> You can find a file named conf...
RabbitMq Tutorials

RabbitMq Tutorials

Tools
RabbitMQ is publish-subscribe tool which is effectively used in microservices for their inter communications. RabbitMQ is an open-source message-broker software that originally implemented the Advanced Message Queuing Protocol and has since been extended with a plug-in architecture to support Streaming Text Oriented Messaging Protocol, Message Queuing Telemetry Transport, and other protocols. 1. How to install RabbitMQ in Docker Container ? 1.1 RabbitMQ - Docker pull: docker pull rabbitmq 1.2 RabbiMQ - Docker Run: sudo docker run --restart=always -e RABBITMQ_DEFAULT_USER='rabbitadmin' -e RABBITMQ_DEFAULT_PASS='rabbitpass' -d --name ngrabbitmq -p 5672:5672 -p 15672:15672 rabbitmq:3-management rabbitadmin is username and rabbitpass is rabbitmq password, the same should be configured where...
How to update jenkins in docker container

How to update jenkins in docker container

Docker, Tools
sudo docker container exec -u 0 -it czcjenkins bash here czcjenkins is my container name. wget http://updates.jenkins-ci.org/download/war/2.176.1/jenkins.war This jenkins url can be copied from the official jenkins link or download copy save link from existing jenkins login. mv ./jenkins.war /usr/share/jenkins/ chown jenkins:jenkins /usr/share/jenkins/jenkins.war here jenkins is the user, so keep same as it is only. sudo docker restart czcjenkins
Letsencrypt commands for beginners

Letsencrypt commands for beginners

Articles, Tools
Letsencrypt commands for beginners ./certbot-auto certificates: This commands lists down all the letsencrypt certificates (both active and expired) with exact path details where the certificate exists. ./certbot-auto certonly -a standalone: This command helps to create a new ssl certificate, if you want to create for more than one domain then enter the domain names with comma. ./letsencrypt-auto renew: This command renews all your existing letsencrypt certificates. This blog explain in detail about the letsencrypt certificate renewal process and stuffs. ./certbot-auto delete: This will list down the certificates installed and asks the prompt for certificate deletion. cd /letsencrypt/letsencrypt: Default path in centos/AWS machines, once the letsencrypt is installed. ./let...

How to copy files from linux ec2 to your desktop?

Tools
How to copy files from linux ec2 to your desktop? Please install Mobaxterm software, which is available here, this software is available for both community and premium versions. You will be able to download the files from aws ec2 linux machine to your local desktop system using free community version itself. Command Syntax: scp -i DOCKER-PEM-FILE-PATH AWS-EC2-ID:/ec2-path/* /home/mobaxterm/Desktop/   This command copies all the ec2-path folder data to your local system's desktop location. Example: scp -i aws-pair.pem ec2-user@ec2-1-2-3-4.us-2.compute.amazonaws.com://YOUR_FOLDER/YOUR_FILE /home/mobaxterm/Desktop/  

Flowable IDM default username and password

Tools
Flowable IDM default username and password Flowable is a fantastic tool for BPMN process implementations in java with spring boot frameworks.   You have to download flowable-6.4.0(latest while writing this article) and download the apache tomcat, then move all the below five war files to webapps then do tomcat restart for the deployments. flowable-admin.war flowable-idm.war flowable-modeler.war flowable-rest.war flowable-task.war Then you will be able to see the list of flowable wars deployed in the manager of apache tomcat in this url http://localhost:8080 Url to access: http://localhost:8080/flowable-admin/#/engine Default username and password: username: admin password: test
pm2 and forever command for beginnners

pm2 and forever command for beginnners

Tools
pm2 and forever is a tool to run the process at the background, many of the angular developers are using these tools nowadays in any linux/amazon ec2 machines for angular universal server side rendering(ssr) for seo and many other features.   Herewith I have listed the few mostly used commands: pm2 commands: pm2 start your_js_file (pm2 start local.js) in my case for angular universal run, this build is created using the below commands, npm run build:prod (or) yarn run build:prod  and npm run server (or) yarn run server   pm2 list: list down all the pm2 processes. pm2 kill: to kill all the running pm2 processes pm2 monit: to monitor the running processes pm2 logs: to see the logs of the running pm2 processes. pm2 start all: to start all the pm

okhttpclient get/post/form requests example:

Java, Tools
okhttpclient get/post/form requests example: Maven dependency: [xml] <dependency> <groupId>com.squareup.okhttp3</groupId> <artifactId>okhttp</artifactId> <version>3.11.0</version> </dependency> [/xml] okhttpclient with formbody example: [java] public class App { public static void main( String[] args ) throws IOException { OkHttpClient client = new OkHttpClient(); RequestBody formBody = new FormBody.Builder() .add("client_id", "some_value") .add("client_secret", "some_value") .build(); Request request = new Request.Builder() .url("some_url") .post(formBody) .addHeader("authorization", "headers_here") .addHeader("cache-control", "no-cache") .build(); Response response = client.newCall(request).execute(); Sy...

How to get JPA Project option in Eclipse STS ?

Hibernate, Tools
How to get JPA Project option in Eclipse STS ? By default JPA project option is not there when you check under New project in STS eclipse. To make it available install hibernate tools plugin(which is currently Jboss Tools)     Now you will be able to create the JPA Project,   Could not find Database perspective in your eclipse ? Then  you may not have installed the below plugin, which could have caused database perspective issue in your eclipse. https://stackoverflow.com/questions/7923041/i-dont-have-database-development-perspective-in-eclipse-java-se-ide   How to generate JPA entities from the MySQL Database ? First you need to create the JPA Project (STS New -> JPA Project), not able to see the JPA Project option, then you must install Jbo