Skip to content

Instantly share code, notes, and snippets.

View tbvinh's full-sized avatar
🧑‍🍼
I may be slow to respond.

Vinh Tran tbvinh

🧑‍🍼
I may be slow to respond.
  • Ho Chi Minh - Vietnam
View GitHub Profile
@tbvinh
tbvinh / gist:31e38452cde4f22d09990178da679f85
Created January 29, 2026 06:56
Tìm và xóa user trong tất cả các repositories của Github
$TEN_CUA_BAN = "tbvinh"
$XXXX = "xxx" #-- người cần xóa
# Lấy danh sách tên tất cả repo
$repos = gh repo list $TEN_CUA_BAN --limit 1000 --json name --jq '.[].name'
foreach ($repo in $repos) {
# Kiểm tra xem user có trong repo này không
@tbvinh
tbvinh / list-users.ps
Created January 29, 2026 06:54
liệt kê tất cả các user có trong github account
$TEN_CUA_BAN = "tbvinh"
$all_users = @()
# 1. Lấy danh sách tất cả các repo
$repos = gh repo list $TEN_CUA_BAN --limit 1000 --json name --jq '.[].name'
Write-Host "Đang quét tất cả repositories, vui lòng đợi..." -ForegroundColor Cyan
# 2. Duyệt qua từng repo để lấy danh sách user
foreach ($repo in $repos) {
#!/bin/bash
# --- Cấu hình dự án ---
PROJECT_DIR="mva_terraform_project"
echo "Bắt đầu tạo cấu trúc dự án Terraform tại thư mục: $PROJECT_DIR"
# 1. Tạo thư mục gốc
mkdir -p $PROJECT_DIR
cd $PROJECT_DIR
@tbvinh
tbvinh / readme.md
Last active November 4, 2025 06:24

Create springboot - docker - graalvm

docker build -f  Dockerfile-native-image -t native-builder .

docker create --name temp-native native-builder
docker cp temp-native:/app/target/native-demo ./target/native-demo
docker rm temp-native

docker build -f Dockerfile-bookworm -t bookworm-runtime .
@tbvinh
tbvinh / ConnectBot build.md
Created October 17, 2025 08:49
How to use Docker Desktop build the ConnectBot APK
@tbvinh
tbvinh / get-ngrok.py
Created July 30, 2024 12:26
AI - get ngrOK URL
import requests
def get_ngrok_url():
try:
response = requests.get('http://localhost:4040/api/tunnels')
tunnels = response.json()['tunnels']
if tunnels:
return tunnels[0]['public_url']
else:
return None
#/etc/apache2/sites-enabled/000-default.conf
sudo a2enmod proxy
sudo a2enmod proxy_http
sudo a2enmod headers
sudo systemctl restart apache2
<VirtualHost *:80>
#ServerName www.example.com
@tbvinh
tbvinh / ngrok.service
Created July 30, 2024 12:22
AI ngrok service
#/etc/systemd/system/ngrok.service
[Unit]
Description=Ngrok Tunnel
After=network.target
[Service]
User=vinh
ExecStart=/usr/local/bin/ngrok http 80
@tbvinh
tbvinh / gunicorn.service
Created July 30, 2024 12:21
AI-gunicorn service
#/etc/systemd/system/gunicorn.service
[Unit]
Description=Gunicorn instance to serve myapp
After=network.target
[Service]
User=vinh
Group=www-data
WorkingDirectory=/home/vinh
@tbvinh
tbvinh / universal-sentence-encoder.py
Created July 25, 2024 11:09
Save model 'universal-sentence-encoder' to disk
import tensorflow as tf
import tensorflow_hub as hub
# Check if the Universal Sentence Encoder can be loaded from the provided link
model_url = "https://tfhub.dev/google/universal-sentence-encoder/4"
try:
model = hub.load(model_url)
# model.save('universal-sentence-encoder.model')
tf.saved_model.save(model, 'universal-sentence-encoder.model')