Skip to content

Instantly share code, notes, and snippets.

View imtiazShakil's full-sized avatar
🤍
Alhamdulillah always

Imtiaz Shakil Siddique imtiazShakil

🤍
Alhamdulillah always
View GitHub Profile
@imtiazShakil
imtiazShakil / DateTime Techniques.txt
Last active January 15, 2020 14:34
Best way to store DateTime in Mysql and read/write on them in Java
Question: Which Mysql Data Type to use and when?
1. Can your application supply / read / assume that all dates are UTC, and you want performance?
=> INTEGER as a unix timestamp.
2. Can your application supply / read / assume that all dates are UTC, or you need to store dates older than 1970 or after 2038, but want them to be human readable?
=> DATETIME
3. Do you need a fixed point in time regardless of timezones, and will your code assume the value you get is in the local timezone of the MySQL server?
=> TIMESTAMP
@imtiazShakil
imtiazShakil / curl.md
Last active March 13, 2024 06:39 — forked from subfuzion/curl.md
curl POST examples

Common Options

-#, --progress-bar Make curl display a simple progress bar instead of the more informational standard meter.

-b, --cookie <name=data> Supply cookie with request. If no =, then specifies the cookie file to use (see -c).

-c, --cookie-jar <file name> File to save response cookies to.

@imtiazShakil
imtiazShakil / maven-tricks.md
Last active December 14, 2021 13:09
Maven Tips & Tricks

Maven select profile

./mvnw clean install -P myprofie

Run Maven goals from another directory

./mvnw -f /location/to/different/pom/directory clean package

Maven select specific project (in a multi module project)

./mvnw clean install -pl 'child-project'

Maven skip specific project (in a multi module project)

@imtiazShakil
imtiazShakil / setup-java.md
Last active June 30, 2024 09:06
Installing Java on a fresh linux server

Installing jdk 21 by eclipse-temurin

sudo apt-get install -y wget apt-transport-https gpg
sudo wget -qO - https://packages.adoptium.net/artifactory/api/gpg/key/public | gpg --dearmor | sudo tee /etc/apt/trusted.gpg.d/adoptium.gpg > /dev/null
# For Linux Mint (based on Ubuntu) you have to replace VERSION_CODENAME with UBUNTU_CODENAME. 
echo "deb https://packages.adoptium.net/artifactory/deb $(awk -F= '/^UBUNTU_CODENAME/{print$2}' /etc/os-release) main" | sudo tee /etc/apt/sources.list.d/adoptium.list



sudo apt-get update
@imtiazShakil
imtiazShakil / Powershell-basics.md
Last active September 23, 2024 08:18
Basic commands for daily life usage of powershell

Unix head, tail, sed equivalent commands in Windows Powershell

Get-Content (alias: gc) is your usual option for reading a text file.

gc log.txt -head 10 
gc log.txt -tail 10
gc log.txt -tail 10 -wait # equivalent to tail -f
gc log.txt | %{ $_ -replace '\d+', '($0)' }         # sed
@imtiazShakil
imtiazShakil / mysql-setup.md
Last active January 4, 2022 09:58
Setup MySQL 8+ on Linux

For Older Linux distributions (Optional)

Download latest apt-config package from mysql and install it: https://dev.mysql.com/downloads/repo/apt/ Make sure you provide the latest release(focal/buster) during apt-package installation.


Install

sudo apt update
@imtiazShakil
imtiazShakil / sublime-text-3-windows-shortcuts.md
Created August 14, 2020 17:52 — forked from mrliptontea/sublime-text-3-windows-shortcuts.md
Sublime Text 3 - Useful Shortcuts (Windows)

Sublime Text 3 - Useful Shortcuts (Windows)

General

Shortcut Description
Ctrl+Shift+P command prompt
Ctrl+Alt+P switch project
Ctrl+P go to file
Ctrl+G go to line
@imtiazShakil
imtiazShakil / ide-keymap.md
Last active July 2, 2024 14:39
My IDE Keymap
Description Shortcut Used in Ide
Delete Line Ctrl + Shift + k (Sublime, Intellij, VScode)
format file Shift + Alt + f (VScode-windows)
Goto Class/file Ctrl + P (sublime, VScode)
Goto Symbol/Methods Ctrl + R (sublime)
Goto Line Ctrl + G (sublime, VScode, Intellij, Eclipse)
Command/Action Ctrl + Shift + P (Sublime, VScode)
Quick Defintion (source code) Ctrl + Shift + i (Browser, Intellij)
Quick Type Definition Ctrl + Q (Intellij)
@imtiazShakil
imtiazShakil / linux-keyboard-shortcuts.md
Last active June 29, 2024 18:48
commonly used linux shortcuts
Description Shortcut Comments
show desktop Super + D linux + windows
cycle open window Alt + Tab linux + windows
show all windows Ctrl + Alt + Down linux Mint
show all workspaces Ctrl + Alt + Up linux Mint
snap window up/down/left/right Super + ⬆️ ⬇️ ⬅️ ➡️ linux
move window to left/right workspace Shift + Ctrl + Alt + ⬅️ ➡️ linux
move window to left/right monitor Shift + Super + ⬅️ ➡️ linux
switch to left/right workspace Ctrl + Alt + ⬅️ ➡️ linux
@imtiazShakil
imtiazShakil / OpenIDConnectProviders.md
Last active August 19, 2021 18:14
OpenID Connect Providers

Choice List: https://oauth.net/code/java/

Option 1: MITREid Connect

Good:

  • based on Java, Spring, and Spring Security
  • Supports basic OpenID Connect features
  • Active Community
  • so and so documentation
  • RESTful API for managing clients, scopes, whitelists, blacklists, approvals, and tokens