Browsed by
Category: Java

Swagger Tutorials & Notes

Swagger Tutorials & Notes

What is the URL to open Swagger UI ? What is the URL to view the list of API’s as JSON in Swagger ? How to disable Swagger related URL’s in Spring Security ? In your WebSecurityConfig class make sure to skip the below endpoints/urls, In very few case it still throws the exceptions then try “**/swagger-resources/**” instead of “/swagger-resources/**” How to disable Swagger UI in Production ? Swagger UI can be enabled or disabled based on the profile. Make…

Read More Read More

617 total views, no views today

Java Interesting Problems

Java Interesting Problems

How to print Fibonacci Series Till 1000 ? Learning from the above program: You can not use int/Integer and also long/Long to store the value. Because maximum value of int(2147483647) and long(9223372036854775807). Both these values would be reached even before the first 100 fibonacci series values. So BigInteger is one and only option for us to print the value of fibonacci series more than 100. BigInteger size is int[] of 2147483647 [Integer.MAX_VALUE), so it can able to keep the big…

Read More Read More

483 total views, no views today

How to save & load Jenkins docker images in two hosts

How to save & load Jenkins docker images in two hosts

This posts help you with step by step instructions to move jenkins images from one hosts to another hosts. I have personally used the below method and worked great for me. I have another method mentioned here. But that gave me lot of errors and also the jenkins_home contents like custom shell scripts/job details etc were missed. But still I have posted because this can work for other docker containers. Step 1: Save Jenkins Image in Machine 1 Step 2:…

Read More Read More

514 total views, 2 views today

AWS Notes

AWS Notes

How to copy some files from your aws machine to your local desktop ? Download Mobaxterm community edition, open new session then go to desktop, my-docker-keypair.pem is the keypair file which you can download from aws console. ngjenkins.tar is my tar file which I need to copy from AWS machine to local desktop. I am running this command from desktop and I need the file to be downloaded to desktop only, so gave just (“/”) in the copy command. How…

Read More Read More

746 total views, 4 views today

How to Implement JWT Token Based Authentication in Spring Boot Microservices

How to Implement JWT Token Based Authentication in Spring Boot Microservices

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…

Read More Read More

703 total views, no views today

Fix for AWS SSH Connection Hangs ?

Fix for AWS SSH Connection Hangs ?

Fix for AWS SSH Connection Hangs ? You could have not added the SSH TCP connection to your ec2 instance, thay may be creating this issue aws SSH connection Hangs issue. Follow the simple 3 steps to get away from this, 1. Login to AWS EC2 Console and click on Security Groups (available in the left sidebar). 2. Select your EC2 instance’s security group then click on the Inbound tab. 3. Now add the SSH Rule like this to resolve…

Read More Read More

1,142 total views, no views today

GIT Bash frequently used commands- Cheat sheet

GIT Bash frequently used commands- Cheat sheet

Below are some of the common git bash commands, the most frequently used ones are in italic fonts Scratch- create a new local repository – $ git init {project_name} Download from existing repo – $ git clone my_appliction_url List new or modified files not committed – $ git status show the changes to files not staged/committed – $ git diff Show all the staged and unstaged file changes – $ git diff HEAD Show the changes between two commit ids…

Read More Read More

1,016 total views, 8 views today

File upload (with meta data) in Angular 6 & Spring Boot 2

File upload (with meta data) in Angular 6 & Spring Boot 2

File upload (with meta data) in Angular 6 & Spring Boot 2 In Angular side create the component and typescript file similar to this, Part 1: Angular Side Development Angular Template(Html) file: <div class="row justify-content-center"> <label class="ct-input-file">My File Label Here <input type="file" (change)="onFileChange($event)"> <i class="icon-upload"></i> </label> </div> Note: class=”icon-upload” gives upload icon, if you don’t want then you can remove it for older way of file upload button. Angular Component(ts) file: FileUploadService is service class to deal api request and…

Read More Read More

2,086 total views, no views today

Flowable Notes for Beginners

Flowable Notes for Beginners

Flowable Notes for Beginners 1. Flowable is a set of process and tasks inside it. Example snippet (as per bpmn20.xml): Below snippet is only for understanding on how the process and tasks will be created in flowable for any bpmn process. Explanation: couponupload is process id/key created to upload the coupons for a particular shop. This process will have set of tasks in order to complete the whole process, here totally 2 process, one is store already partnered or not…

Read More Read More

1,392 total views, no views today

Developers Repeated Mistakes

Developers Repeated Mistakes

In this post we are going to discuss about the repeated mistakes of developers during design/implementation/planning etc. This is just a sudden thought process, so this post will grow on my day to day experience and research wise only. Feel free to comment your repeated mistakes to add it to this master list. In Hibernate/Databases: While creating/planning a column for description, we forget to define the length of values it can hold or even forget to think such scenarios. So…

Read More Read More

870 total views, no views today