Skip to content

Instantly share code, notes, and snippets.

View anhtuank7c's full-sized avatar

Tuan Nguyen anhtuank7c

View GitHub Profile
@anhtuank7c
anhtuank7c / activation.py
Created January 16, 2026 10:52
Sửa lỗi Antigravity Agent Terminated due to error
#!/usr/bin/env python3
"""
🏯 UItra License Activation Script
===================================
Activates UItra (PRO tier) license for specified email.
Stores license in ~/.mekong/license.json for offline CLI usage.
Usage:
python3 scripts/activate_uitra.py <email>
@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