Posts

Showing posts from 2020

Swagger 2 dependency in Spring Boot

Image
Hi folks, hope i found you well in these tough time. In this particular blog i am going to implement Swagger 2 into a spring boot web application. Table of content What is swagger? Implementing  a spring boot API using swagger. Swagger has a vast set of tools for APIs development. Swagger is a tool to achieve the following Develop APIs Interact with APIs Document APIs The third one i.e. documenting APIs given swagger a lots of popularity. It is an excellent tool to document APIs. The most popular tool to do the same using something called swagger UI. In this blog we are focusing on the third one. We are going to implement a spring boot APIs and it's documentation using swagger UI. But there are some of the questions that should be answered before diving in deeper. Why we need a tools to documenting an API? The answer to above question is pretty much simpler, when some one build an API and some other user is going to consume that particular API, then consumer need to know all the en

Logger in SpringBoot

Image
                    Hello geeks, here I came up with another interesting blog on Logger in java spring boot. To understand the logger we need their requirement first.                                In our application there are some situations, where our code breaks or behaves abnormally, to understand this we need some of the trace of code. Mean from where and why this abnormal or code break happens. So, we need to track or print out the class name, method name with line number from where the issue occurred.           So, all in all we just need a console out put mentioning the exact issue with class level and method level details with line number. We, can use a simple system.out.println but it has no any flexibility and configuration on application level, Like filtering the log level, filtering the packaging etc. The logging facilities are there on JDK since 1.0 under java.utils.logging packag in Logger class. We get the hold of this static class's object using Logger.getLogger(Cl

Spring boot security basics

Image
Hello geeks, here i came up with another blog series on spring security, Where I am going to explore some of the basic concepts behind the spring boot security as well as hands on examples.  This is going to be the first blog in this series on spring boot security, so please follow all blogs in order to better understanding of the concepts.                                                 Before we begin to deep dive into spring security, we need to under stand why we need application level security. Since we have already OS level security, server level security then why we need this application level security. The answer is pretty much self explanatory, since we are developing APIs in java, these end points are explicitly exposed to end user that's why all the already applied security on OS level and server are forcefully by passed here. So, all in all we need another application level security here. For this spring security came to the rescue here.      In real spring security is

Sending HTML template base email using spring boot.

Image
 Hello Geeks, hope you all are doing well these days. Recently i was working in my project where a case came, where I had to send an email with attachment in specific format(basically template based). So, after doing a quick research I came up with solution, In this particular blog post I am going to share the spring boot plugin i.e. free marker, to send template based multi lingual email. So, first things first. Initiate a blank spring boot application with some of dependencies listed below: 1. web dependencies spring-boot-starter-web 2. jackson dependencies jackson-dataformat-xml 3. lombok dependencies lombok 4. mail dependencies spring-boot-starter-mail 5. free marker dependencies spring-boot-starter-freemarker Here is the effective pom.xml, you can also use gradle instead of maven.  pom.xml <?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-inst

Playing With Spring Boot Banner

Image
Hello geeks, here I came up with a quick read but interesting blog post. Here I am going to show you the different possible customization available in spring boot banner.                                     Have you noticed when ever you set up a brand new spring boot application, and runs it a pretty nice spring log with version information is populated into the console, just like the screen shot below. Now, here is the stuff you can perform with this logo. You can remove the entire logo, You can customize the text of logo You can customize the font, color and style of logo. You can use any image instead of text. Let's see all of above one by one. You can remove or turn off the default spring logo populating while running spring boot application by either using properties file or by programmatically. Removing Entire Logo using application.properties file spring.main.banner-mode="off" using application.yml file  spring: main: banner-mode: "off&

JavaScript methods you should know about.

                      Hello folks, hope you all doing well . In this particular blog i am sharing some of tradition but evergreen javaScript methods that every one should know about. Methods forEach : This method allows you to iterate through all the elements present inside the array, pretty similar to forEach of other programming languages. example:                      array . forEach ( function ( currentValue ,  index ){                 /**             * stuff to perform with each record             */           }); map : This method returns a new array by calling the provide method once for each and every element present inside array in the order in which they stored into array, it does execute the provide method for empty value of array.                 example :           array . map ( function ( element ){              /**               * stuff to perform to each element of array              */           }); filter : This method returns an array that passes the condition mat

Samsung J2 MDM temporary unlocking for factory resetting in Demo device, with FRP bypass.

Image
                                             Hey, geeks hope i found you well in this tough time. Recentally i was faced a situation in with Samsung J2 demo device. Actually i forgot the device unlock password, and when i jump into recovery mode and tried to reset device, it says--- Issue :   MDM does not allow factoryReset.  Phone will REBOOT automatically.      Even i tried to flash whole device using odin by moving device into download mode,  and same message will appears on device MDM MODE. CAN'T DOWNALOD. After diving deep into web and applying multiple solution, here i came up with a working solution. Steps in brief :  You need a windows machine, device's data cable (original will be preferred, i tried with different one) Download all the required files [ MDM unlocker, Google Account Manager apk, quick shortcut maker apk ] ALL links will be mentioned in downloads section below the post. Move you device into recovery mode by pressing these button combinations vol up

Java 8 interfaces and behind the scene

Image
                                 Hello geeks,  Java 8 or 1.8 come up with lots of enhancements to survive into market. Since, other programming languages are evolving itself beyond object oriented world. Since, java until now strictly follows object oriented approach, that's why a lots of programming methodologies (like function programming etc) are still not supported by java until java 1.7. But in java 8 they started to adopt such programming methodologies too. In this particular blog i am mainly going to talk about the java 8 interface. Since interfaces are there in java from there very first releases, so what new in java 8 interface. Interfaces in java till 1.7 To get a better clear picture, lets first talk about java 1.7 (or earlier) interface implementation. The main reason behind using an interface is to define a type of user's choice (or vendor's choice). Just like c programming where we first declare functions and then define them and then use

Amazon snowball

Image
Hello geeks, Cloud computing is trending right now. Both provider and consumers are providing and demanding more and more cloud storage and computing resources day by day, which are accessible remotely from anywhere in the world. Tech giant like Google, Microsoft, IBM and others are vying to be go-to provider. But one company remained the leader AMAZON. AWS technologies are behind a lot of services that we use today from a lift, checking your video door bell to watching our favourite shows on netflix, amazon prime, ULLU movies etc. AWS has been one of AMAZON's most profitable business last year. There are approx 2.2 million customers using aws services today. These includes some of the big name like Goldman Sachs, and over 4000+ government agencies. But the challenges for amazon arises here. Most of the users on aws are generating a huge amount of data(in petabytes even in yottabytes) and moving them from one place to other over the internet is the nightmare fo

Webcam Integration using pure Js on HTML 5

Image
Hello geeks, hope you all are doing well.  In this blog post i am going to share a very simple java script code snippet through you can easily integrate your webcam into any html 5 web page.                                Now, a day most of the website provides real time webcam integration for profile picture upload or any account verification step. Some of them as per my experience are :  Bitbns  ,   Electronieum  and list goes on. Here i am using html 5 video tag, and as source of video i am integrating webcam using java script. So, first create html DOM structure using following code snippet. <video id="video" width="100%" height="100%" autoplay></video> Next  include video src for video tag in js. var video = document.getElementById('video'), vendorUrl = window.URL || window.webkitURL; if (navigator.mediaDevices.getUserMedia) { navigator.mediaDevices.getUserMedia({ video: true })