Skip to content

Instantly share code, notes, and snippets.

@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 9, 2025 02:16
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"]
@hunzo
hunzo / compose.yaml
Created January 20, 2025 08:15
docker prometheus
services:
prometheus:
image: prom/prometheus
container_name: prometheus
volumes:
- ./prometheus.yml:/etc/prometheus/prometheus.yml
environment:
- TZ=Asia/Bangkok
networks:
- net
@hunzo
hunzo / readme.md
Created January 15, 2025 08:52
Get ArgoCD default admin password
kubectl -n argocd get secret argocd-initial-admin-secret \
          -o jsonpath="{.data.password}" | base64 -d; echo
@hunzo
hunzo / readme.md
Created December 4, 2024 03:14
Update SSL Certificates Harbor docker
sudo docker compose down -v
vim harbor.yml
sudo prepare
sudo docker compose up -d
https://goharbor.io/docs/2.0.0/install-config/reconfigure-manage-lifecycle/
@hunzo
hunzo / readme.md
Created November 21, 2024 08:08
example config ospf on mikrotik router os version 7

R1

  • initial router R1
/system/identity/set name=R1
/tool/romon/ set enabled=yes
  • set ip address and create bridge
/ip address add address=10.0.0.1/30 interface=ether1
interface/bridge/add name=bridge

DNAT on Mikrotik

  • dnat 10.10.35.102 to 192.168.100.10
/ip address add address=10.10.35.102 netmask=255.255.255.0 interface=ether1
/ip firewall nat add chain=dstnat action=dst-nat dst-address=10.10.35.102 to-addresses=192.168.100.10 protocol=tcp
@hunzo
hunzo / reame.md
Created November 15, 2024 08:58
Passthrough Physical Disk to Virtual Machine (Proxmox)

Passthrough Physical Disk to Virtual Machine (VM)

List Disk by-id with lsblk

lsblk -o +MODEL,SERIAL,WWN

ex.

root@pve-devz:~# lsblk -o +MODEL,SERIAL,WWN
NAME                           MAJ:MIN RM   SIZE RO TYPE MOUNTPOINTS MODEL                SERIAL          WWN
sda                              8:0    0 953.9G  0 disk             HS-SSD-E100 1024G    30128500867     0x50000000000027b6
@hunzo
hunzo / install-mssql.sh
Last active November 13, 2024 03:49
install odbc 18 for ubuntu 24.04
if ! [[ "18.04 20.04 22.04 23.04 24.04" == *"$(lsb_release -rs)"* ]];
then
echo "Ubuntu $(lsb_release -rs) is not currently supported.";
exit;
fi
# Add the signature to trust the Microsoft repo
# For Ubuntu versions < 24.04
# curl https://packages.microsoft.com/keys/microsoft.asc | sudo tee /etc/apt/trusted.gpg.d/microsoft.asc
# For Ubuntu versions >= 24.04