Skip to content

Instantly share code, notes, and snippets.

View anhtuank7c's full-sized avatar

Tuan Nguyen anhtuank7c

View GitHub Profile
@anhtuank7c
anhtuank7c / install.sh
Last active July 14, 2026 11:48
Script cài đặt napp tự động
#!/usr/bin/env bash
# ==============================================================================
# install.sh — Bootstrap cài đặt napp trên một server Ubuntu mới.
#
# napp được viết bằng TypeScript/Node.js và đóng gói thành MỘT file duy nhất
# (napp.cjs), nên trước tiên cần đảm bảo Node.js đã có mặt trên máy — script
# này tự lo việc đó (qua NodeSource) nếu chưa có, rồi tải napp.cjs về và cài
# vào /usr/local/bin/napp. Ngoài ra còn cài sẵn 'bun' (system-wide) để có thể
# tạo app chạy bằng bun — có thể tắt bằng NAPP_INSTALL_BUN=0.
#
@anhtuank7c
anhtuank7c / napp.cjs
Last active July 18, 2026 08:50
napp - tiện ích quản lý ứng dụng web nodejs trên Ubuntu
#!/usr/bin/env node
// __NAPP_MARKER__ version=1.11.2
"use strict";
var __create = Object.create;
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __getProtoOf = Object.getPrototypeOf;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __commonJS = (cb, mod) => function __require() {
@anhtuank7c
anhtuank7c / Kubuntu.md
Last active July 10, 2026 17:01
Hướng dẫn cài đặt bộ gõ Tiếng Việt Fcitx5 cho Kubuntu

Hướng dẫn cài đặt Fcitx5 cho Kubuntu (KDE Plasma) trên Wayland

Hướng dẫn này được tối ưu riêng cho Kubuntu sử dụng môi trường KDE Plasma trên session Wayland.

⚠️ Lưu ý quan trọng cho KDE Wayland: KWin (Window Manager) sẽ trực tiếp quản lý và gọi Fcitx5 thông qua giao thức Bàn phím ảo (Virtual Keyboard). Do đó, cách cấu hình Autostart và biến môi trường kiểu cũ của X11/GNOME sẽ gây xung đột.

Bước 1: Cài đặt Fcitx5 và Bộ gõ

Mở Terminal (Konsole) và chạy lệnh sau để cài đặt Fcitx5, giao diện cấu hình Qt và bộ gõ Tiếng Việt fcitx5-bamboo:

@anhtuank7c
anhtuank7c / README.md
Last active June 10, 2026 11:06
lara - PHP/Laravel site manager

lara — Công cụ quản lý website PHP/Laravel (một file duy nhất)

lara giúp tạo, triển khai và quản lý nhiều website PHP/Laravel trên cùng một máy chủ Ubuntu. Mỗi website chạy dưới một user hệ thống riêng với pool PHP-FPM, socket và cấu hình nginx riêng — cô lập hoàn toàn để site này không đọc được dữ liệu của site kia.

  • ✅ Hỗ trợ PHP 7.4 hoặc 8.4, Laravel 8–13 (tự kiểm tra tương thích)
  • 🗄️ Tạo sẵn database + user MySQL/MariaDB riêng cho mỗi site (tùy chọn)
  • 🔒 Quản lý chứng chỉ SSL qua certbot (phát hành / gia hạn / thu hồi)
@anhtuank7c
anhtuank7c / docker-autostart.sh
Last active May 13, 2026 05:00
Stop Docker containers from auto-starting when Docker Desktop launches. Bash script to bulk-set the restart policy (no / unless-stopped / always / on-failure) on all containers, with --status and --dry-run modes. macOS, Linux, WSL.
#!/usr/bin/env bash
# docker-autostart.sh — bulk-manage Docker container restart policies (autostart on/off).
# Author: Tuan Nguyen <https://github.com/anhtuank7c>
# Co-author: Claude Code <https://claude.com/claude-code>
# License: MIT. No warranty. Run --help for details.
set -euo pipefail
# MARK: - Constants
# Single TAB byte, used as field separator for docker -f templates and column(1).
@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