Posts

Showing posts from 2022

Enable WIFI ADAPTER Monitor Mode in Kali Linux

Connect the WIFI adapter and add it in VirtualBox USB Settings TP-Link TL-WN725N 150Mbps Wireless N Nano USB Adapter https://www.amazon.in/gp/product/B008IFXQFU Check the Adapter Chippet lsusb Bus 001 Device 002 : ID 2357 : 0109 TP-Link TL-WN823N v2 / v3 [Realtek RTL8192EU] Bus 001 Device 001 : ID 1 d6b: 0002 Linux Foundation 2 . 0 root hub Bus 002 Device 002 : ID 80 ee: 0021 VirtualBox USB Tablet Bus 002 Device 001 : ID 1 d6b: 0001 Linux Foundation 1 . 1 root hub Find Appropriate Driver for Realtek RTL8192EU from GitHub https://github.com/clnhub/rtl8192eu-linux Install the dependencies sudo apt install linux-headers-generic build-essential dkms git Clone the Driver git clone https://github.com/clnhub/rtl8192eu-linux.git Configure the Architecture and Monitor Mode Open MakeFile in Text Editor or Nano If you're using a different architecture than x86, the set (MakeFile) CONFIG_PLATFORM_I386_PC = n set your architecture CONFIG_PLATFORM_ARM_AARCH64

How to Install Sublime Text in Ubuntu or Kali Linux ?

Run ALL the given below commands in Terminal Install the GPG key wget -qO - https: // download.sublimetext.com /sublimehq-pub.gpg | gpg --dearmor | sudo tee / etc /apt/ trusted.gpg.d /sublimehq-archive.gpg > / dev /null Add stable channel from official website echo "deb https://download.sublimetext.com/ apt/stable/" | sudo tee /etc/apt/sources. list .d/sublime- text . list Update apt sources bash sudo apt-get update Ensure that apt is set up to work with https sources sudo apt- get install apt-transport- https Install Sublime Text: sudo apt- get install sublime- text

Installing Kali Linux in Windows 11 using WSL2

Image
Kali Linux is the powerful operating system for penetrate testing and ethical hacking. You can install Kali Linux in three ways, Install along with Windows (Dual Boot) Install using Virtual Machine (VMWare or Virtual Box) Install using WSL2 (Windows Subsystem for Linux) This post explains how to install Kali Linux in Windows 11 using WSL2. Prerequisites: Running Windows 10 version 2004 or higher Open PowerShell as administrator and run: Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux Restart the Windows OS Open PowerShell as administrator and run: dism.exe /online / enable-feature /featurename:VirtualMachinePlatform / all /norestart dism.exe /online / enable-feature /featurename:Microsoft-Windows-Subsystem-Linux / all /norestart Restart the Windows OS Download and install the WSL2 Linux Kernel from here: https://aka.ms/wsl2kernel Open PowerShell as administrator and run: wsl -- set - default -version 2 Install Kali Linux from the

How to Setup and Configure VSCode with GitHub

Image
Install VS Code Download and Install VSCode from the Official Website https://code.visualstudio.com/ Install Extension Pack for Java using Extension Icon in VSCode Create a GitHub Account https://github.com/signup Install GIT Download and Install Git Software For Windows: https://git-scm.com/download/win For Mac: Open terminal and type brew install git Configure Git username and email Open git bash command window and type the following commands one by one. git config --global user.name "your GitHub username" git config --global user.email "your GitHub Email" Sign In VSCode with GitHub Select SignIn Option Choose SignIn with GitHub (This will open a new browser window with GitHub Login) Type your GitHub username and password Choose Always Allow... and Open Visual Studio Code Creating Repository Create a Java Project (Ctrl+Shift+P) in VSCode Publish to GitHub Create .gitignore by unselecting .vscode, \lib, \bin.

Understanding Common Compile Time Errors in Java

What is an Error in Program? Errors are mistakes in a program that prevents it from working condition. Three types of error Compile Time Error Logical Error Runtime Error This document discusses the compile time and logical errors. Unresolved compilation problem Exception in thread "main" java.lang.Error: Unresolved compilation problem This happens when the public class keyword used other than Java File Name Example: Java File Name: Employee.java but public class is EmployeeTest Solution: File must be renamed as EmployeeTest.java class Employee { private String name; public Employee ( String name ) { this .name = name; } public String toString ( ) { return "Employee [name=" + name + "]" ; } } public class EmployeeTest { public static void main ( String[] args ) { System. out .println( new Employee( "Kumar" ).toString()); } } The method is undefined Reason-1:

Configure Windows PowerShell to display Current Working Directory Name

Image
Open Powershell and Check your powershell profile path $profile Create a File if it does not exist mkdir C:\Users\anthoniraj\Documents\WindowsPowerShell\ Create a Profile File notepad C:\Users\anthoniraj\Documents\WindowsPowerShell\Microsoft.PowerShell_profile.ps1 Add the following script and save the content function prompt { $p = Split-Path -leaf -path ( Get-Location ) " $p > " } Restart PowerShell. Now you will see only current working directory in console.

Creating a Java Project using Visual Studio Code

Image
Visual Studio Code (VS Code) is the simple and lightweight editor that can be customized for any programming language. Microsoft provides a powerful VS Code plugin for Java Development. You need a stable JDK for developing Java Project. Java Development Kit (JDK): Bell Soft OpenJDK version 17 Editor: VS Code Install Bell Soft OpenJDK Download and install OpenJDK from the official website (64-Bit Full JDK) https://download.bell-sw.com/java/17.0.3.1+2/bellsoft-jdk17.0.3.1+2-windows-amd64-full.msi After installing the JDK, Go to Command window and check the java version, java -version Setting up the VS Code Editor Download Link: https://code.visualstudio.com/download After installing VS Code, Navigate extension icon and search by typing the keyword java Install Extension Pack for Java plugin from Microsoft Create a Java Project Press Ctrl+Shift+P -> Search java in popup then choose Java: Create Java Project option Select No Build Tools Now Choose the works

Redmine Installation with Code Review Plugin in Ubuntu 20.04

Redmine is the popular open source project management system with code review feature. We can tarck the time spent by developers for a particular project. GIT and SVN can also be linked with redmine for code review. It is complete package for managing projects in a small team size. Redmine URL Redmine is a project management web application. https://redmine.org/projects/redmine/wiki/HowTo_Install_Redmine_50x_on_Ubuntu_2004_with_Apache2 Installing dependencies sudo apt- get update && sudo apt- get upgrade -y Install required packages sudo apt install -y apache2 ruby ruby-dev build -essential libapache2- mod -passenger libmysqlclient-dev sudo apt- get install mysql- server ` Download & Extract Redmine wget http s: //redmine.org/releases/redmine- 5.0 . 1 .tar.gz` cd / opt sudo tar -xvzf ~/redmine- 5.0 . 1 .tar.gz sudo cp -r redmine / opt / Symlink to remove version reference sudo ln -s redmine-5 .0 .1 redmine Configure database Create a database a

Python Requests Library: Handling Exception for REST API Calls

Python requests is a powerful library for consuming REST API methods. There are chances for throwing errors when calling these services. This error can be handled by using base Exception class import requests url = "https://reqbin.com/echo/post/json" try : re = requests. get (url, timeout= 5 ) if re.ok: print (re. text ) else : print ( "Service Unavailable!" ) except Exception: print ( "Connection Error" ) This script will handle the connection timed out error and maximum retry error. Gist URL: https://gist.github.com/anthoniraj/619bfec6dc389290aa0ccda2927163c5

Setting up the React Native Expo Development Environment

Operating System : Windows 11 Processor: AMD Install NodeJS Download and install the latest LTS (Long Term Support) version of NodeJS from official website Download NodeJS After installing NodeJS, Check the following commands in Command Window node --version npm --version Now, Install Expo Command Line Interface (CLI) using npm, npm install expo-cli --global Check the version after successful installation expo --version Create a new App using expo Go to your workspace folder run expo init app_name app_name can be your favorite name of the app Open the App using VS Code Go to the App Folder cd app_name Open it with code code . Run the Demo App You should be able to use Expo App using VSCode. There is an App.js main script in the root folder Just open and explore the React Script Run the app in VSCode Terminal using expo start command Check the App Output You can simply open the app in browser to check the output. You can also install Expo Mobil

Resolved: Connecting MongoDB URI with Password having Special Characters

MongoDB provides drivers for connecting databases with various programming languages like Java, Python, JavaScript, and C#. As per official documentation, there is a standard URI (Uniform Resource Identifier) for creating connection through programming. The syntax is, mongodb://username:password@host:port/defaultauthdb If the password has special characters like : / ? # [ ] @ then there will be a problem with the above URL syntax for making connection. To resolve this, Percentage-encoding mechanism can be used in URI, A percent-encoded octet is encoded as a character triplet, consisting of the percent character "%" followed by the two hexadecimal digits representing that octet's numeric value - Wikipedia. Percentage-encoding for / ? # [ ] @ / - %2F ? - %3F # - %23 [ - %5B ] - %5D @ - %40 Sample Passwords Secure@pass567 can be written as Secure%40pass567 URI: mongodb://tom:Secure%40pass567@localhost:27017/demodbname Secre#tig] can be written as Secr

Microsoft Edge Copy and Paste Issue with Ctrl + C Keyboard Shortcut

Image
There is a problem with copying website text content by using the Ctrl+C keyboard shortcut in the recent version of Microsoft Edge Browser. The same functionality will work if you right-click using the mouse and select the copy option. This is really annoying for Developers and Web users who frequently uses keyboard shortcuts. There is a workaround for this problem to enable copy using Ctrl+C. Workaround: Edge Settings. Open Microsoft Edge Click on the three dots (…) from the right top corner. Select Settings from the drop-down and click on " Appearance " from the left pane. Disable " Show mini menu when selecting text " from the right pane.

Postgres Database Basic Commands and SQL Queries

In this post, We will discuss How to connect the Postgres database in both Windows and Ubuntu Operating Systems and will learn some basic Postgres commands. Also, we shall try a set of basic SQL queries for manipulating database Tables. Connecting Postgres Database in Ubuntu sudo -u postgres p postgres Connecting Postgres Database in Windows Just open the psql window from the start menu Display List of Databases in Postgres #\l Connect to Database (Postgres) #\c postgres; You are now connected to database "postgres" as user "user_3y3vmxg6f". Create a Table (e.g. student) create table student (rollno integer , name character ( 200 ), dob date ); CREATE TABLE Adding Primary Key alter table student add constraint student_pk primary key(rollno); ALTER TABLE Display Tables in DB #\dt; List of relations Schema | Name | Type | Owner --------+---------+-------+---------------- public | s

Developing Java Servlet Web Application using Eclipse and Tomcat Server

Image
Servlet is a Java technology used for developing Web Applications and managed by a container called a servlet engine. It generates dynamic content and interacts with the client through Request and Response. Servlet extends the functionality of a web server. Java Servlet API is available in javax.servlet package. Web Application Architecture (Three Tier) Presentation Layer Client layer: to view the application) Application Layer Business Logic Layer : interacts with the Database layer and sends required information to the Presentation layer Data Layer The data is stored in this layer. The application layer communicates with the Database layer to retrieve the data Java Servlet Life-Cycle The Java Servlet Life cycle includes three stages, init() : gets invoked is when the servers are fired up service() : the service requests from the client end destroy() : Servlet performs the cleanup activities Creating Dynamic Web Project using Eclipse Download eclipse from th

Setting up the Java, JavaFX, and Servlet Environment

Setting up the Java environment in your favorite operating system is really a challenging task when you develop Java Servlet and JavaFX applications. This tutorial explains how to install and setup the Java environment in your Windows operating system. you can use the all in one openJDK called Librica JDK from BellSoft for developing Java FX and other Java applications. Installing Java and JavaFX Bellsoft Librica JDK supports Java and JavaFX out of the box. You can directly download and install from the following URL  https://download.bell-sw.com/java/17.0.3+7/bellsoft-jdk17.0.3+7-windows-amd64-full.msi If you are downloading from the Bellsoft website, ensure that you are downloading Stable LTS and Full JDK Install Visual Studio (VS) Code Editor VS Code is lightweight editor for developing most of the popular programming languages Java Extension Pack can be installed in VS Code for Java Development Download and Install VS Code for developing Java Projects https://code.visualstudio.

Convert Source Code tar.gz , tar.bz2 or rpm files into deb Package

Developer can easily convert the source code into distribution based package format. These packages are easy installable and configurable . There are two package types used in all Linux distribution deb package [ Debian based Package ] rpm package [ Redhat Package Manager] Debian, Ubuntu, Gentoo, and other Debian based OS are using DEB package,  Redhat, Fedora, CentOS are using RPM package. The conversion between rpm based package to deb package is given in this article. The tool " alien " is used for doing this job. Step 1: Install alien #sudo apt-get install  alien Step 2:  Convert tar.gz to deb #sudo alien /opt/eclipse-helios.tar.gz This command  will create eclipse-helios.deb package in /opt directory. Step 3: Convert rpm to deb #sudo alien ffmpeg-0.6-3.fc13.i686.rpm

How to use JShell in Java?

JSHELL is the command line tools for Read/Evaluate/Print/Loop (REPL) Java Statements. It can be used for learning Java Concepts. The Java Statements executed in JSHELL is called as Snippets. To run, type jshell in Terminal/Command Window. Minimum Java Version? Minimum JDK9 version is required to use JSHELL JSHELL Commands /help - Getting help /exit - Exit JSHELL /list - List ALL Snippets /edit - Edit Snippet in Editor /save - Save Snippets into File /vars - List variables /imports - List imported packages /reset - Reset the current session Ctrl+l - Clear the Screen Ctrl+C - To exit from the current snippet Use as Calculator (Java Operators Demo) 10 + 20 100 * 3863 Create a String String str = "Hello" ; str .toUpperCase() str .length() Create a List Creatigng a Simple List Getting Dynamic Help of a Method (Press Tab after typing Char(s)) List.of() vs Arrays.asList() var myList = Arrays.asList( 4 , 5 , 3 , 1 , 2 ); myList.sort(Comparator