Abhijit Ghosh

68 articles

How to Install Windows Subsystem for Linux (WSL2) on Windows 10?

Windows Subsystem for Linux (WSL) is an awesome feature of Windows 10. No more VMware or Oracle VirtualBox is required to run Linux on Windows. WSL is faster and less resource consuming, zero or less configuration compared to any other traditional Virtual Machines (VM). Installation and setup of Lin

· 10 min read

How to change hostname on Ubuntu running on Windows WSL?

If you are running Ubuntu on Windows WSL (Windows Subsystem for Linux) and wondering how to change hostname permanently then follow all steps mentioned below. Once hostname is changed, if you get "unable to resolve host <hostname>: Name or service not known" then follow the step #4 for the fix. Vi

· 3 min read

Breach COMB List 3.2B - Mine got exposed. Check yours.

"No News is Good News". That is what I used to get from Identity Guard®. But yesterday, I got email & sms notification "Alert: Your Login Credentials Have Been Exposed Online". And partial password shared in that notification is actually matching with my credentials. So, mine got exposed. Check your

· 4 min read

Exception: Falling with style. Error: Failing with smile

Andy  learning to code. He seemed a little worried. Mike happens to stop by. "You seem worried. What’s on your mind?" asked Mike. "Well Mike, I’ve been trying to understand exception handling. But I can’t seem to wrap my head around it." answered Andy. Mike laughed and said "I see. Come with me.

· 1 min read

Customize Logback Configuration for Log Optimization

4,153,406 hits in single day! Sounds like a really big number for many of us. I was surprised when I noticed this in Production ELK for the first time. I didn't expect that many hits for an application with only 5 microservices. That too for a Beta application with a handful (~2k) of users. It wil

· 4 min read

Pandemic in Application - Circuit Breaker Pattern

Pandemic! Human race is now at stake. Flatten the curve. Whole world is running after this epidemic curve. Why it so important? [https://commons.wikimedia.org/wiki/File:20200403_Flatten_the_curve_animated_GIF.gif#/media/File:20200403_Flatten_the_curve_animated_GIF.gif] By RCraig09 [//commons.wik

· 4 min read

Kid's Eye and Energy Safe Smart TV - Part 2

Sometimes I feel, kids do this just to irritate us. Or may be, we always have a prioritized  list of problems in our subconscious mind. When we solve the top one, the next one pops up and gets highlighted. It is indeed never ending. Few extra hours of running TV will hardly make any difference in m

· 5 min read

Kid's Eye Safe Smart TV - Part 1

Outside of home COVID-19. Inside at home COVID-16. Whole world is fighting against COVID-19. But for COVID-16, I am all alone. I am tired of saying "please stay away from the screen". So thought of this concept project to avoid brain infection at home. By the way, I call two of my kids (age 1 and 6

· 4 min read

Log Forging by CRLF Injection

Live feed forging formed the base of the Professor's "Paris Plan" to rescue Lisbon from police custody in Money Heist (Season 4). A smart attacker always makes or covers up his tracks by forging something. Cyber-attacks inflict loss of reputation and wealth worth millions.

· 5 min read

Secure your Web Application using HTTP Security Headers - Cloudflare Workers

Security is always an essential aspect of any web application. HTTP security headers play an important role to tighten up the security of web application. It acts as an additional security layer to defend many common vulnerabilities and attacks like clickjacking, cross-site scripting (XSS), cross-s

· 3 min read

IOT - Home Automation project using Geofencing, MQTT, ESP8266 and MycroPython

A home automation project that maps switching on/off of appliances with your entry/exit of a geofence (virtual perimeter for a real-world geographic area). Step into a cool room without having to wait for the air conditioning to start functioning? Watch the garage door open as you drive in.

· 8 min read

How to flash MicroPython firmware onto an ESP8266 ESP-12E chip using esptool?

By default, ESP8226 module comes with AT Firmware. In this post, we'll see how to flash MicroPython firmware onto an ESP8266 ESP-12E chip using esptool. Tools,Technologies and Components used in this article 1. ESPlorer IDE [https://esp8266.ru/esplorer/#download] 2. MicroPython [https://micropyth

· 6 min read

Install and Configure Oracle Java ME Embedded on Raspberry Pi

Raspberry Pi is a low cost, credit-card sized and fastest selling personal computer. In this article, we'll install and configure Oracle Java ME Embedded on a Raspberry Pi. > What is a Raspberry Pi? The Raspberry Pi is a low cost, credit-card sized computer that plugs into a computer monitor or TV,

· 7 min read

Build, Install and Configure Eclipse Plugin for Apache Hadoop 2.2.0

Apache Hadoop Development Tools (HDT) [https://hdt.incubator.apache.org/] is still in development phase. So, no official distribution of Hadoop 2.2.0 Eclipse Plugin is available now. But we can build the same using winghc/hadoop2x-eclipse-plugin [https://github.com/winghc/hadoop2x-eclipse-plugin].

· 5 min read

Run Hadoop Wordcount MapReduce Example on Windows

In this post, we'll use HDFS command 'bin\hdfs dfs' with different options like mkdir, copyFromLocal, cat, ls and finally run the wordcount MapReduce job provided in %HADOOP_HOME%\share\hadoop\mapreduce\hadoop-mapreduce-examples-2.2.0.jar. On successful execution of the job in the Single Node (ps

· 3 min read

Configure SSL/HTTPS support on Apache Tomcat 7

By default, HTTPS / SSL is not configured and enabled in Tomcat Web server. SSL setup is required to make your web application accessible over HTTPS protocol. This post will guide you to configure SSL in Tomcat 7 Web server. Tools and Technologies used in this article : 1. Tomcat 7.0.47 [https://t

· 2 min read

Get Redirections of a URL using Apache HttpComponents HttpClient

Many websites use URL redirection technique to forward the original request from one location to another several times for different reasons (Domain forwarding, URL shortening, Privacy protection, Maintaining similar domain names referring single website, etc.). In this post, I'll try to demonstrate

· 3 min read

ERROR util.Shell: Failed to locate the winutils binary in the hadoop binary path

If we directly take the binary distribution of Apache Hadoop 2.2.0 release and try to run it on Microsoft Windows, then we'll encounter ERROR util.Shell: Failed to locate the winutils binary in the hadoop binary path.In the previous post - Build, Install, Configure and Run Apache Hadoop 2.2.0 in Mic

· 1 min read

Build, Install, Configure and Run Apache Hadoop 2.2.0 in Microsoft Windows OS

Good news for Hadoop developers who want to use Microsoft Windows OS for their development activities. Finally Apache Hadoop 2.2.0 release officially supports for running Hadoop on Microsoft Windows as well. But the bin distribution of Apache Hadoop 2.2.0 release does not contain some windows nativ

· 10 min read

Expand Shortened Link using Java

Nowadays we use different URL shortening services (like bit.ly [https://bit.ly/] , TinyURL [https://tinyurl.com/], Google URL Shortener [https://goo.gl/] etc.) to shorten long URL to fit in micro-blogging sites (like Twitter [https://twitter.com/]), to beautify a link, view analytics on link clicks,

· 2 min read

Spring Security HTTP Basic Authentication Example

HTTP basic authentication (BA) is a simple authentication mechanism. When a web client requests any secured web resources, server sends an HTTP response with status code 401 (Unauthorized) and WWW-Authenticate HTTP header like WWW-Authenticate: Basic realm="realm here". And browser pops up a login

· 2 min read

Spring Security Custom Login Form Example

In previous posts Spring Security 3 Hello World Example [/spring-security-3-hello-world-example] and Spring Security Logout Example [/spring-security-logout-example], we have used default login form generated by Spring Security framework. Now we'll set up a custom login form for authentication with

· 4 min read

Problem: failed to create task or type eclipse.refreshLocal

Eclipse platform provides different useful Ant tasks [https://help.eclipse.org/indigo/index.jsp?topic=/org.eclipse.platform.doc.isv/guide/ant_eclipse_tasks.htm] to interact with the workspace. If you have added any such Ant task (say eclipse.refreshLocal) in your ant build script and started getti

· 2 min read

Integrate Free Anti-Bot Service reCAPTCHA with Spring MVC application

reCAPTCHA is a free CAPTCHA service to protect a site against spam and other types of automated abuse by bots or computer programs. reCAPTCHA provides widget which can easily be integrated to your blog, forum, comment, registration form, contact form, etc and you can be rest assured that only human

· 4 min read

Spring Security Logout Example

Spring Security provides Logout Handling Service for logging out by navigating to a particular URL (by default /j_spring_security_logout). LogoutFilter [http://static.springsource.org/spring-security/site/docs/3.1.x/apidocs/org/springframework/security/web/authentication/logout/LogoutFilter.html] s

· 2 min read

Spring Security 3 Hello World Example

Security is of great concern in any web application. If you are looking for a proven and industry standard solution to secure your Java/J2ee based application, then widely used and highly customizable authentication and access control framework - Spring Security is well worth considering. This post

· 5 min read

Make HTML table sortable using jQuery Tablesorter plugin

This post describes how to make an HTML table (having THEAD and TBODY) sortable in few minutes using tablesorter jQuery plugin. This plugin can parse and sort many types of data like number, text, currency, URI, IP address, date, time including linked data in a table cell.

· 3 min read

Logback using SLF4J Hello World Example

Logback is an increasingly popular logging framework intended as a successor to the popular log4j project. It is designed by the founder of log4j. Logback offers many advantages over log4j like faster, smaller memory footprint, automatic reloading of configuration files, automatic compression of arc

· 3 min read

Java File and Directory operations made easy in JDK 7

Here we'll see two examples - Copy operation & Traversing a file tree. If you have already worked using JDk 6 or earlier versions then you can see how easy it is to use JDK 7's nio package. And you need to write less code to implement the same. This tutorial shows two examples on the file IO mechan

· 3 min read

Send logs by Email Notification using Apache log4j SMTPAppender

It is always better to get notified as soon as any major issues / exceptions occurred in the Application, instead of manually going thorugh huge logs to find probable exception messages. Apache log4j provides out of the box log Appender (called SMTPAppender) to send email alerts for the log level co

· 2 min read

Deploy to AppFog PaaS using Cloud Foundry Integration plugin of Eclipse / STS

AppFog Cloud Platform is built by using the Cloud Foundry OSS bits alongside its own set of custom extensions and enhancements. AppFog provides good command line tool to deploy application but we can configure Cloud Foundry Integration plugin of Eclipse / Spring Tool Suite (STS) to deploy web applic

· 2 min read

Dynamically create image from text using Java Servlet

This example shows how we can dynamically create an image from a text ('Hello World!') by writing a simple Java Servlet. In the next post, we'll see how this dynamic creation of image can be used to implement custom CAPTCHA validation.

· 2 min read

Configure GZIP Filter on Jetty 8 for dynamic compression of contents

Jetty provides Gzip Filter to enable dynamic compression of contents like html, javascript, css etc. Just a servlet filter 'org.eclipse.jetty.servlets.GzipFilter' needs to be configured in web.xml to save bandwidth and speed up your website.

· 1 min read

Invoke and Execute Hello World Ant Script Programmatically using Java Code

Apache Ant is an XML-based build tool to automate different tasks like compile, assemble, test source code, building deployment packages and run Java applications. This Hello World example shows how to invoke and run a simple Ant script programmatically using java code.

· 3 min read

Full Text Hibernate Lucene Search Hello World Example Using Maven and SQLite

Hibernate Search is a full text search engine built using Apache Lucene framework. Hibernate Search indexes your domain model, keep the index upto date and also performs full text search functionality to fetch matching domain objects. This Hello World example shows how you can setup hibernate search

· 8 min read

Hibernate Hello World example using Maven build tool and SQLite database

This tutorial will help you to write an annotation based hibernate java program which will save some records into a database and fetch them all using Hibernate API. We will use Maven tool to build the project, Eclipse IDE to code and SQLite database to save / retrieve records. SQLite is a self-conta

· 5 min read

Hello World Example of Simple Logging Facade for Java or SLF4J

Simple Logging Facade for Java (SLF4J) is an abstraction of different logging frameworks (eg. log4j, java.util.logging, commons logging etc.). This gives the developer an opportunity to plug-in desired logging framework at deployment time without changing the code. To use SLF4J, it is required to i

· 2 min read

Tomcat Hello World Servlet using Eclipse IDE

This simple tutorial explains you, how you can run your first Servlet class that will print "Hello World!" string in the browser. We will use Eclipse IDE to develop the code and Tomcat webserver to run the servlet code.

· 3 min read

How to perform binary search on a java.util.ArrayList

This example shows how an element of a java.util.ArrayList can be searched using 'binarySearch' method of java.util.Collections class. This method internally applies binary search algorithm to search a particular element.

· 2 min read

Java Hello World Example using Eclipse IDE

This article describes how to create a "Hello World" java program using Eclipse IDE. This program will print "Hello World" in the console.

· 1 min read