Skip to content

Instantly share code, notes, and snippets.

View anhtuank7c's full-sized avatar

Tuan Nguyen anhtuank7c

View GitHub Profile
@anhtuank7c
anhtuank7c / VMware Workstation KEYS
Created September 23, 2025 07:39 — forked from dapize/VMware Workstation KEYS
key VMware® Workstation 16 Player (16.1.1 build-17801498)
VMware® Workstation 16 Player (16.1.1 build-17801498)
FA1M0-89YE3-081TQ-AFNX9-NKUC0
VMware Workstation Pro v16 Serial Key - DiamondMonday
ZF3R0-FHED2-M80TY-8QYGC-NPKYF
YF390-0HF8P-M81RQ-2DXQE-M2UT6
pxKdy4w9gk2nUGZq5jLBWM
@anhtuank7c
anhtuank7c / API_guideline.md
Created November 29, 2024 08:00
RESTful Guideline

I'll help you improve the API security and design. Let's analyze the current issues and implement better security practices.

Current Issues:

  1. Exposing secret key as a query parameter is insecure because:
    • It appears in server logs
    • It's visible in browser history
    • It can be intercepted in network traffic
    • It might get cached or bookmarked

Here's a comprehensive solution to improve your API security:

@anhtuank7c
anhtuank7c / keycode_mapping.txt
Created November 8, 2024 07:36
Keycode mapping
KEYCODE_0 = 0
KEYCODE_SOFT_LEFT = 1
KEYCODE_SOFT_RIGHT = 2
KEYCODE_HOME = 3
KEYCODE_BACK = 4
KEYCODE_CALL = 5
KEYCODE_ENDCALL = 6
KEYCODE_0_ = 7
KEYCODE_1 = 8
KEYCODE_2 = 9
@anhtuank7c
anhtuank7c / multiprocess.py
Created November 7, 2024 12:52
Test multiprocess in Python
import concurrent.futures
import time
import schedule
from loguru import logger
# Define a sample job function that simulates a long-running process
def my_long_running_task(task_id: int) -> str:
logger.info(f"Task {task_id} started.")
time.sleep(10) # Simulate a task that takes 10 seconds to complete
@anhtuank7c
anhtuank7c / random.txt
Created November 6, 2024 05:24
just some random characters
NuGvJQtzZaR9q5LmK3H7b8
LJqsMbFYEBkgd7zA6wfX4W
jBL5kxuMgezTFPp9YDJ2Ct
pwvUCBMXuc3H75taQdxfys
N6PhxJGtSA8Vu9nCUfceTL
UjL4Adse6kYN7qJF8XyRZf
pxKdy4w9gk2nUGZq5jLBWM
txwS4JN8znD2LcVhYaZpPA
pN7Je2UvXVcGmhHwaW3DC4
LQ2s3n9qfCaTu4EbB6WMUd

Encrypting data with AES128 in JavaScript

Usage

AES128 uses a 16 byte secret key.

const key = new Uint8Array(16);
crypto.getRandomValues(key);
@anhtuank7c
anhtuank7c / rbac
Last active September 20, 2024 18:22
Casbin RBAC - Role Base Access Control
# model.conf
[request_definition]
r = sub, obj, act
[policy_definition]
p = sub, obj, act
[role_definition]
g = _, _ # Role inheritance between users and roles
g2 = _,_ # Resource management between users and resources
@anhtuank7c
anhtuank7c / rbac_with_resource_roles
Last active September 20, 2024 18:22
Casbin RBAC with resource roles example
# model.conf
[request_definition]
r = sub, obj, act
[policy_definition]
p = sub, obj, act
[role_definition]
g = _, _ # Role inheritance between users and roles
@anhtuank7c
anhtuank7c / @react-native-firebase+app+20.0.0.patch
Created August 27, 2024 13:49
Expo Firebase patch that ensure to remove the auth session once app got deleted
diff --git a/node_modules/@react-native-firebase/app/plugin/build/ios/appDelegate.js b/node_modules/@react-native-firebase/app/plugin/build/ios/appDelegate.js
index 8cf92f0..7840ebb 100644
--- a/node_modules/@react-native-firebase/app/plugin/build/ios/appDelegate.js
+++ b/node_modules/@react-native-firebase/app/plugin/build/ios/appDelegate.js
@@ -7,7 +7,13 @@ exports.withFirebaseAppDelegate = exports.modifyAppDelegateAsync = exports.modif
const config_plugins_1 = require("@expo/config-plugins");
const generateCode_1 = require("@expo/config-plugins/build/utils/generateCode");
const fs_1 = __importDefault(require("fs"));
-const methodInvocationBlock = `[FIRApp configure];`;
+const methodInvocationBlock = `[FIRApp configure];