# Hay

# Pi Hole - DNS server dành cho nhà, chặn ads và các website nguy hiểm

[![image.png](https://wiki.kyluat.com/uploads/images/gallery/2024-05/scaled-1680-/kuRimage.png)](https://wiki.kyluat.com/uploads/images/gallery/2024-05/kuRimage.png)

Lợi ích:

- Block ads server và các website nguy hiểm
- Cache DNS hostname và ip address , làm truy cập lẹ hơn
- Tăng tốc độ lướt web vì block các ads domain
- Tạo name cho từng máy ảo ở nhà để dễ nhìn
- Bảo vệ mạng nhà đỡ bị nhà mạng theo dõi

Khi bạn xài internet và app nhiều thì các app có thể lưu và theo dõi thông tin của bạn. Ví như zalo app

[![image.png](https://wiki.kyluat.com/uploads/images/gallery/2024-05/scaled-1680-/kDjimage.png)](https://wiki.kyluat.com/uploads/images/gallery/2024-05/kDjimage.png)

Ngoài ra mình có thể tạo dns names cho từng địa chỉ ip máy ảo tại nhà:

[![image.png](https://wiki.kyluat.com/uploads/images/gallery/2024-05/scaled-1680-/7njimage.png)](https://wiki.kyluat.com/uploads/images/gallery/2024-05/7njimage.png)

Các máy nào cần dns cache và block ads thì để dns của pi hole vào.

[![image.png](https://wiki.kyluat.com/uploads/images/gallery/2024-05/scaled-1680-/lsJimage.png)](https://wiki.kyluat.com/uploads/images/gallery/2024-05/lsJimage.png)

# Mailrise: Chuyển SMTP Email tới Text Apps như Telegram, Pushover, ...

Vấn đề của email là nó rườm rà. Mailrise giúp chuyển email messages tới telegram, sms, và các email khác.

##### Cài đặt Mailrise

App: [https://github.com/YoRyan/mailrise](https://github.com/YoRyan/mailrise)

Bạn cài với portainer docker compose sau:

```
version: '3'
services:
  mailrise:
    image: 'yoryan/mailrise:latest'
    ports:
      - 8025:8025
    volumes:
      - /home/u220187/docker/mailrise/mailrise.conf:/etc/mailrise.conf # Make sure your local config directory exists
      - /var/run/docker.sock:/var/run/docker.sock # (optional) For docker integrations
    environment:
      PUID: 1000
      PGID: 1000
```

path volume nhớ chỉnh lại cho đúng.

- ssh vào vm node đã cài docker

[![image.png](https://wiki.kyluat.com/uploads/images/gallery/2024-06/scaled-1680-/xO5image.png)](https://wiki.kyluat.com/uploads/images/gallery/2024-06/xO5image.png)

- vào user path vào tạo file mailrise.conf với ở path /home/u220187/docker/mailrise/

[![image.png](https://wiki.kyluat.com/uploads/images/gallery/2024-06/scaled-1680-/7Bbimage.png)](https://wiki.kyluat.com/uploads/images/gallery/2024-06/7Bbimage.png)

save lại và chạy docker compose như trên.

##### Settings cho smtp client trên router / synology / server của bạn:

Settings smtp cho Mikrotik router :

[![image.png](https://wiki.kyluat.com/uploads/images/gallery/2024-06/scaled-1680-/HyCimage.png)](https://wiki.kyluat.com/uploads/images/gallery/2024-06/HyCimage.png)

```
Smtp server: ip / dns local name tới docker server
Port: 8025
Tls: no
From: email nào cũng đc
```

To: email nào cũng ổn

Setting smtp Synology Notification:

[![image.png](https://wiki.kyluat.com/uploads/images/gallery/2024-06/scaled-1680-/Eneimage.png)](https://wiki.kyluat.com/uploads/images/gallery/2024-06/Eneimage.png)

Setting SMTP Email cho IDRAC của DELL:

[![image.png](https://wiki.kyluat.com/uploads/images/gallery/2024-06/scaled-1680-/vlFimage.png)](https://wiki.kyluat.com/uploads/images/gallery/2024-06/vlFimage.png)

Setting cho UPTIME KUMA:

[![image.png](https://wiki.kyluat.com/uploads/images/gallery/2024-06/scaled-1680-/I5himage.png)](https://wiki.kyluat.com/uploads/images/gallery/2024-06/I5himage.png)

...

Nếu bạn có xài ups thì set cho ups với device check, send log email tới và nhận notifcation trên điện thoại.

Ví dụ: microtik router và ups santak đã kết nối usb với tới router.

[![image.png](https://wiki.kyluat.com/uploads/images/gallery/2024-06/scaled-1680-/hgNimage.png)](https://wiki.kyluat.com/uploads/images/gallery/2024-06/hgNimage.png)

Giả sử bạn đã set smtp setting email cho microtik rồi như hình phía trên. sau đó bạn vào system -&gt; logging

Tạo action trước

[![image.png](https://wiki.kyluat.com/uploads/images/gallery/2024-06/scaled-1680-/xSSimage.png)](https://wiki.kyluat.com/uploads/images/gallery/2024-06/xSSimage.png)

[![image.png](https://wiki.kyluat.com/uploads/images/gallery/2024-06/scaled-1680-/jaqimage.png)](https://wiki.kyluat.com/uploads/images/gallery/2024-06/jaqimage.png)

Sau thêm rules với action name pushover

[![image.png](https://wiki.kyluat.com/uploads/images/gallery/2024-06/scaled-1680-/8Wbimage.png)](https://wiki.kyluat.com/uploads/images/gallery/2024-06/8Wbimage.png)

Click apply.

Demo video: [https://youtube.com/shorts/nQ9Ic7--ftg?feature=share](https://youtube.com/shorts/nQ9Ic7--ftg?feature=share)

# AI: Máy Suy Nghĩ hay Chính Bản Thân Bạn nên Suy Nghĩ

Ai như công cụ máy tính bỏ túi chứ không phải môn toán.

Ai không thể thay thế sự suy nghĩ thông qua não dùm mình được, nó chỉ là công cụ suy nghĩ và tóm gọn lại mọi thứ chứ không phải chính bản thân chúng ta đúc kết , tìm tòi, tin tưởng vào chính chúng ta.

Chúng ta có thể hỏi một người nhưng cần phải học chứ không phải chỉ có hỏi và copy paste câu trả lời.

Ai có thể đưa ra những ý chính của một quyển sách rất nhanh gọn lẹ nhưng không thể để lại một niềm tin vững chắc cho người hỏi, một sự tin của người đã đọc hết quyển sách.

Sau đây là tóm tắt lại video của một người đã suy nghĩ và tóm gọn lại trong 5 phút về vấn nạn AI:

Thế giới đang đi đến chỗ con người **không còn nhớ mình biết điều gì từ đâu**. AI ghi chú giúp bạn, tóm tắt giúp bạn, viết giúp bạn, trả lời thay bạn. Bạn chỉ cần gật đầu. Điều này làm chúng ta **mất dần khả năng tự suy nghĩ**.

Giống như máy tính bỏ túi đã làm chúng ta bớt giỏi tính nhẩm, AI đang làm chúng ta **bớt suy nghĩ thật sự**. Nó trả lời trước khi ta kịp đặt câu hỏi. Điều này tạo ra một kiểu “kiến thức phẳng”: biết nhiều thứ nhưng **không hiểu sâu**, không biết nguồn gốc, không suy luận được.

Ngày xưa, trí nhớ là thứ hình thành tính cách. Khi bạn tự nhớ, tự suy nghĩ, tự đấu tranh với ý tưởng – bạn trở nên thông minh hơn và mạnh mẽ hơn. Nhưng khi mọi thứ được AI nhớ giùm và nghĩ giùm, bạn có **kiến thức nhưng không có trọng lượng**, không có chiều sâu.

Nguy hiểm là:  
Chúng ta **tưởng mình biết**, nhưng thật ra không hề biết. Và khi bị chất vấn, không bảo vệ được quan điểm.

AI làm mọi thứ nhanh hơn, nhưng **tốc độ không phải lúc nào cũng tốt**. Một xã hội siêu nhanh nhưng ít suy nghĩ sẽ chỉ chạy vòng vòng, không tiến hóa.

Có những thứ **không thể giao cho máy**: sự dũng cảm, gu thẩm mỹ, sự suy xét, trí tuệ. Những thứ đó cần **nỗ lực, sự khó chịu, sự va chạm**.

Vì vậy, tác giả kêu gọi: hãy **giữ lại một chút ma sát** trong cuộc sống.  
– Dùng tóm tắt AI, nhưng **hãy tự viết kết luận**.  
– Dùng lịch, nhưng **tự quyết định điều gì quan trọng**.  
– Hỏi chatbot, nhưng **hãy tự tranh luận lại**.  
– Đọc nguồn gốc, không chỉ đọc bản tóm tắt.  
– Tập thói quen suy nghĩ chậm, suy nghĩ sâu.

Nếu không, chúng ta sẽ có “kiến thức” nhưng mất đi **trí tuệ** – và mất luôn chính mình.

[https://www.youtube.com/watch?v=rHPOyS6mjwI](https://www.youtube.com/watch?v=rHPOyS6mjwI)

**“Cognitive Hygiene: Why You Need to Make Thinking Hard Again”** nghĩa là:

**“Vệ sinh nhận thức: Vì sao bạn cần làm cho việc suy nghĩ trở nên khó khăn trở lại.”**

Giải thích ngắn gọn cho 18 tuổi:

- *Cognitive Hygiene* = “vệ sinh nhận thức”, tức là giữ cho **tâm trí sạch sẽ, sắc bén**, không để bị lười suy nghĩ hay bị AI/thuật toán làm hộ quá nhiều.
- “Make thinking hard again” = khiến việc **tự suy nghĩ trở lại**, không để máy móc làm hết.

Ý chính của tiêu đề:  
👉 Con người đang quá phụ thuộc vào AI và công cụ nhanh, khiến não lười.  
👉 Muốn giữ sự thông minh, sáng tạo, và bản lĩnh → phải **tự suy nghĩ**, chấp nhận khó, chậm, và có ma sát.

# Wireguard + Pihole = Kết nối VPN và lướt web không ads

Install wireguard + pihole with this portainer stack

WireGuard được sử dụng để thiết lập các kết nối VPN an toàn và hiệu quả. Nó bảo vệ dữ liệu khi truyền qua mạng, đảm bảo quyền riêng tư và an toàn cho người dùng. Với cấu hình đơn giản và hiệu suất cao, WireGuard phù hợp cho cả cá nhân và doanh nghiệp.

Pi-hole được sử dụng để chặn quảng cáo và theo dõi trực tuyến ở cấp độ mạng. Hoạt động như một DNS sinkhole, Pi-hole ngăn chặn các yêu cầu đến các máy chủ quảng cáo và theo dõi, cải thiện tốc độ duyệt web và bảo vệ quyền riêng tư cho tất cả các thiết bị kết nối vào mạng.

Khi kết hợp WireGuard và Pi-hole, bạn có thể thiết lập một mạng VPN an toàn, đồng thời chặn quảng cáo và theo dõi trực tuyến. WireGuard bảo vệ kết nối internet của bạn bằng cách mã hóa dữ liệu, trong khi Pi-hole chặn các quảng cáo và trình theo dõi ở cấp độ DNS, đảm bảo quyền riêng tư và trải nghiệm duyệt web sạch hơn cho tất cả các thiết bị kết nối vào mạng VPN.

Lưu ý: cài đặt này trên Ubuntu OS và docker + portainer stack

```
services:
  
  wireguard:
    image: lscr.io/linuxserver/wireguard:latest
    container_name: wireguard
    cap_add:
      - NET_ADMIN # Work good on Ubuntu System
      - SYS_MODULE #optional
    environment:
      - PUID=0 # just type "id" on your OS (Ubuntu/Centos) terminal to see puid and pgid
      - PGID=0
      - TZ=Asia/Ho_Chi_Minh 
      - SERVERURL=ABC.DOMAIN.COM #public domain
      - SERVERPORT=51820 #optional
      - PEERS=20 #optional
      - PEERDNS=172.21.0.3 #optional
      - INTERNAL_SUBNET=10.13.13.0 #optional
      - ALLOWEDIPS=0.0.0.0/0 #optional
      - PERSISTENTKEEPALIVE_PEERS= #optional
      - LOG_CONFS=true #optional
    volumes:
      - /home/USERNAME/docker/wireguard/config:/config # Change USERNAME to your Ubuntu/Centos Username
      - /home/USERNAME/docker/wireguard/lib/modules:/lib/modules #Change USERNAME to your Ubuntu/Centos Username
    ports:
      - 51820:51820/udp
    sysctls:
      - net.ipv4.conf.all.src_valid_mark=1
      - net.ipv4.ip_forward=1
    networks:
      private_network:
        ipv4_address: 172.21.0.4
    restart: unless-stopped
  pihole:
    container_name: pihole
    image: pihole/pihole:latest
    restart: unless-stopped
    hostname: pi.hole
    ports:
      - "88:80/tcp" # Expose port 88 to the public, you can visit with IP:88 or ABC.DOMAIN.COM:88 to pihole and configure it later
    dns:
      - 127.0.0.1
    volumes:
      - ./etc-pihole/:/etc/pihole/
      - ./etc-dnsmasq.d/:/etc/dnsmasq.d/
    cap_add:
      - NET_ADMIN
    networks:
      private_network:
        ipv4_address: 172.21.0.3

networks:
  private_network:
    ipam:
      driver: default
      config:
        - subnet: 172.21.0.0/24



```

[![image.png](https://wiki.kyluat.com/uploads/images/gallery/2024-07/scaled-1680-/image.png)](https://wiki.kyluat.com/uploads/images/gallery/2024-07/image.png)

Bạn có thể vào pihole và config lại với port 88.

Còn wireguard bạn vào đường dẫn để /home/USERNAME/docker/wireguard/config, sau đó copy toàn bộ folder peer1, peer2, peer3.... về máy, mỗi folder sẽ có conf và hình qr để đăng nhập. Đối với window thì cứ import cái file conf của peer vào là hoạt động. đối với đt thì cài wireguard và scan qr

# llama.cpp or LM Studio

Both are great projects, one will serve a personal local ai computing , one will serve multiple purposes.

Yes, LM Studio is built on top of llama.cpp with an UI.

LM Studio: [https://lmstudio.ai/](https://lmstudio.ai/)

llama.cpp: [https://github.com/ggerganov/llama.cpp/blob/master/docs/build.md](https://github.com/ggerganov/llama.cpp/blob/master/docs/build.md)

i personally pick llama and gguf models on hugging faces like: [https://huggingface.co/TheBloke?search\_models=GGUF](https://huggingface.co/TheBloke?search_models=GGUF)

I use lm studio for personal usages and convenient. However, if i ever want to build something bigger, i may need something fast and lightweight like llama.cpp

see example of LM Studio:

[![image.png](https://wiki.kyluat.com/uploads/images/gallery/2025-01/scaled-1680-/bCOimage.png)](https://wiki.kyluat.com/uploads/images/gallery/2025-01/bCOimage.png)

the lm studio support api also:

[![image.png](https://wiki.kyluat.com/uploads/images/gallery/2025-01/scaled-1680-/n98image.png)](https://wiki.kyluat.com/uploads/images/gallery/2025-01/n98image.png)

LM Studio + VScode Extension

VsCode Extention called **CLINE**, it support api gateway to LM Studio API and many others.

[![image.png](https://wiki.kyluat.com/uploads/images/gallery/2025-01/scaled-1680-/EYqimage.png)](https://wiki.kyluat.com/uploads/images/gallery/2025-01/EYqimage.png)

  
Chrome Extension Project named **sidellama** also is built with LM Studio or ollama connection.

[![image.png](https://wiki.kyluat.com/uploads/images/gallery/2025-01/scaled-1680-/7vGimage.png)](https://wiki.kyluat.com/uploads/images/gallery/2025-01/7vGimage.png)

Next, see example of llama.cpp terminal

[![image.png](https://wiki.kyluat.com/uploads/images/gallery/2025-01/scaled-1680-/ORbimage.png)](https://wiki.kyluat.com/uploads/images/gallery/2025-01/ORbimage.png)

of course llama cli is without UI , If anyone who are serious on building for commercial purpose. llama.cpp is for faster response !

# Gemini Coder - Ai Code Generator

Gemini Coder được viết với ngôn ngữ typescript và nextjs

Nó tạo được code theo prompt và build react view page.

<iframe allowfullscreen="allowfullscreen" height="314" src="https://www.youtube.com/embed/I2baVtDHt3Q" width="560"></iframe>

Rất thú vị.

# Wireguard + Wireguard UI + CONFIG for PIHOLE

This is docker compose stack for wireguard + Wireguard UI Setup + Configuration for PI HOLE DNS IP

```yaml
version: "3"
services:
  wireguard:
    image: linuxserver/wireguard:v1.0.20210914-ls7 #lscr.io/linuxserver/wireguard:latest
    container_name: wireguard
    cap_add:
      - NET_ADMIN
      - SYS_MODULE #optional
    environment:
      - PUID=1000
      - PGID=1000
      - TZ=Asia/Ho_Chi_Minh
      - SERVERURL=WIREGUARD.DOMAIN.COM #optional
      - SERVERPORT=51820 #optional
      - PEERS=1 #optional
      - PEERDNS=auto #optional
      #- INTERNAL_SUBNET=10.13.13.0 #optional
      - ALLOWEDIPS=0.0.0.0/0 #optional
      - PERSISTENTKEEPALIVE_PEERS= #optional
      - LOG_CONFS=true #optional
    volumes:
      - /home/ZZZ/docker/wireguard/config:/config
      - /home/ZZZ/docker/wireguard/lib/modules:/lib/modules #optional
    ports:
      - "1987:5000"
      - 51820:51820/udp
    sysctls:
      - net.ipv4.conf.all.src_valid_mark=1
    restart: unless-stopped
  wireguard-ui:
    image: ngoduykhanh/wireguard-ui:latest
    container_name: wireguard-ui
    depends_on:
      - wireguard
    cap_add:
      - NET_ADMIN
    network_mode: service:wireguard
    environment:
      - PIHOLE_SERVER=PIHOLE_DNS_IP
      - PIHOLE_PASSWORD=PWD_PI_HOLE
      - WIREGUARD_DNS=PI_HOLE_DNS_IP
      - SENDGRID_API_KEY
      - EMAIL_FROM_ADDRESS
      - EMAIL_FROM_NAME
      - SESSION_SECRET
      - WGUI_USERNAME=USER
      - WGUI_PASSWORD=PASS
      - WG_CONF_TEMPLATE
      - WGUI_MANAGE_START=true
      - WGUI_MANAGE_RESTART=true
    logging:
      driver: json-file
      options:
        max-size: 50m
    volumes:
      - /home/ZZZ/docker/wireguard-ui/db:/app/db
      - /home/ZZZ/docker/wireguard/config:/etc/wireguard
```

# Convert 4k Video of DJI FIles into 1080p using FFMPEG on Windows

Using RTX 4080 Super Graphic Card

open window command as administrator

cd into the folder which has \*.mp4 files. (eg: cd e:/dji )

```
for %f in (*.MP4) do ffmpeg -hwaccel cuda -i "%f" -vf "hwupload_cuda,scale_cuda=1920:-2" -c:v av1_nvenc -preset p6 -cq 23 -b:v 0 -c:a copy "%~nf_1080p_AV1.mp4"
```

[![image.png](https://wiki.kyluat.com/uploads/images/gallery/2026-02/scaled-1680-/image.png)](https://wiki.kyluat.com/uploads/images/gallery/2026-02/image.png)