Skip to content

Instantly share code, notes, and snippets.

View ThangLeQuoc's full-sized avatar
:octocat:
Keep smashing the keyboard

Thang Le Quoc ThangLeQuoc

:octocat:
Keep smashing the keyboard
View GitHub Profile
@ThangLeQuoc
ThangLeQuoc / java_keytool_cheat_sheet.md
Created May 20, 2023 09:17 — forked from Hakky54/java_keytool_cheat_sheet.md
Keytool Cheat Sheet - Some list of keytool commands for create, check and verify your keys

Keytool CheatSheet 🔐

Some history

This cheat sheet came into life when I started working on a tutorial of setting up one way tls and two way tls, which can be found here: GitHub - Mutual TLS SSL

Creation and importing

Generate a Java keystore and key pair

keytool -genkeypair -keyalg RSA -keysize 2048 -keystore keystore.jks -alias server -validity 3650
@ThangLeQuoc
ThangLeQuoc / normalize_string.go
Created April 24, 2023 13:50 — forked from nvtuan305/normalize_string.go
golang: normalize string (include Vietnamese)
package main
import (
"fmt"
"golang.org/x/text/runes"
"golang.org/x/text/transform"
"golang.org/x/text/unicode/norm"
"strings"
"unicode"
)
@ThangLeQuoc
ThangLeQuoc / Leadership.md
Last active October 2, 2020 04:50
Leadership Topic
@ThangLeQuoc
ThangLeQuoc / Blue-eyes.md
Last active February 22, 2020 20:16
Mô tả
We couldn’t find that file to show.
@ThangLeQuoc
ThangLeQuoc / fn_generate_random_code.sql
Last active February 13, 2023 05:30
MySQL - Generate Random String With Desired Length Function script
DELIMITER $$
DROP FUNCTION IF EXISTS fn_generate_random_code $$
CREATE FUNCTION fn_generate_random_code (desired_code_len INTEGER) RETURNS VARCHAR(100)
NO SQL
BEGIN
SET @possible_characters = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ';
SET @len = LENGTH(@possible_characters);
SET @random_code = '';
append_char_to_random_code: LOOP
IF LENGTH(@random_code) >= desired_code_len THEN
@ThangLeQuoc
ThangLeQuoc / profiles.json
Created December 22, 2019 09:34
Personal Windows Terminal Profile
{
"$schema": "https://aka.ms/terminal-profiles-schema",
"globals" :
{
"alwaysShowTabs" : true,
"defaultProfile" : "{6e74219a-27e0-45a5-bd15-c47d214c3e14}",
"initialCols" : 120,
"initialRows" : 30,
"keybindings" :
[
@ThangLeQuoc
ThangLeQuoc / OrderServiceIntegrationTestContext.java
Last active September 16, 2019 13:33
Spring Boot Test Configuration
//@ContextConfiguration(classes = { H2ContextConfiguration.class })
//@EnableAutoConfiguration
//@TestPropertySource(locations = "classpath:/application-test.properties")
//@DirtiesContext(classMode = DirtiesContext.ClassMode.AFTER_EACH_TEST_METHOD)
//@EnableAutoConfiguration
//@SpringBootTest(classes = OrderServiceIntegrationTestContext.class, webEnvironment = SpringBootTest.WebEnvironment.NONE)
//@RunWith(SpringRunner.class)
//@ContextConfiguration(classes = { H2ContextConfiguration.class })
//@EnableAutoConfiguration
@ThangLeQuoc
ThangLeQuoc / ListOwner.sql
Created September 14, 2019 04:20
SQL Server - List owners of databases
-- list database and owner id
SELECT SUSER_NAME(owner_sid), * FROM sys.databases;
-- view login creation date
SELECT *
FROM master.sys.sql_logins;
-- view database
SELECT *
FROM master.sys.databases;
@ThangLeQuoc
ThangLeQuoc / MapLoginToDBUser.sql
Created September 12, 2019 07:14
Map MSSQL Login Credentials To An Existing Database User
USE [nacwgrAuthor_UAT_Replica_thangle]
ALTER USER nacwgr_author WITH LOGIN = nacwgr_author
USE [nacwgrCluster_UAT_Replica_thangle]
ALTER USER nacwgr_cluster WITH LOGIN = nacwgr_cluster
USE [nacwgrPublic_UAT_Replica_thangle]
ALTER USER nacwgr_public WITH LOGIN = nacwgr_public
@ThangLeQuoc
ThangLeQuoc / AutoHotkey.ahk
Last active December 17, 2019 02:33
AutoHotKey Script
!j::
Send {Left}
return
!i::
Send {Up}
return
!k::
Send {Down}
return
!l::