Skip to content

Instantly share code, notes, and snippets.

View adojos's full-sized avatar
🔥
Nerdy Resurrection

Tushar Sharma adojos

🔥
Nerdy Resurrection
View GitHub Profile
@adojos
adojos / apache_multiPort_multiHost_httpd.conf.md
Last active October 7, 2022 12:28
XAMPP | Apache: Config for 'httpd.conf' Implementing multi-ports and multi-virtualHosts [Part 1 of 4]

[Part 1 of 4] Apache2 Multi-Port & Multi-Host 'httpd.conf' Config


In order to have a multi-port configuration for different virtual hosts (projects, websites) on Apache in XAMPP, you need to make changes to the following 3 Apache configuration files and 1 windows host file (if apache is hosted on windows):

1. httpd.conf (\XAMPP\apache\conf)

2. httpd-ssl.conf (\XAMPP\apache\conf\extra)

@adojos
adojos / maven-commands-reference.md
Last active March 26, 2024 10:44
Maven: Common Maven Commands Reference #maven

Maven Commands Reference

Maven offers a good set of commands and CLI Options to carry out wide range of Dev tasks. Most of these commands are in fact Maven build life cycles, phases and goals.

Here is a list of common Maven commands along with explanation. But before we go through the Maven commands, it is good idea to understand the structure or syntax of Maven commands along with a brief about the Maven lifecycle, phases and goals.


Maven Commands Syntax

@adojos
adojos / maven-cli-options.md
Last active March 9, 2023 11:11
Maven: Maven Command Line (CLI) Options #maven

Maven CLI Options Reference


Options Description
-am,--also-make If project list is specified, also build projects required by the list
-amd,--also-make-dependents If project list is specified, also build projects that depend on projects on the list
-B,--batch-mode Run in non-interactive (batch) mode (disables output color)
-b,--builder The id of the build strategy to use
@adojos
adojos / create-maven-project.md
Last active March 9, 2023 14:42
Maven: Create Maven Project Using Command Line #maven

Create Maven Project Using Command Line


Maven project can be easily created using built-in plugins from the popular IDEs such as Eclipse and IntelliJ IDEA. However, in scenarios where you don't or cannot use IDE, we can also create a maven project from the Maven native command line without using any IDE. In this article we would create a simple Java project using Maven command line with and without archetype.

👉 Pre-Requisite:

@adojos
adojos / ssh-commands-reference.md
Last active April 17, 2023 21:10
SSH: Common SSH Commands #ssh

OpenSSH Commands Reference


Commands Description
ssh -V Prints SSH-Agent verion information
ls -al ~/.ssh List existing SSH Keys from standard SSH folder in user profile folder
ssh-keygen -t rsa -b 4096 -C "your_email@example.com" Generating SSH Keys using SSH-Keygen tool of OpenSSH
eval $(ssh-agent -s) Starts the SSH-Agent in the background
@adojos
adojos / DecimalFormatSetMinMaxDigit.java
Last active March 9, 2023 11:10
Java: Format Decimal Set Max/Min Int & Fraction Digits #java
import java.text.DecimalFormat;
public class DecimalFormatSetMinMaxDigit {
public static void main(String[] args) {
double dbNum = 170180.24551D;
DecimalFormat deciFormat = new DecimalFormat();
System.out.println("Original Num: " + dbNum);
@adojos
adojos / DecimalFormatRounding.java
Created December 30, 2021 16:38
Java: Format Decimal using Rounding #java
import java.math.RoundingMode;
import java.text.DecimalFormat;
public class DecimalFormatRounding {
public static void main(String[] args) {
double dbNum = 170180.24551D;
DecimalFormat dFormat = new DecimalFormat();
@adojos
adojos / DecimalFormatGrouping.java
Last active March 9, 2023 11:10
Java: Format Decimal with Group Separator for Int #java
import java.text.DecimalFormat;
public class DecimalFormatGrouping {
public static void main(String[] args) {
double dbNum = 170180.24551D;
DecimalFormat dFormat = new DecimalFormat();
dFormat.setGroupingSize(4);
@adojos
adojos / DecimalFormatAndStringLiteral.java
Created December 30, 2021 16:28
Java: Format Decimal with String Literals #java
import java.text.DecimalFormat;
public class DecimalFormatAndStringLiteral {
public static void main(String[] args) {
double dbNum = 170180.24551D;
String strPattern = "My formatted number is #,###.###";
DecimalFormat deciFormat = new DecimalFormat(strPattern);
@adojos
adojos / DecimalFormatAndFormatSymbols.java
Created December 30, 2021 16:26
Java: Format Decimal with FormatSymbols #java
import java.text.DecimalFormat;
import java.text.DecimalFormatSymbols;
public class DecimalFormatAndFormatSymbols {
public static void main(String[] args) {
double dbNum = 170180.24551D;
String strPattern = "\u00A4#,###.###";