Skip to content

Instantly share code, notes, and snippets.

@hunzo
hunzo / enable-snmp.ps1
Last active June 18, 2025 03:44
enable-snmp by powershell script
# Install SNMP Feature
Install-WindowsFeature SNMP-Service -IncludeAllSubFeature -IncludeManagementTools
# Setting SNMP Service Start Automatic
Set-Service -Name SNMP -StartupType Automatic
Set-Service -Name SNMPTRAP -StartupType Automatic
Start-Service -Name SNMP
Start-Service -Name SNMPTRAP
# Seting SNMP Community (ex. public)

ขั้นตอนการตั้งค่า Certificate Template สำหรับ 802.1X บน Windows Server (ฉบับสมบูรณ์)

เอกสารนี้สรุปขั้นตอนทั้งหมดสำหรับการสร้าง, ตั้งค่า, และแจกจ่าย Certificate สำหรับการยืนยันตัวตนผ่านเครือข่ายด้วยมาตรฐาน 802.1X โดยใช้ Active Directory Certificate Services (AD CS) บน Windows Server


📋 1. สิ่งที่ต้องมีก่อน (Prerequisites)

ก่อนเริ่มต้น ต้องแน่ใจว่าระบบของคุณมีองค์ประกอบต่อไปนี้ครบถ้วน:

  1. Active Directory Domain Services (AD DS): ติดตั้งและทำงานได้อย่างสมบูรณ์
@hunzo
hunzo / install.sh
Last active June 17, 2025 02:19
my install update 20250528
#!/bin/bash
# ===============================================
# Dotfiles Installation Script
# This script automates the setup of development tools
# including Go, Python, nvm (Node.js), Neovim, and Ansible.
#
# Author: hunzo (Original)
# Refactor: Gemini
# Date: May 28, 2025
@hunzo
hunzo / machine-id.sh
Created May 28, 2025 04:14
vmware esxi template for linux
sudo rm /etc/machine-id
sudo touch /etc/machine-id
sudo chmod 644 /etc/machine-id
@hunzo
hunzo / allow-rdp.ps1
Last active May 22, 2025 02:34
RDP powershell
Set-ItemProperty -Path "HKLM:\System\CurrentControlSet\Control\Terminal Server" -Name "fDenyTSConnections" -Value 0
Set-ItemProperty -Path "HKLM:\System\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp" -Name "UserAuthentication" -Value 0
Enable-NetFirewallRule -DisplayGroup "Remote Desktop"
New-NetFirewallRule `
-DisplayName "Allow RDP from All Networks (3389)" `
-Direction Inbound `
-Protocol TCP `
-LocalPort 3389 `
-Action Allow `
-Profile Domain,Private,Public `
@hunzo
hunzo / decK.sh
Last active May 6, 2025 08:21
backup and restore kong
#/bin/bash
# Install decK
curl -sL https://github.com/kong/deck/releases/download/v1.47.0/deck_1.47.0_linux_amd64.tar.gz -o deck.tar.gz
tar -xf deck.tar.gz -C /tmp
sudo cp /tmp/deck /usr/local/bin/
export KONG_ADMIN_URL=http://localhost:8001
# backup
# deck gateway dump -o backup-file.yaml
@hunzo
hunzo / .env
Last active May 6, 2025 08:27
simple kong-gateway
POSTGRES_USER=kong
POSTGRES_DB=kong
POSTGRES_PASSWORD=postgres_password
KONG_PASSWORD=kong_password
KONG_LICENSE_DATA=
TZ=Asia/Bangkok
@hunzo
hunzo / app.py
Last active March 11, 2025 08:31
from fastapi import FastAPI, WebSocket, UploadFile, File
import whisper
import os
import time
app = FastAPI()
model = whisper.load_model("large", device="cpu")
UPLOAD_DIR = "uploads"
OUTPUT_DIR = "output"
@hunzo
hunzo / install.sh
Last active April 22, 2025 03:52
Install K3s with Cilium
#!/bin/bash
curl -sfL https://get.k3s.io | INSTALL_K3S_EXEC='--flannel-backend=none --disable-network-policy --disable=traefik' sh -
echo 'alias kubectl="sudo k3s kubectl"' >> ~/.bashrc
echo 'alias k="kubectl"' >> ~/.bashrc
echo "source <(kubectl completion bash)" >> ~/.bashrc
echo "complete -o default -F __start_kubectl k" >> ~/.bashrc
curl https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3 | bash
@hunzo
hunzo / compose.yaml
Last active February 27, 2025 04:54
simple ollama
services:
ollama:
image: ollama/ollama:latest
container_name: ollama
restart: unless-stopped
ports:
- "11434:11434"
volumes:
- ollama_data:/root/.ollama
command: ["serve"]