# Kiến Thức Khác

# Good Proxy vs Bad Proxy

Good Proxies

- Search Google: Yes
- Cloudflare Pass: Yes
- [https://ipfighter.com/](https://ipfighter.com/): clean

Bad Proxies:

- Search Google: No
- Cloudflare Pass: No
- [https://ipfighter.com/](https://ipfighter.com/): Low Score

Kiếm ở đâu?

Forum, Facebook Group, Google

Kinh nghiệm:

Hàng custom made vẫn ngon hơn hàng công nghiệp. Cách xác nhận trước khi mua thì xem cty / người này làm bao nhiêu năm rồi? mọi người nói thế nào? mua thử test độ ổn định?

Recommendation:

- [Webshare](https://www.webshare.io/?referral_code=7d99nsxbnt9s)
- [ScrapingAnt](https://scrapingant.com/?ref=mzfkyjg)

# Webpack không hổ trợ cross typescript và commonjs

Một số plugin lâu đời xài require và không thể chạy typescript với webpack.

Đối với nestjs thì nên disable webpack trong compilerOptions.

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

# FancyZones: Tiện ích giúp bạn organize nhiều window qua nhiều màn hình với shortcut

[https://learn.microsoft.com/en-us/windows/powertoys/fancyzones](https://learn.microsoft.com/en-us/windows/powertoys/fancyzones)

Tưởng tượng bạn có 3-4 cái màn hình lớn thì việc sắp xếp nhìn cho gọn các windows là điều không thể không thích được. :)

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

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

Ngoài ra powertoys còn nhiều tiện ích khác để ứng dụng, mình thích cái shortcuts key của nó ví dụ: WIN + SHIFT + / để hiện ra các shortkeys thông dụng mà mình chưa biết, WIN + ⬆ để maximize window nhỏ, WIN + ⬅ để chuyển window từ màn hình A sang B, ...

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

# Sửa lỗi Windows 10 Update Error(0x80070643)

### Mở power shell với run as adminstrator

```
set-executionpolicy remotesigned
```

Tạo 2 folder 1 và 2 , 1 để file 1.ps1, 2 là folder để backup

```
C:\1

C:\2
```

### Download script để sửa lỗi partition bị giới hạn khi update windows

[Download script này](https://ywg2216-my.sharepoint.com/personal/sumit_sumitdh_com/_layouts/15/onedrive.aspx?id=%2Fpersonal%2Fsumit%5Fsumitdh%5Fcom%2FDocuments%2F1%2Eps1&parent=%2Fpersonal%2Fsumit%5Fsumitdh%5Fcom%2FDocuments&ga=1) về folder C:\\1

### Tạo Folder và Mở Powershell window lên

Mở Powershell window as Administrator, cd tới C:\\1

```
cd C:\1
```

Chạy file script đã download về:

```
.\1.ps1
```

Lỗi thì xài command sau:

```
powershell.exe -executionpolicy bypass -file .\1.ps1
```

**Nhấn Y để chạy script**

Khi nó hỏi folder backup là gì thì điền C:\\2

```
C:\2
```

Nhấn enter rồi đợi và sau đó restart

Mở Windows update lên là chạy lại được

### Troubleshoot

Trường hợp link script bị deleted thì vào link này [https://paste1.com/3773/raw](https://paste1.com/3773/raw) , copy hết nội dung qua notepad và save với filename: 1.ps1 vào folder C:/1

### Kết quả

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

# Commands sửa lỗi windows corrupted

Nếu đánh xong sfc mà hiện lỗi corrupted file log thì restart lại xong đánh lại , lặp lại bước này cho đến khi không hiện lỗi nữa tru7o1c khi đánh command DISM.

```
sfc /scannow
DISM /Online /Cleanup-Image /RestoreHealth
```

- Repair lại C++ retro của windows ( vào control panel -&gt; Control Panel\\Programs\\Programs and Features )
- 

# Windows 11 Install va UEFI Bios Utilities Update

1. Check for Win 11 Requirements: [WhyNotWin11](https://github.com/rcmaehl/WhyNotWin11)
2. Enable Secure Boot
3. Enable TPM 2, TPU II
4. Enable PTT, SR-VIO, IOMMU, Firmware TPM
5. Launch CSM enabled, UEFI ONLY
6. Clean Install, no old apps

<span style="color: rgb(224, 62, 45);">**You need to update bios to the latest version in order for TPU II to work on Windows 11. The problem is windows 11 and bios firmware will check the hardware and software security to avoid china hardware and software products to monitor our activities like bed lamp wifi, phone, camera, smart home things...**</span>

[![24-05-05 21-40-02 2936.jpg](https://wiki.kyluat.com/uploads/images/gallery/2024-05/scaled-1680-/24-05-05-21-40-02-2936.jpg)](https://wiki.kyluat.com/uploads/images/gallery/2024-05/24-05-05-21-40-02-2936.jpg)

[![24-05-05 21-40-38 2938.jpg](https://wiki.kyluat.com/uploads/images/gallery/2024-05/scaled-1680-/24-05-05-21-40-38-2938.jpg)](https://wiki.kyluat.com/uploads/images/gallery/2024-05/24-05-05-21-40-38-2938.jpg)

[![24-05-05 21-42-47 2943.jpg](https://wiki.kyluat.com/uploads/images/gallery/2024-05/scaled-1680-/24-05-05-21-42-47-2943.jpg)](https://wiki.kyluat.com/uploads/images/gallery/2024-05/24-05-05-21-42-47-2943.jpg)

[![24-05-05 21-40-17 2937.jpg](https://wiki.kyluat.com/uploads/images/gallery/2024-05/scaled-1680-/24-05-05-21-40-17-2937.jpg)](https://wiki.kyluat.com/uploads/images/gallery/2024-05/24-05-05-21-40-17-2937.jpg)

[![24-05-05 21-42-35 2942.jpg](https://wiki.kyluat.com/uploads/images/gallery/2024-05/scaled-1680-/24-05-05-21-42-35-2942.jpg)](https://wiki.kyluat.com/uploads/images/gallery/2024-05/24-05-05-21-42-35-2942.jpg)

[![24-05-05 21-41-48 2941.jpg](https://wiki.kyluat.com/uploads/images/gallery/2024-05/scaled-1680-/24-05-05-21-41-48-2941.jpg)](https://wiki.kyluat.com/uploads/images/gallery/2024-05/24-05-05-21-41-48-2941.jpg)

[![24-05-05 21-41-20 2940.jpg](https://wiki.kyluat.com/uploads/images/gallery/2024-05/scaled-1680-/24-05-05-21-41-20-2940.jpg)](https://wiki.kyluat.com/uploads/images/gallery/2024-05/24-05-05-21-41-20-2940.jpg)

[![24-05-05 21-42-47 2943.jpg](https://wiki.kyluat.com/uploads/images/gallery/2024-05/scaled-1680-/y0E24-05-05-21-42-47-2943.jpg)](https://wiki.kyluat.com/uploads/images/gallery/2024-05/y0E24-05-05-21-42-47-2943.jpg)

[![24-05-05 21-42-35 2942.jpg](https://wiki.kyluat.com/uploads/images/gallery/2024-05/scaled-1680-/6HK24-05-05-21-42-35-2942.jpg)](https://wiki.kyluat.com/uploads/images/gallery/2024-05/6HK24-05-05-21-42-35-2942.jpg)

[![24-05-05 21-41-48 2941.jpg](https://wiki.kyluat.com/uploads/images/gallery/2024-05/scaled-1680-/QA624-05-05-21-41-48-2941.jpg)](https://wiki.kyluat.com/uploads/images/gallery/2024-05/QA624-05-05-21-41-48-2941.jpg)

[![24-05-05 21-41-20 2940.jpg](https://wiki.kyluat.com/uploads/images/gallery/2024-05/scaled-1680-/jQB24-05-05-21-41-20-2940.jpg)](https://wiki.kyluat.com/uploads/images/gallery/2024-05/jQB24-05-05-21-41-20-2940.jpg)

[![24-05-05 21-40-54 2939.jpg](https://wiki.kyluat.com/uploads/images/gallery/2024-05/scaled-1680-/24-05-05-21-40-54-2939.jpg)](https://wiki.kyluat.com/uploads/images/gallery/2024-05/24-05-05-21-40-54-2939.jpg)

# Phần tôi cài đặt sau khi setup windows 11

Phần mềm trên window:

1. steam
2. wsl
3. lightshot
4. lg hub
5. mpc hc
6. vcl
7. pgadmin
8. postman
9. samsung magician
10. telegram
11. cpu z
12. nextcloud
13. snagit
14. xmind
15. evernote
16. teracopy
17. directx
18. java runtime
19. idm

Phần mềm trên Ubuntu 20.4 LTS

1. docker
2. node
3. git

Setting up DNS for WSL2

```
 sudo rm /etc/resolv.conf
 sudo vi /etc/resolv.conf
```

```
nameserver 192.168.1.11
nameserver 127.0.0.53
options edns0 trust-ad
search .
```

192.168.1.11 la pihole dns

```
sudo chattr +i /etc/resolv.conf
```

```
sudo vi /etc/wsl.conf
```

```
[network]
generateResolvConf = false
generateHosts = true
networkingMode=NAT
```

Install Docker

```
curl -s https://raw.githubusercontent.com/karaage0703/ubuntu-setup/master/install-docker.sh | /bin/bash
```

```
#!/bin/bash
# Reference sites
# https://qiita.com/gen10nal/items/1e7fe8a1b2e9ad1e7919
# https://docs.docker.com/engine/install/ubuntu/

sudo apt-get update
sudo apt-get -y install apt-transport-https ca-certificates curl gnupg-agent software-properties-common
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo apt-key fingerprint 0EBFCD88
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
sudo apt-get update
sudo apt-get -y install docker-ce docker-ce-cli containerd.io
sudo apt-get -y install docker-compose-plugin
sudo gpasswd -a $USER docker
```

install curl, npm, nvm , node version, yarn, helm

```
#!/bin/bash

sudo apt update

sudo apt install git
git --version

sudo apt install -y curl

# install npm
sudo apt install npm -y
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.3/install.sh | bash
nvm install 20.9.0
npm install -g npm@9.6.7

# install yarn
npm install --global yarn

# install docker
curl -s https://raw.githubusercontent.com/karaage0703/ubuntu-setup/master/install-docker.sh | /bin/bash
sudo service docker start

# install neovim
sudo apt install neovim -y
sudo apt install python3-neovim

# install fonts
sudo apt install unzip
wget -P ~/.local/share/fonts https://github.com/ryanoasis/nerd-fonts/releases/download/v3.0.2/JetBrainsMono.zip \
&& cd ~/.local/share/fonts \
&& unzip JetBrainsMono.zip \
&& rm JetBrainsMono.zip \
&& fc-cache -fv

# install helm
curl https://baltocdn.com/helm/signing.asc | gpg --dearmor | sudo tee /usr/share/keyrings/helm.gpg > /dev/null
sudo apt-get install apt-transport-https --yes
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/helm.gpg] https://baltocdn.com/helm/stable/debian/ all main" | sudo tee /etc/apt/sources.list.d/helm-stable-debian.list
sudo apt-get update
sudo apt-get install helm





```

# Backup WSL2 Folder Projects to Windows Drive & Window Task Scheduler Backup

#### Simple Method 2025:

Tạo folder ở một ổ đĩa để backup: ví dụ: E:/backup\_wsl

tạo 2 file bat và vbs:

auto-backup.bat

```
@echo off
setlocal enabledelayedexpansion

:: Get the current date
for /f "tokens=2 delims==" %%i in ('"wmic os get localdatetime /value"') do set datetime=%%i

:: Extract year and month
set year=!datetime:~0,4!
set month=!datetime:~4,2!

:: Set the backup file name
set backupFile=E:\backup_wsl\ubuntu-%year%-%month%.vhdx

:: Run the WSL export command
wsl --export Ubuntu-22.04 !backupFile! --vhd

echo Backup completed: !backupFile!
```

auto-backup.vbs

```
Dim WinScriptHost
Set WinScriptHost = CreateObject("WScript.Shell")
WinScriptHost.Run Chr(34) & "E:\backup_wsl\auto-backup.bat" & Chr(34), 0
Set WinScriptHost = Nothing
```

Nhấn Start trên keyboard và search Task Scheduler

Tạo một task để theo thời gian và option mong muốn trỏ tới action mở file auto-backup.vbs như hình

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

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

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

sau khi ok hết thì thử run task xem có chạy backup ko? Done.

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

#### Simple Method 2024:

```
robocopy /mir \\wsl.localhost\Ubuntu-22.04\home\son\ F:\backups\son\
```

#### Window Task Scheduler Method:

**backup\_kyluat.bat**

```
net use o: \\wsl.localhost\Ubuntu-22.04
robocopy /mir o:\home\son\kyluat F:\backups\son\kyluat /R:1 /W:5 /NP /V /XD node_modules /XD "mongo" /XD "redis" /XD "postgres" /XD dist
net use o: /delete
```

File này để chạy robocopy và copy vào ổ đĩa physical từ network drive

**backup\_kyluat.vbs**

```
Dim WinScriptHost
Set WinScriptHost = CreateObject("WScript.Shell")
WinScriptHost.Run Chr(34) & "F:\backups\backup_kyluat.bat" & Chr(34), 0
Set WinScriptHost = Nothing
```

File này để cho Window Task chạy ngầm,... đỡ phải hiện ra popup window

Tạo trigger action trên window task để mở file backup\_kyluat.vbs theo thời gian muốn chạy backup.

# Sữa lỗi SSH onnection closed by authenticating user root 192.168.1.xxx port 55080 [preauth]

Lỗi: **Jun 01 00:44:48 rack2 sshd\[37416\]: Connection closed by authenticating user root 192.168.1.12 port 55080 \[preauth\]**

Khi: Bạn xài upsnap và bạn muốn shutdown vm thông qua linux ssh command:

```
sshpass -p password ssh -o "StrictHostKeyChecking=no" user@192.168.1.13 "sudo poweroff"
```

Thêm vào 2 dòng sau vào file ssh\_config ở path:

```
nano /etc/ssh/ssh_config
```

```
UserKnownHostsFile=/dev/null
StrictHostKeyChecking=no
```

# Sửa lỗi DNS resolve, Port 53 is already in use trên ubuntu và docker

Lỗi thường thấy:

```
Error starting userland proxy: listen tcp 0.0.0.0:53: bind: address already in use'
```

Tắt SystemD sau khi cài ubuntu 20 lts

```
sudo systemctl stop systemd-resolved
sudo systemctl disable systemd-resolved
```

sửa file:

```
vi /etc/resolv.conf 
```

thêm vào line nameserver:

```
nameserver 127.0.0.53
nameserver 172.19.0.1
```

127.0,0,53 là dòng mặc định ( by default )

thêm nameserver 172.19.0.1 ( server này là pihole )

hoặc đơn giản hơn thì để dns nameserver của google hay cloudflare vào ( 8.8.8.8 hoặc 1.1.1.1 )

# SOLVED: certbot-dns-cloudflare install fails for Nginx Proxy Manager

Problem occurred while configuring cloudflare dns on nginx proxy manager:

#### The Error:

```bash
Error: Command failed: . /opt/certbot/bin/activate && pip install --no-cache-dir certbot-dns-cloudflare==$(certbot --version | grep -Eo '0-9+') cloudflare && deactivate
The 'certbot_dns_cloudflare._internal.dns_cloudflare' plugin errored while loading: No module named 'acme.magic_typing'. You may need to remove or update this plugin. The Certbot log will contain the full error details and this should be reported to the plugin developer.
Ask for help or search for solutions at https://community.letsencrypt.org 1. See the logfile /tmp/certbot-log-drz10np0/log or re-run Certbot with -v for more details.
ERROR: Could not find a version that satisfies the requirement certbot-dns-cloudflare==
ERROR: No matching distribution found for certbot-dns-cloudflare==
```

<div class="codeblock-button-wrapper" id="bkmrk-"></div>#### The Fix:

```
docker ps
```

Use the container id to execute into the terminal of that container:

```
docker exec -it 4f9e14a5d713 /bin/bash
```

Try this:

```
apt update

pip3 install certbot-dns-cloudflare==2.11.0
```

replace 2.11.0 with some other versions that meet the latest version nginx proxy manager

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

Note:   
If you have network issue, then you must fix your dns resolve first then continue the steps above.

# Fix Synology Docker x509: certificate has expired or is not yet valid

Fix Synology Docker x509: certificate has expired or is not yet valid

```
sudo cp /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt.backup
wget --no-check-certificate https://curl.se/ca/cacert.pem
sudo mv cacert.pem /etc/ssl/certs/ca-certificates.crt
sudo synoservice --restart pkgctl-Docker
```

Ref: https://alexnj.com/blog/updating-root-certificates-on-synology/

# How to Copy SSH public keys from Windows to Ubuntu

**1. EDIT** Download [cmder](http://cmder.net/) or use your favorite console emulator. Move your public key (id\_rsa.pub) and your private key (id\_rsa) to `C:\Users\yourUserName\.ssh\` create the .ssh folder if needed.

**2.** On your windows host via cmder:

```
cp C:\Users\yourUserName\.ssh\id_rsa.pub C:\Users\yourUserName\authorized_keys
```

**3.** On your ubuntu host:

`service ssh status` Start sshd if necessary

```
mkdir ~/.ssh/ 
```

(if it doesn't already exist)

**4.** On your Windows host via cmder:

```
cd C:\Users\yourUserName\
```

```
scp authorized_keys login-id@ubuntu-Host-Ip:~/.ssh
```

**5.** On your Ubuntu host:

```
chmod 700 ~/.ssh

chmod 600 ~/.ssh/authorized_keys
```

**6.** On your Windows host via cmder:

Test if you can ssh into your ubuntu host without login/pw auth. If yes:

```
rm C:\Users\yourUserName\authorized_keys
```

# Copy File từ ssh server sang Unix Type OS hoặc Windows

vào sudo vi /etc/ssh/sshd\_config

kiếm Compression, chuyển nó thành Compression yes, save lại và restart với sudo service ssh restart

vào máy unix local / window local , xài command này:

```
scp -p -C -o "Compression yes" -o "IPQoS throughput" -r username@abc.kyluat.com:/path/to/dir/ /mnt/abc/folder/
```

đối với windows thì thêm chữ p vào đầu dòng:

```
pscp.exe username@remoteHost:/remote/dir/file.txt d:\
```

# Open Port 2375 for Docker API

1. Create `daemon.json` file in `/etc/docker`:
    
    ```
     {"hosts": ["tcp://0.0.0.0:2375", "unix:///var/run/docker.sock"]}
    ```
2. Add `/etc/systemd/system/docker.service.d/override.conf`
    
    ```
     [Service]
     ExecStart=
     ExecStart=/usr/bin/dockerd
    ```
3. Reload the systemd daemon:
    
    ```
     systemctl daemon-reload
    ```
4. Restart docker:
    
    ```
     systemctl restart docker.service
    ```
5. firewall

```
ufw allow 2375/tcp
ufw reload
```

# Quy Luật Hai Mặt Trái Ngược và Bù Trừ

Luật game của thế giới Trắng Đen / Yang Yin

Thế giới phân biệt:

1. Có Trắng tất nhiên sẽ bao gồm Đen
2. Có Đúng tất nhiên sẽ bao gồm Sai
3. Có Chất Lượng tất nhiên sẽ bao gồm Số Lượng
4. Có Tập Trung tất nhiên sẽ bao gồm Phi Tập Trung
5. Có Lên tất nhiên sẽ bao gồm Xuống
6. Có Kỷ Luật tất nhiền sẽ bao gồm sự khó chịu kiên trì rèn luyện

Thay vì chia ra đúng sai thì sử dụng tỷ lệ đúng và tỷ lệ sai.

Về số lượng, nếu đúng nhiều hơn sai , đúng thắng

Về chất lượng, nếu đúng chất hơn sai và số lượng ít hơn sai, đúng thắng. Nếu sai chất hơn đúng, và sai ít hơn đúng, sai thắng.

Dimension: x y , Một cột đi lên, một cột đi ngang.

Bên trái cột đi lên là Âm, Bên Phải là Dương.

Bên trên cột đi ngang là Dương, Bên dưới cột đi ngang là Âm.

Khi mix 2 cột với nhau như thế sẽ tạo ra một Area Âm Hoàn Toàn và Âm Dương Mix, Dương Hoàn Toàn, Âm Dương Mix.

Cái ta phải luôn hướng tới tất nhiên là Dương Hoàn Toàn và điều đó cần các điểm hướng lên (+), và điểm hướng ngang (+). Trong cuộc sống để tích cực hóa vùng Dương Hoàn Toàn thì con người đó phải tích cực hóa hai đường để tạo ra vùng Dương Hoàn Toàn.

Trường hợp đi ngang là sự kiên trì lặp đi lặp lại (+), đi lên là một hành động tốt ( tập thể dục ).

Nếu mỗi ngày ta đều tập thể dục và kiên trì giữ trong 10,000 ngày thì mỗi ngày hôm đó ta đều có một điểm dương hoàn toàn.

Nếu ta biết kiên trì lặp đi lặp lại một số hành động chất lượng, thì chắc chắn mỗi ngày ta đều tích được những điểm trong vùng Dương Hoàn Toàn.

Một số ví dụ của dimension này:

1. Thể Lực, Chạy Bộ, Bơi Lội và Gym
2. Tình Yêu: Mối liên kết giữa người và người, Đắc Nhân Tâm, Đạo Đức
3. Kỷ năng: chất lượng của một kỷ năng top 1% và giá trị nó đóng góp cho giống loài
4. Ăn Uống Ngủ Nghỉ
5. Thiên Nhiên

Sau đây là những ý tưởng cho các activities có thể tạo dopamine, chất vui để tạo một số chất (+) cho cơ thể:

<table border="1" cellpadding="0" cellspacing="0" data-sheets-baot="1" data-sheets-root="1" dir="ltr" id="bkmrk-ho%E1%BA%A1t-%C4%91%E1%BB%99ng-rated-di%E1%BB%85n"><colgroup><col width="280"></col><col width="41"></col><col width="474"></col><col width="173"></col></colgroup><tbody><tr><td>Hoạt động</td><td>Rated</td><td>Diễn Giải / Ví Dụ Cụ Thể</td><td>Thời Gian Hoàn Thành</td></tr><tr><td>Dọn dẹp mỗi buổi sáng</td><td>1</td><td>Lau chùi bàn ghế, sắp xếp lại bàn làm việc.</td><td>15-30 phút</td></tr><tr><td>Giãn cơ sau khi ngủ dậy, nghỉ ngơi</td><td>2</td><td>Tập vài động tác giãn cơ cơ bản như chạm mũi chân.</td><td>5-10 phút</td></tr><tr><td>Ăn đồ healthy như trái cây, salad</td><td>2</td><td>Thưởng thức dâu tây, táo hoặc salad trộn với sốt chanh.</td><td>10-20 phút</td></tr><tr><td>Thử món ăn vặt mới</td><td>2</td><td>Mua kem vị mới, thử bánh mousse trong tiệm nổi tiếng.</td><td>15-30 phút</td></tr><tr><td>Tìm ra một quán cà phê yên tĩnh, đẹp</td><td>3</td><td>Khám phá quán có không gian chill với nhạc nhẹ.</td><td>1-2 giờ</td></tr><tr><td>Nghe nhạc mình thích</td><td>3</td><td>Nghe playlist lofi trong lúc làm việc.</td><td>15-60 phút</td></tr><tr><td>Shower: Hot n Cold</td><td>3</td><td>Tắm nóng rồi xả nước lạnh để tỉnh táo và sảng khoái.</td><td>10-15 phút</td></tr><tr><td>Dậy sau khi ngủ đủ</td><td>3</td><td>Ngủ 8 tiếng và cảm thấy tươi mới vào sáng hôm sau.</td><td>7-9 giờ</td></tr><tr><td>Cà phê sữa đá</td><td>3</td><td>Uống ly cà phê sữa đá vào buổi sáng.</td><td>15-30 phút</td></tr><tr><td>Viết nhật ký hoặc ghi lại cảm xúc</td><td>3</td><td>Ghi lại những điều đã làm bạn vui trong ngày hôm nay.</td><td>10-20 phút</td></tr><tr><td>Hoàn thành đọc một quyển sách</td><td>4</td><td>Đọc hết một cuốn tiểu thuyết yêu thích trong 2 tuần.</td><td>1-2 tuần</td></tr><tr><td>Phát hiện ra cái mới, học cái mới</td><td>4</td><td>Khám phá một ứng dụng tiện ích chưa từng biết.</td><td>15-60 phút</td></tr><tr><td>Học hành cái gì đó mới (ví dụ: Udemy)</td><td>4</td><td>Hoàn thành khóa học thiết kế web trên Udemy.</td><td>2-8 tuần</td></tr><tr><td>Xài massage đầu, được massage</td><td>4</td><td>Được massage đầu hoặc vai tại spa.</td><td>30-60 phút</td></tr><tr><td>Cưng chó mèo</td><td>4</td><td>Vuốt ve mèo cưng và chơi đùa với chúng.</td><td>10-30 phút</td></tr><tr><td>Đi dạo công viên hoặc khu phố mới</td><td>4</td><td>Tản bộ quanh hồ hoặc con phố chưa từng tới.</td><td>30-60 phút</td></tr><tr><td>Thử liệu pháp mùi hương</td><td>4</td><td>Dùng nến thơm hoặc tinh dầu bạc hà thư giãn.</td><td>15-30 phút</td></tr><tr><td>Chạy xe vòng vòng dưới ánh sáng</td><td>5</td><td>Lái xe qua các con phố vào buổi tối mát mẻ.</td><td>30-60 phút</td></tr><tr><td>Xem phim tình cảm, drama, hero type</td><td>5</td><td>Xem Queen of Tears hoặc một bộ phim cảm động.</td><td>2-3 giờ</td></tr><tr><td>Hoài niệm, kỷ niệm tuổi thơ ào tới</td><td>5</td><td>Nghe lại bài hát yêu thích thời học sinh.</td><td>10-30 phút</td></tr><tr><td>Ăn món mình thích như món cay, món ngon</td><td>5</td><td>Thưởng thức lẩu cay hoặc mì ramen yêu thích.</td><td>30-60 phút</td></tr><tr><td>Tạo playlist nhạc yêu thích mới</td><td>5</td><td>Tổng hợp nhạc chill cho mùa thu.</td><td>15-30 phút</td></tr><tr><td>Tham gia buổi hòa nhạc, nhạc sống</td><td>5</td><td>Đi xem ban nhạc yêu thích biểu diễn trực tiếp.</td><td>2-3 giờ</td></tr><tr><td>Làm bánh hoặc nấu ăn cùng bạn bè, người thân</td><td>6</td><td>Làm bánh pizza cùng gia đình vào cuối tuần.</td><td>1-2 giờ</td></tr><tr><td>Tham gia buổi hội thảo hoặc câu lạc bộ</td><td>6</td><td>Tham gia meetup về coding hoặc đọc sách.</td><td>2-4 giờ</td></tr><tr><td>Chơi đùa cùng bạn bè</td><td>6</td><td>Tụ tập đá bóng hoặc chơi board game.</td><td>1-3 giờ</td></tr><tr><td>Nhảy nhót, dancing</td><td>6</td><td>Nhảy trong buổi tiệc hoặc tập nhảy Zumba.</td><td>1-2 giờ</td></tr><tr><td>Thư giãn ở nơi không phải nghĩ ngợi gì</td><td>6</td><td>Ngồi trên bãi biển chỉ nghe sóng vỗ.</td><td>1-3 giờ</td></tr><tr><td>Chạy bộ dưới ánh sáng</td><td>6</td><td>Chạy bộ buổi sáng quanh công viên gần nhà.</td><td>30-60 phút</td></tr><tr><td>Bơi lội: Lặn</td><td>6</td><td>Bơi lội ở hồ bơi hoặc lặn biển.</td><td>1-2 giờ</td></tr><tr><td>Vẽ hoặc sáng tạo nghệ thuật</td><td>6</td><td>Tự vẽ tranh treo tường hoặc nặn đất sét trang trí.</td><td>1-3 giờ</td></tr><tr><td>Học chơi một nhạc cụ mới</td><td>6</td><td>Bắt đầu học guitar hoặc piano.</td><td>2-12 tháng</td></tr><tr><td>Trang trí phòng hoặc làm mới không gian sống</td><td>6</td><td>Sắp xếp lại nội thất phòng khách, trang trí cây xanh.</td><td>2-4 giờ</td></tr><tr><td>Nhận được lời khen từ người lạ</td><td>7</td><td>Được khen gu ăn mặc hoặc cách cư xử khi gặp người lạ.</td><td>Ngay lập tức</td></tr><tr><td>Người ta nhìn thấy mình đẹp, giỏi</td><td>7</td><td>Được khen vì ngoại hình hoặc kết quả công việc tốt.</td><td>Ngay lập tức</td></tr><tr><td>Ba mẹ tự hào</td><td>7</td><td>Được ba mẹ khen ngợi về thành tích trong công việc.</td><td>Tùy thời điểm</td></tr><tr><td>Kiếm tiền</td><td>7</td><td>Nhận hoa hồng hoặc lợi nhuận từ dự án cá nhân.</td><td>Hàng tuần/tháng</td></tr><tr><td>Traffic tăng</td><td>7</td><td>Website hoặc blog cá nhân có nhiều người truy cập hơn.</td><td>Hàng tuần/tháng</td></tr><tr><td>Mua một món hàng giá hời</td><td>7</td><td>Mua đôi giày yêu thích với giá giảm 50%.</td><td>Ngay lập tức</td></tr><tr><td>Tình cảm trai gái</td><td>8</td><td>Nắm tay, ôm, hoặc hẹn hò cùng người yêu.</td><td>1-3 giờ</td></tr><tr><td>Nghe lời yêu thương ("Anh yêu em",...)</td><td>8</td><td>Nhận được lời tỏ tình hoặc lời khen tình cảm.</td><td>Ngay lập tức</td></tr><tr><td>Video games</td><td>8</td><td>Chơi game yêu thích và đạt thành tích tốt.</td><td>1-4 giờ</td></tr><tr><td>Tập gym</td><td>8</td><td>Tập luyện và cảm nhận cơ thể săn chắc hơn.</td><td>30-90 phút</td></tr><tr><td>Hoàn thành việc mình đề ra</td><td>8</td><td>Đạt mục tiêu hoàn thành dự án trong thời hạn.</td><td>Vài ngày – vài tháng</td></tr><tr><td>Đi xem phim với ghệ</td><td>8</td><td>Cùng người yêu xem phim tại rạp vào cuối tuần.</td><td>2-3 giờ</td></tr><tr><td>Giúp người khác</td><td>8</td><td>Giúp đỡ ai đó trong lúc họ cần, như sửa xe hỏng.</td><td>10-60 phút</td></tr><tr><td>Lái xe đường dài hoặc đi phượt</td><td>8</td><td>Chạy xe đến Đà Lạt cùng nhóm bạn.</td><td>4-8 giờ</td></tr><tr><td>Trả nợ xong</td><td>9</td><td>Thanh toán xong khoản vay và không còn nợ.</td><td>Nhiều tháng/năm</td></tr><tr><td>Có một video viral</td><td>9</td><td>Video đăng trên TikTok đạt hàng triệu lượt xem.</td><td>1-2 tuần</td></tr><tr><td>Tiền tăng</td><td>9</td><td>Lợi nhuận đầu tư tăng mạnh trong tháng.</td><td>Hàng tháng/quý</td></tr><tr><td>Hôn</td><td>9</td><td>Hôn môi người yêu trong khoảnh khắc lãng mạn.</td><td>Ngay lập tức</td></tr><tr><td>Có con</td><td>10</td><td>Chào đón đứa con đầu lòng.</td><td>9 tháng +</td></tr><tr><td>bbq ngoai troi</td><td> </td><td> </td><td> </td></tr></tbody></table>

Những hành động đó có thể tạo ra dopamine. Sau đây là những thói quen nhỏ nhưng lại mang hiệu quả cao:

<table id="bkmrk-%C3%9D-t%C6%B0%E1%BB%9Fng-category-th%E1%BB%9D"><thead><tr><th>**Ý tưởng**</th><th>**Category**</th><th>**Thời gian bắt đầu lý tưởng**</th><th>**Thời gian hoàn thành**</th><th>**Tips phối hợp sau khi hoàn thành**</th><th>**Lợi ích sau bao nhiêu ngày**</th></tr></thead><tbody><tr><td>Uống 2 lít nước mỗi ngày</td><td>Sức khỏe</td><td>Sáng và suốt ngày</td><td>Cả ngày</td><td>Đi bộ vài phút sau mỗi lần uống nước</td><td>7-10 ngày: Da mịn hơn, cải thiện tiêu hóa.</td></tr><tr><td>Ngủ đủ 7-8 tiếng</td><td>Sức khỏe</td><td>22:00 - 23:00</td><td>6-7 giờ</td><td>Tập thể dục buổi sáng để khởi đầu năng lượng</td><td>3-5 ngày: Giảm mệt mỏi, tăng tập trung.</td></tr><tr><td>Đứng trước gương và tự khích lệ 3 câu tích cực</td><td>Sự tự tin</td><td>Sáng hoặc tối</td><td>5 phút</td><td>Kết hợp thiền hoặc bài tập hít thở</td><td>7-10 ngày: Tăng niềm tin vào bản thân.</td></tr><tr><td>Đi bộ ít nhất 10.000 bước</td><td>Sức khỏe</td><td>Sáng hoặc chiều</td><td>1-2 tiếng</td><td>Nghe podcast trong lúc đi bộ</td><td>14-21 ngày: Cải thiện tim mạch.</td></tr><tr><td>Tập yoga 10-15 phút</td><td>Sức khỏe</td><td>Sáng hoặc trước khi ngủ</td><td>10-15 phút</td><td>Ngồi thiền sau khi tập yoga</td><td>7-14 ngày: Giảm căng thẳng, tăng linh hoạt.</td></tr><tr><td>Thử làm một việc mới mỗi tuần</td><td>Sự tự tin</td><td>Cuối tuần</td><td>1-2 giờ</td><td>Ghi lại cảm nhận vào nhật ký</td><td>14-21 ngày: Cải thiện sự tự tin.</td></tr><tr><td>Đọc sách tài chính cá nhân 30 phút/ngày</td><td>Tiền tài</td><td>Sáng hoặc trưa</td><td>30 phút</td><td>Áp dụng vào ngân sách cá nhân</td><td>14-21 ngày: Cải thiện hiểu biết tài chính.</td></tr><tr><td>Ghi lại những thành tựu nhỏ mỗi ngày</td><td>Sự tự tin</td><td>Cuối ngày</td><td>10 phút</td><td>Đọc lại hàng tuần để tự khích lệ</td><td>10-14 ngày: Tăng cảm giác tích cực.</td></tr><tr><td>Học cách từ chối những việc không cần thiết</td><td>Sự tự tin</td><td>Cả ngày</td><td>Liên tục</td><td>Luyện tập thiền chánh niệm</td><td>7-10 ngày: Cải thiện sự tự tin và cân bằng.</td></tr><tr><td>Đọc 1 bài báo về chủ đề mới mỗi ngày</td><td>Kiến thức</td><td>Sáng hoặc chiều</td><td>15-20 phút</td><td>Chia sẻ kiến thức với bạn bè</td><td>30 ngày: Tăng vốn hiểu biết.</td></tr><tr><td>Ghi lại 3 điều biết ơn mỗi ngày</td><td>Sự tự tin</td><td>Trước khi đi ngủ</td><td>5-10 phút</td><td>Ngồi thiền vài phút để chốt lại cảm xúc</td><td>10-14 ngày: Cải thiện tâm trạng.</td></tr><tr><td>Tập cardio 30 phút mỗi ngày</td><td>Sức khỏe</td><td>Sáng hoặc chiều</td><td>30 phút</td><td>Uống EAA và giãn cơ sau tập luyện</td><td>7-14 ngày: Cải thiện sức bền.</td></tr><tr><td>Tham gia lớp học online</td><td>Kiến thức</td><td>Cuối tuần</td><td>1-2 giờ</td><td>Thực hành ngay sau khi học</td><td>14-30 ngày: Nâng cao kỹ năng.</td></tr><tr><td>Đầu tư nhỏ (quỹ chỉ số, cổ phiếu)</td><td>Tiền tài</td><td>Cuối tuần</td><td>30 phút - 1 giờ</td><td>Theo dõi thị trường hàng tuần</td><td>6-12 tháng: Tăng tích lũy tài sản.</td></tr><tr><td>Tắt đèn khi không sử dụng</td><td>Tiền tài</td><td>Cả ngày</td><td>Liên tục</td><td>Sử dụng đèn LED</td><td>30 ngày: Giảm hóa đơn tiền điện.</td></tr><tr><td>Viết blog chia sẻ kinh nghiệm</td><td>Danh vọng</td><td>Cuối tuần</td><td>1-2 giờ</td><td>Đăng trên LinkedIn hoặc website cá nhân</td><td>2-3 tháng: Tạo ảnh hưởng chuyên môn.</td></tr><tr><td>Tham gia sự kiện kết nối chuyên môn</td><td>Danh vọng</td><td>Hàng tháng</td><td>1-2 giờ mỗi sự kiện</td><td>Lưu lại danh bạ</td><td>3-6 tháng: Tăng cơ hội nghề nghiệp.</td></tr><tr><td>Viết thiệp hoặc gửi tin nhắn cảm ơn</td><td>Mối quan hệ</td><td>Cuối tuần</td><td>10 phút</td><td>Gọi điện hoặc gặp mặt để thăm hỏi thêm</td><td>7-14 ngày: Cải thiện sự gắn bó.</td></tr><tr><td>Tổ chức bữa ăn cùng bạn bè hoặc gia đình</td><td>Mối quan hệ</td><td>Cuối tuần</td><td>2-3 giờ</td><td>Chuẩn bị món ăn yêu thích</td><td>Ngay lập tức: Tăng kết nối.</td></tr><tr><td>Chơi với thú cưng</td><td>Mối quan hệ</td><td>Chiều hoặc tối</td><td>20-30 phút</td><td>Chụp ảnh hoặc quay video làm kỷ niệm</td><td>Ngay lập tức: Giảm căng thẳng.</td></tr><tr><td>Lập kế hoạch cho chuyến đi cuối tuần</td><td>Sự tự tin và Mối quan hệ</td><td>Giữa tuần</td><td>30 phút - 1 giờ</td><td>Tham khảo bạn bè</td><td>1-2 ngày: Cải thiện tinh thần.</td></tr><tr><td>Ghi chép chi tiêu hàng ngày</td><td>Tiền tài</td><td>Cuối ngày</td><td>10 phút</td><td>Kiểm tra ngân sách hàng tuần</td><td>7-14 ngày: Giảm lãng phí.</td></tr><tr><td>Tham gia nhóm học tập hoặc cộng đồng</td><td>Kiến thức và Mối quan hệ</td><td>Cuối tuần</td><td>1-2 giờ</td><td>Ghi chú sau mỗi buổi học</td><td>14-30 ngày: Tăng kỹ năng và kết nối.</td></tr></tbody></table>

# Routing / Open Port WSL2 and Host Machine.

Cách routing port từ WSL2 sang local machine và public network.

Mở window POWER SHELL của windows với ADMINISTRATOR

```bash
netsh interface portproxy add v4tov4 listenport=3000 listenaddress=0.0.0.0 connectport=3000 connectaddress=172.27.237.24
```

Giải thích:

IP: thay đổi ip address 172.27.237.24 thành ip address của wsl2 ubuntu server

PORT: 3000 là port open từ wsl2 qua local machine

muốn biết WSL2 Address thì cứ vào networking adapters xem phần VEthernet(WSL)

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

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

Xem thêm video hướng dẫn nếu cần: [https://youtu.be/yCK3easuYm4?si=eB-6vNyp6H18daGJ](https://youtu.be/yCK3easuYm4?si=eB-6vNyp6H18daGJ)

Để xem port nào đã routing forward thì check:

```
netsh interface portproxy show all
```

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

Để delete:

```
netsh interface portproxy delete v4tov4 listenport=9001 listenaddress=0.0.0.0
netsh interface portproxy delete v4tov4 listenport=9000 listenaddress=0.0.0.0
netsh interface portproxy delete v4tov4 listenport=3000 listenaddress=0.0.0.0
```

# 413 request entity too large

cloudflare issues

don't use cloudflare if you want to upload files &gt; 100 mb.

# Unable to access raw githubcontent

some program you did install changed the etc/hosts on windows and wsl2 , which point the 0.0.0.0 to raw.githubusercontent.com. you need to remove those line in order to access.

# VSCode SFTP Config

cài sftp và tạo file:

sftp.json

```
{
    "name": "portainer",
    "host": "portainer.AAA.com",
    "protocol": "sftp",
    "port": 22,
    "username": "KingOfTheNorth",
    "privateKeyPath": "/home/King/.ssh/id_rsa",
    "password": "theKingOfTheNorth",
    "remotePath": "/home/King/docker/homepage",
    "context": "/home/aaa/homepage/config",
    "uploadOnSave": true
}
```

Context: là local folder path

# Common Problems with Ubuntu WSL2 Sudo Apt Get

Problem:

```bash
W: https://cloud.r-project.org/bin/linux/ubuntu/xenial-cran35/InRelease: Key is stored in legacy trusted.gpg keyring (/etc/apt/trusted.gpg), see the DEPRECATION section in apt-key(8) for details.
W: An error occurred during the signature verification. The repository is not updated and the previous index files will be used. GPG error: https://prod-cdn.packages.k8s.io/repositories/isv:/kubernetes:/core:/stable:/v1.30/deb  InRelease: The following signatures were invalid: EXPKEYSIG 234654DA9A296436 isv:kubernetes OBS Project <isv:kubernetes@build.opensuse.org>
W: Failed to fetch https://pkgs.k8s.io/core:/stable:/v1.30/deb/InRelease  The following signatures were invalid: EXPKEYSIG 234654DA9A296436 isv:kubernetes OBS Project <isv:kubernetes@build.opensuse.org>

W: https://cloud.r-project.org/bin/linux/ubuntu/xenial-cran35/InRelease: Key is stored in legacy trusted.gpg keyring (/etc/apt/trusted.gpg), see the DEPRECATION section in apt-key(8) for details.
E: The repository 'http://apt.kubernetes.io kubernetes-xenial Release' does not have a Release file.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.
W: An error occurred during the signature verification. The repository is not updated and the previous index files will be used. GPG error: https://prod-cdn.packages.k8s.io/repositories/isv:/kubernetes:/core:/stable:/v1.30/deb  InRelease: The following signatures were invalid: EXPKEYSIG 234654DA9A296436 isv:kubernetes OBS Project <isv:kubernetes@build.opensuse.org>

Err:10 https://packages.cloud.google.com/apt kubernetes-xenial Release
  404  Not Found [IP: 172.217.194.101 443]
```

Solution:

```bash
sudo apt-get install -y apt-transport-https ca-certificates curl gpg
curl -fsSL https://pkgs.k8s.io/core:/stable:/v1.32/deb/Release.key | sudo gpg --dearmor -o /etc/apt/keyrings/kubernetes-apt-keyring.gpg
echo 'deb [signed-by=/etc/apt/keyrings/kubernetes-apt-keyring.gpg] https://pkgs.k8s.io/core:/stable:/v1.32/deb/ /' | sudo tee /etc/apt/sources.list.d/kubernetes.list deb [signed-by=/etc/apt/keyrings/kubernetes-apt-keyring.gpg] https://pkgs.k8s.io/core:/stable:/v1.32/deb/ /
cd /etc/apt
sudo cp trusted.gpg trusted.gpg.d
sudo apt-get update
```

# Cài đặt Synology trên Proxmox với Arc Loader

Xem video hướng dẫn của TB Playground: [https://www.youtube.com/watch?v=nRERez1Y9zs](https://www.youtube.com/watch?v=nRERez1Y9zs)

Xài Shell trên máy chủ Proxmox muốn cài đặt. ví dụ: Proxmox Admin Web &gt; Rack2 &gt; Shell &gt;

[https://github.com/AuxXxilium/arc/releases?q=prerelease%3Afalse&amp;expanded=true](https://github.com/AuxXxilium/arc/releases?q=prerelease%3Afalse&expanded=true)

Download arc image về máy rack2 &gt;

wget [https://github.com/AuxXxilium/arc/releases/download/1.5.2/arc-1.5.2-evo.img.zip](https://github.com/AuxXxilium/arc/releases/download/1.5.2/arc-1.5.2-evo.img.zip)

Cài đặt unzip nếu chưa có:

apt-get install unzip

Unzip image file:

unzip arc-\*.zip

Tạo VM với thông số sau

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

OS: Do not use any media  
DISK: Đổi Bus Device thành SATA, Đổi Size thành 50 GB  
CORE: 2 min ( để càng nhiều thì cài càng lẹ )  
MEMORY: 4GB min ( để càng nhiều cài càng lẹ )  
NETWORK: Model đổi thành Intel E1000  
  
Đã tạo xong VM ID: 136

Okay, tiếp tục với phần Proxmox Shell, sau khi unzip xong thì ta sẽ có arc.img. Ta import disk với lệnh sau:

qm importdisk 136 arc.img local-lvm

Lưu ý: 136 chính là VM ID mà bạn đã tạo trước đó.

Rồi vào web Proxmox, để tạo ổ cứng trên VM, mở con VM 136 trên Proxmox Web UI &gt; Hardware &gt; Unused Disk &gt; Bus Device chọn Sata &gt; Add

Vào Web UI &gt; VM 136 &gt; Options &gt; Chọn Boot Order &gt; Enable sata1 , Kéo sata 1 lên đầu

# Cách cài đặt Synology trên máy ảo vm proxmox với ARL Loader

Cấu hình:

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

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

Network sau khi cài:

Test với với network của node proxmox host của synology tới synology:

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

Test với network của VM trong cùng host với synology:

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

Test network từ một VM của Node Proxmox khác tới Synology

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

Cấu hình VM:

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

Cách cài đặt:

Search google "arpl release" :

[https://github.com/fbelavenuto/arpl/releases](https://github.com/fbelavenuto/arpl/releases)

kéo xuống và note lại link download : <span class="Truncate-text text-bold" data-view-component="true">arpl-\*\*\*\*\*\*\*\*.img.zip</span>

<span class="Truncate-text text-bold" data-view-component="true">ví dụ: [https://github.com/fbelavenuto/arpl/releases/download/v1.1-beta2a/arpl-1.1-beta2a.img.zip](https://github.com/fbelavenuto/arpl/releases/download/v1.1-beta2a/arpl-1.1-beta2a.img.zip)</span>

<span class="Truncate-text text-bold" data-view-component="true">link này là link image để tạo boot như usb vậy. tí nữa sau khi cài cấu hình vm thì insert boot disk vào vm. </span>

<span class="Truncate-text text-bold" data-view-component="true">vào proxmox và tạo 1 vm với cấu hình sau:</span>

```
OS: Do not use any media
DISK: Bus/Device SATA , 50 GiB min
CPU: Cores 8
MEMORY: 8192 MiB
NETWORK: Model: Intel E1000
```

<span class="Truncate-text text-bold" data-view-component="true">Confirm để tạo VM</span>

<span class="Truncate-text text-bold" data-view-component="true">Tiếp tục, SSH vào Node Proxmox ( Host )</span>

<span class="Truncate-text text-bold" data-view-component="true">Đánh từng lệnh sau để download booter arpl về host:</span>

```
wget https://github.com/fbelavenuto/arpl/releases/download/v1.1-beta2a/arpl-1.1-beta2a.img.zip
```

<span class="Truncate-text text-bold" data-view-component="true">Link này là link download ở trong [https://github.com/fbelavenuto/arpl/releases](https://github.com/fbelavenuto/arpl/releases)</span>

<span class="Truncate-text text-bold" data-view-component="true">Sau khi download xong thì Unzip nó ra với lệnh sau:</span>

```
unzip arpl-1.1-beta2a.img.zip
```

<span class="Truncate-text text-bold" data-view-component="true">Kế tiếp, qua proxmox web ui xem VM ID vừa tạo, ở đây tôi tạo VM với ID là 138 thì ghi lệnh sau:</span>

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

```
qm importdisk 138 arpl.img
```

<span class="Truncate-text text-bold" data-view-component="true">Tiếp tục vào Web UI của Proxmox để config VM 138 đó:</span>

<span class="Truncate-text text-bold" data-view-component="true">Chọn Hardware &gt; Bên dưới có Unused Disk thì double click vào, kiểm tra coi có phải đang xài SATA không, nếu mặc định là SATA thì cứ nhấn ADD/OK vào.</span>

<span class="Truncate-text text-bold" data-view-component="true">Chọn Options &gt; Boot Order &gt; Kéo sata1 dưới cùng lên đầu &gt; check vào checkbox để enable &gt; OK</span>

<span class="Truncate-text text-bold" data-view-component="true">Ok, Done. Xong bước này thì nên clone 1 bản VM ra và convert qua Template để khi nào cần cài thì cứ Clone template đó ra mà cài tiếp.</span>

<span class="Truncate-text text-bold" data-view-component="true">Start VM rồi vào Console để xem IP Address Boot Loader tạo:</span>

<span class="Truncate-text text-bold" data-view-component="true">Ví dụ: [http://192.168.1.xxx:7681/](http://192.168.1.xxx:7681/)</span>

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

<span class="Truncate-text text-bold" data-view-component="true">Vào website đó trên trình duyệt:</span>

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

```
choose model > OK > DS3622xs+    Broadwellnk > OK
choose a Build Number > 42962 > OK
choose a serial number > Generate a random serial number > OK
build the loader > OK
```

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

<span class="Truncate-text text-bold" data-view-component="true">Đợi xíu cho nó build xong rồi quay trở lại ...</span>

<span class="Truncate-text text-bold" data-view-component="true">Đợi boot loader load xong rồi quay lại nhấn tiếp </span>

<span class="Truncate-text text-bold" data-view-component="true">[![image.png](https://wiki.kyluat.com/uploads/images/gallery/2025-01/scaled-1680-/lrFimage.png)](https://wiki.kyluat.com/uploads/images/gallery/2025-01/lrFimage.png)  
  
Boot the loader &gt; OK</span>

Xong rồi đó, mở 1 tab khác, copy cái link của boot loader menu qua rổi đổi port thành 5000:

[http://192.168.1.247:7681/](http://192.168.1.247:7681/) -&gt; [http://192.168.1.247:5000/](http://192.168.1.247:5000/)

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

vào trang này để download file pat về: [https://www.synology.com/en-global/support/download/DS3622xs+?version=7.1#system](https://www.synology.com/en-global/support/download/DS3622xs+?version=7.1#system)

chú ý là DSM 7.1.1 và DS3622xs+

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

[https://global.synologydownload.com/download/DSM/release/7.1.1/42962-1/DSM\_DS3622xs%2B\_42962.pat?model=DS3622xs%2B&amp;bays=12&amp;dsm\_version=7.1.1&amp;build\_number=42962](https://global.synologydownload.com/download/DSM/release/7.1.1/42962-1/DSM_DS3622xs%2B_42962.pat?model=DS3622xs%2B&bays=12&dsm_version=7.1.1&build_number=42962)

Filename sẽ giống thế này: DSM\_DS3622xs+\_42962.pat

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

Click next

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

Check vào I Understand ... và Click vào Continue

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

Đi pha cà phê và đợi cho cài đặt xong thôi ...

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

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

Device name này để hiển thị xung quanh network. ví dụ nếu đặt synology thì access //synology trên window explorer nó sẽ ra trang website synology.

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

Kế tiếp nhấn Skip...

Kế tiếp cứ nhấn submit , khỏi agree .

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

Done nhé

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

Nếu sử dụng mạng lan 10GiB thì shutdown VM rồi chỉnh lại phần network trong hardware tab:

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

Model: VirtIO  
MTU: 9000  
OK

start lại VM

...

Còn muốn cài đặt perf3 để test thì search google **how to install iperf3 on synology**

# [Solved] Nginx Proxy Manager Problems with Cannot Load Certificate

Problem 1:

```
nginx: [emerg] cannot load certificate "/etc/letsencrypt/live/npm-32/fullchain.pem": BIO_new_file() failed
```

which mean nginx can't find the file existed. Maybe you have delete it on your web ui. This is a problem of nginx proxy manager :)

All you have to do is copy similar npm-xx folder into npm-yy ( yy now is 32 )

```
sudo su
cd /home/user_name/docker/nginx_proxy_manager/letsencrypt
```

Let's navigate to where you have your letsencrypt folder by using those command above.

Now go to your check your app docker logs:

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

Filter the logs with letsencrypt and you will see in realtime which npm-yy is missing.

Use the command below to copy from existing npm-xx to npm-yy:

```
cp -r npm-3 npm-16
```

After you've made all the npm-yy available, you can visit back to your nginx proxy manager web ui. =\]\]

# How to use Custom Nginx Configuration in Nginx Proxy Manager - Advanced Edit Proxy Host?

You can pass the ip address so your application can see visitor's ip address:

```nginx
location / {
    proxy_pass $forward_scheme://$server:$port;

    # Forward the real IP address of the client
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;

    # Forward other useful headers
    proxy_set_header Host $host;
    proxy_set_header X-Forwarded-Proto $scheme;
}

```

# Install Pihole Node Exporter with this shell script

Change Pihole IP address and Password , then run.

nano install-node-exporter.sh

Copy and paste into the content, CTRL+X , Enter

```
#!/bin/bash

# Define variables
PIHOLE_IP="10.0.0.4"  # Replace with your Pi-hole IP
PIHOLE_PASSWORD="xyz"  # Replace with your Pi-hole password
SERVICE_FILE="/lib/systemd/system/pihole_exporter.service"

# Download the latest version of pihole-exporter
wget -c https://github.com/eko/pihole-exporter/releases/latest/download/pihole_exporter-linux-amd64

# Create a directory for pihole-exporter
sudo mkdir -p /opt/pihole_exporter

# Add a user account to run the service
sudo useradd -r pihole_exporter

# Move the file to the new directory
sudo mv pihole_exporter-linux-amd64 /opt/pihole_exporter/

# Change the group permissions to the new pihole user
sudo chgrp pihole_exporter /opt/pihole_exporter
sudo chgrp pihole_exporter /opt/pihole_exporter/pihole_exporter-linux-amd64

# Make the binary executable
sudo chmod +x /opt/pihole_exporter/pihole_exporter-linux-amd64

# Create a service file for pihole-exporter
sudo bash -c "cat > $SERVICE_FILE <<EOF
[Unit]
Description=pihole_exporter

[Service]
ExecStart=/opt/pihole_exporter/pihole_exporter-linux-amd64 -pihole_hostname $PIHOLE_IP -pihole_password $PIHOLE_PASSWORD
WorkingDirectory=/opt/pihole_exporter
Restart=always
User=pihole_exporter

[Install]
WantedBy=multi-user.target
EOF"

# Reload the system daemon
sudo systemctl daemon-reload

# Start the service
sudo service pihole_exporter start

# Enable the service to run at startup
sudo systemctl enable pihole_exporter

# Restart
sudo shutdown -r now

```

# Mounting NFS

Cách kết nối một folder từ máy có nfs server tới máy linux hiện.

**Dữ liệu của máy trên server nfs sẽ được ưu tiên mount vào. Có nghĩa là bạn mount vào folder mà có files thì coi chừng mất sạch mấy files đó.**

#### Cài NFS common cho Client

```bash
sudo apt update

sudo apt install nfs-common
```

```bash
df -h

cd /mnt

sudo mkdir anything

sudo mount 192.168.1.111:/other/2025/things/ /mnt/anything/

sudo chmod 777 /mnt/anything/

sudo nano /etc/fstab
```

Thêm vào

192.168.1.111:/other/2025/things/ /mnt/anything nfs defaults 0 0

```bash
df -h

umount 192.168.1.111:/other/2025/things/
```

**Advanced hơn xíu:** Vì một số lý do nào đó mà nfs client bị disconnect với nfs server, chúng ta có thể chỉnh auto reconnect với nfs client :

```bash
sudo nano /etc/fstab
192.168.1.111:/other/2025/things/ /mnt/anything nfs defaults,_netdev,noresvport,x-systemd.automount,x-systemd.requires=network-online.target,retry=forever,timeo=14,retrans=3 0 0
```

**Các tùy chọn config đã dùng:**

- **`defaults`**: Chọn các tùy chọn mặc định của NFS, gồm `rw,suid,dev,exec,auto,nouser,async`.
- **`_netdev`**: Đảm bảo rằng NFS chỉ được mount sau khi mạng đã sẵn sàng.
- **`noresvport`**: Dùng cổng động thay vì cổng được dành riêng, giúp kết nối ổn định hơn khi NAS khởi động lại.
- **`x-systemd.automount`**: Kích hoạt tự động mount khi có truy cập vào thư mục, giảm thời gian boot.
- **`x-systemd.requires=network-online.target`**: Đảm bảo mạng phải online trước khi mount NFS.
- **`retry=forever`**: Nếu mount thất bại, hệ thống sẽ thử lại liên tục cho đến khi thành công.
- **`timeo=14`**: Thiết lập timeout là 14 \* 0.1 giây = **1.4 giây** trước khi gửi lại yêu cầu.
- **`retrans=3`**: Nếu mất gói tin, hệ thống sẽ thử lại tối đa 3 lần trước khi báo lỗi.
- **`0 0`**: Không cần backup, không chạy `fsck` vì NFS không cần kiểm tra lỗi trên hệ thống file.

#### <span class="hljs-attribute">Cài NFS cho server</span>

```bash
sudo apt update

sudo apt install nfs-kernel-server

sudo chown nobody:nogroup /mnt/my-nfs-folder/

sudo chmod 777 /mnt/my-nfs-folder/

sudo nano /etc/exports

# insert
/mnt/my-nfs-folder/ 192.168.0.0/24(rw,sync,no_subtree_check)



sudo exportfs -a

sudo systemctl restart nfs-kernel-server

```

# Glances can't start --export prometheus with the -w

Your current Glances systemd service is trying to start both the **Web UI** (`-w`) and the **Prometheus exporter** (`--export prometheus`) at the same time, but Glances doesn’t natively support running both in a single process.

### **Solution: Run Two Separate Instances of Glances**

You'll need to create **two systemd service files**, one for the Web UI and another for the Prometheus Exporter.

#### Create a Service for Glances Web UI  


Run

```bash
sudo nano /etc/systemd/system/glances.service
```

Paste

```bash
[Unit]
Description=Glances Web UI
After=network.target

[Service]
Type=simple
ExecStart=/usr/local/bin/glances -w
Restart=on-failure

[Install]
WantedBy=multi-user.target

```

Save and exit.

#### Create a Service for Glances Prometheus Exporter

run

```bash
sudo nano /etc/systemd/system/glances-prometheus.service
```

paste

```bash
[Unit]
Description=Glances Prometheus Exporter
After=network.target

[Service]
Type=simple
ExecStart=/usr/local/bin/glances --export prometheus
Restart=on-failure

[Install]
WantedBy=multi-user.target
```

Save and exit.

#### Reload Systemd and Start Services

```bash
sudo systemctl daemon-reload
sudo systemctl enable glances-prometheus
sudo systemctl start glances-prometheus

```

Verify That Both Are Running

```shell
systemctl status glances-web glances-prometheus
```

Now, you can access:

<div class="flex max-w-full flex-col flex-grow" id="bkmrk-web-ui-at-http%3A%2F%2F%3Cyo"><div class="min-h-8 text-message flex w-full flex-col items-end gap-2 whitespace-normal break-words text-start [.text-message+&]:mt-5" data-message-author-role="assistant" data-message-id="4f9e9441-1280-4f9a-9798-821fd53c34b9" data-message-model-slug="gpt-4o" dir="auto"><div class="flex w-full flex-col gap-1 empty:hidden first:pt-[3px]"><div class="markdown prose w-full break-words dark:prose-invert dark">- **Web UI** at `http://<your-ip>:61208`
- **Prometheus metrics** at `http://<your-ip>:9091/metrics`

</div></div></div></div>This should work smoothly.

Useful commands:

Show log path and version

```
glances -V
```

<div class="mb-2 flex gap-3 empty:hidden -ml-2" id="bkmrk-"><div class="items-center justify-start rounded-xl p-1 flex"><div class="flex items-center"><button aria-label="Read aloud" class="rounded-lg text-token-text-secondary hover:bg-token-main-surface-secondary" data-testid="voice-play-turn-action-button"><svg class="icon-md-heavy" fill="none" height="24" viewbox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg"></svg></button><button aria-label="Edit in canvas" class="rounded-lg text-token-text-secondary hover:bg-token-main-surface-secondary"><svg class="icon-md-heavy" fill="none" height="24" viewbox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg"></svg></button><div class="flex items-center pb-0"><svg class="icon-md" fill="none" height="24" viewbox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg"></svg>  
</div><button aria-expanded="false" aria-haspopup="menu" class="cursor-pointer h-[30px] rounded-md px-1 text-token-text-secondary hover:bg-token-main-surface-secondary" data-state="closed" id="bkmrk--1" type="button"></button></div></div></div>

# NextCloud Problem Solutions: No Video Thumbnail

<header class="entry-header" id="bkmrk-nextcloud%3A-install-p">### Nextcloud: Install Preview Generator

</header>This installation guide is tested with Nextcloud up to version 16.x and Preview Generator App up to version 2.x.

#### Tested and working file formats

avi, doc, bmp, gif, jpg, md, mkv, mp3, mp4, odp, ods, odt, pdf, png, psd, svg, tif, ttf, txt, xls.

#### Update your system

```
apt upgrade && apt -y update
```

#### Install the Preview Generator App

of the Nextcloud app store: [apps.nextcloud.com/apps/previewgenerator](https://apps.nextcloud.com/apps/previewgenerator)

#### Install LibreOffice

```
apt install libreoffice libreoffice-l10n-de libreoffice-help-de
```

#### Install ffmpeg, ImageMagick and Ghostscript

```
apt install ffmpeg imagemagick ghostscript
```

#### Add preview providers

Append to `/var/www/nextcloud/config/config.php`

```
'preview_libreoffice_path' => '/usr/bin/libreoffice',
'enable_previews' => true,
'enabledPreviewProviders' =>
 array (
    0 => 'OC\\Preview\\TXT',
    1 => 'OC\\Preview\\MarkDown',
    2 => 'OC\\Preview\\OpenDocument',
    3 => 'OC\\Preview\\PDF',
    4 => 'OC\\Preview\\MSOffice2003',
    5 => 'OC\\Preview\\MSOfficeDoc',
    6 => 'OC\\Preview\\Image',
    7 => 'OC\\Preview\\Photoshop',
    8 => 'OC\\Preview\\TIFF',
    9 => 'OC\\Preview\\SVG',
   10 => 'OC\\Preview\\Font',
   11 => 'OC\\Preview\\MP3',
   12 => 'OC\\Preview\\Movie',
   13 => 'OC\\Preview\\MKV',
   14 => 'OC\\Preview\\MP4',
   15 => 'OC\\Preview\\AVI',
 ),
```

#### Create .cache folder

on ISPConfig servers in the [home directory of virtual host](https://www.allerstorfer.at/ispconfig-add-additional-folder-in-home-directory-of-a-virtual-host/) to prevent

```
unable to create directory '/var/www/clients/client1/web1/.cache/dconf': Operation not permitted. dconf will not work properly
```

Only necessary for for office documents like .ods and .odt.

#### Fix PolicyMap for ImageMagick

to prevent [ImagickException: not authorized](https://www.allerstorfer.at/imagemagick-fix-policymap/) error. Necessarry for PDF files.

#### First Run

```
sudo -u www-run php /var/www/nextcloud/occ preview:generate-all -vvv
```

#### Add Cronjob

```
crontab -u www-run -e
```

```
*/10 * * * * php /var/www/nextcloud/occ preview:pre-generate -vvv
```

#### My Config file:

just for debug

```php
<?php
$CONFIG = array (
  'htaccess.RewriteBase' => '/',
  'memcache.local' => '\\OC\\Memcache\\APCu',
  'apps_paths' => 
  array (
    0 => 
    array (
      'path' => '/var/www/html/apps',
      'url' => '/apps',
      'writable' => false,
    ),
    1 => 
    array (
      'path' => '/var/www/html/custom_apps',
      'url' => '/custom_apps',
      'writable' => true,
    ),
  ),
  'memcache.distributed' => '\\OC\\Memcache\\Redis',
  'memcache.locking' => '\\OC\\Memcache\\Redis',
  'redis' => 
  array (
    'host' => 'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA',
    'password' => '',
    'port' => 6379,
  ),
  'upgrade.disable-web' => true,
  'instanceid' => 'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA',
  'passwordsalt' => 'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA',
  'secret' => 'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA',
  'trusted_domains' => 
  array (
    0 => 'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA',
    1 => 'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA',
  ),
  'overwriteprotocol' => 'https',
  'overwritehost' => 'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA',
  'trustedproxies' => 
  array (
    0 => 'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA',
    1 => 'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA',
  ),
  'datadirectory' => '/var/www/html/data',
  'dbtype' => 'mysql',
  'version' => '30.0.6.2',
  'overwrite.cli.url' => 'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA',
  'dbname' => 'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA',
  'dbhost' => 'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'mysql.utf8mb4' => true,
  'dbuser' => 'oc_son',
  'dbpassword' => 'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA',
  'installed' => true,
  'maintenance_window_start' => 8,
  'mail_from_address' => 'son',
  'mail_smtpmode' => 'smtp',
  'mail_sendmailmode' => 'smtp',
  'mail_domain' => 'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA',
  'mail_smtphost' => 'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA',
  'mail_smtpport' => '8025',
  'default_phone_region' => 'VN',
  'maintenance' => false,
  'enable_previews' => true,
  'preview_libreoffice_path' => '/usr/bin/libreoffice',
  'enabledPreviewProviders' => 
    array (
      0 => 'OC\\Preview\\TXT',
      1 => 'OC\\Preview\\MarkDown',
      2 => 'OC\\Preview\\OpenDocument',
      3 => 'OC\\Preview\\PDF',
      4 => 'OC\\Preview\\MSOffice2003',
      5 => 'OC\\Preview\\MSOfficeDoc',
      6 => 'OC\\Preview\\Image',
      7 => 'OC\\Preview\\Photoshop',
      8 => 'OC\\Preview\\TIFF',
      9 => 'OC\\Preview\\SVG',
    10 => 'OC\\Preview\\Font',
    11 => 'OC\\Preview\\MP3',
    12 => 'OC\\Preview\\Movie',
    13 => 'OC\\Preview\\MKV',
    14 => 'OC\\Preview\\MP4',
    15 => 'OC\\Preview\\AVI',
    ),
);

```

#### Tips #1:

when using docker you need to login as root or www-data in order to fix the issues with nextcloud:

www-data

root

#### Tips #2:

php occ \[COMMAND\]

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

#### Docker Compose config stack for portainer:

```yaml
services:
  nextcloud:
    image: nextcloud:stable
    container_name: nextcloud-stable
    restart: always
    environment:
      MYSQL_PASSWORD: XXXXXXXXXXXXXXXXXXXXXXXXXX
      MYSQL_DATABASE: BBBBBBBBBBBBBBBBBBBBBBBBBB
      MYSQL_USER: AAAAAAAAAAAAAAAAAAAAAAAAAAAA
      MYSQL_HOST: CCCCCCCCCCCCCCCCCCCCCCCCCC
      REDIS_HOST: DDDDDDDDDDDDDDDDDDDDDDDDDD
      PUID: 1000
      PGID: 1000
      TZ: Asia/Ho_Chi_Minh

      
    ports:
      - 8180:80
      - 8443:443
    volumes:
      - /mnt/portainer/nextcloud/html:/var/www/html
      - /mnt/portainer/nextcloud/config://var/www/html/config
      - /mnt/portainer/nextcloud/custom_apps://var/www/html/custom_apps
      - /mnt/portainer/nextcloud/data:/var/www/html/data
      - /mnt/portainer/nextcloud/logs:/var/log/apache2
    networks:
      - nginxproxymanager_default
      
networks:
  nginxproxymanager_default:
    external: true
```

i mounted to my nfs volume which link to my synology data storage through nfs

### Some path to take alook:

/etc/apache2/  
/var/log/apache2/

looks for logs and ask chatgpt to install required apps for apache and os. eg:

```bash
apt update && apt install -y iproute2
apt update && apt install -y fuse
```

<div class="post-content" id="bkmrk-imagemagick%3A-fix-pol"><header class="entry-header">### ImageMagick: Fix PolicyMap

</header></div>How to fix the error message „ImagickException: not authorized“:

```
ImagickException: not authorized `/tmp/magick-............' @ error/constitute.c/ReadImage/412
```

```
vi /etc/ImageMagick-6/policy.xml
```

Change `rights="none"` to `rights="read|write"` for PS, EPI, PDF and XPS

```
  <policy domain="coder" rights="read|write" pattern="PS" />
  <policy domain="coder" rights="read|write" pattern="EPI" />
  <policy domain="coder" rights="read|write" pattern="PDF" />
  <policy domain="coder" rights="read|write" pattern="XPS" />
```

##### Restart services

```
service apache2 restart && service php7.2-fpm restart
```

### Nextcloud: Install Crontab

apt update &amp;&amp; apt install -y cron  
crontab -e  
crontab -u www-data -e

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

<header class="entry-header" id="bkmrk-add-additional-folde">### Add additional folder in home directory of a virtual host

</header>ISPConfig sets the immutable bit of a vHost’s home directory, which prevents adding/deleting files or folders there. To add a custom folder, the immutable bit must first be reset, which can only be done as the *root* user.

In this example, we want to create the additional folder <tt>.cache</tt> within the home directory.

```
chattr -i /var/www/clients/client1/web1
mkdir /var/www/clients/client1/web1/.cache
chown web1:client1 /var/www/clients/client1/web1/.cache
chattr +i /var/www/clients/client1/web1
```

If PHP needs to write to the new folder, add the path to PHP <tt>open\_basedir</tt> as well.


#### See also

[https://www.allerstorfer.at/nextcloud-install-preview-generator/](https://www.allerstorfer.at/nextcloud-install-preview-generator/)

# Power Outage Problems and Solutions: UPS NUT SERVER SETUP & WEBNUT UI with Docker

We have 1 ups so far.

root@rack2:~# lsusb

```bash
lsusb
```

  
Bus 002 Device 002: ID 8087:8002 Intel Corp. 8 channel internal hub  
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub  
Bus 001 Device 004: ID 413c:a001 Dell Computer Corp. Hub  
Bus 001 Device 005: ID 051d:0003 American Power Conversion UPS  
Bus 001 Device 002: ID 8087:800a Intel Corp. Hub  
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

root@rack2:~# sudo apt install nut nut-client nut-server

```bash
sudo apt install nut nut-client nut-server
```

root@rack2:~# sudo nut-scanner -U

```bash
sudo nut-scanner -U
```

  
Scanning USB bus.  
\[nutdev1\]  
 driver = "usbhid-ups"  
 port = "auto"  
 vendorid = "051D"  
 productid = "0003"  
 product = "Smart-UPS SRT FW:UPS 05.3 / ID=1010"  
 serial = "AS1841190039"  
 vendor = "American Power Conversion"  
 bus = "001"

root@rack2:~# sudo cp /etc/nut/ups.conf /etc/nut/ups.example.conf

```bash
sudo cp /etc/nut/ups.conf /etc/nut/ups.example.conf
```

  
root@rack2:~# sudo nano /etc/nut/ups.conf

```bash
sudo nano /etc/nut/ups.conf
```

```bash
pollinterval = 1
maxretry = 3

[apc-ups]
    driver = usbhid-ups
    port = auto
    desc = "APC Smart-UPS"
    vendorid = 051D
    productid = 0003
    serial = AS1841110039
```

```bash
sudo nano /etc/nut/upsmon.conf
```

```bash
RUN_AS_USER root
MONITOR apc-ups@localhost 1 admin secret master
```

```bash
sudo nano /etc/nut/upsd.conf
```

```bash
LISTEN 0.0.0.0 3493 
```

```bash
sudo nano /etc/nut/nut.conf
```

```bash
MODE=netserver
```

```bash
sudo nano /etc/nut/upsd.users
```

```bash
[monuser]
  password = secret
  admin master
```

root@rack2:~# sudo service nut-server restart  
root@rack2:~# sudo service nut-client restart  
root@rack2:~# sudo systemctl restart nut-monitor  
root@rack2:~# sudo upsdrvctl stop  
root@rack2:~# sudo upsdrvctl start

```bash
sudo service nut-server restart
sudo service nut-client restart
sudo systemctl restart nut-monitor
sudo upsdrvctl stop
sudo upsdrvctl start
```

root@rack2:~# upsc [apc-ups@localhost](mailto:apc-ups@localhost)

```
 upsc apc-ups@localhost 
```

```bash
upsc apc-ups@localhost battery.charge
```

Now proceed to install client web ui on other machine:

here is the docker compose file:

```yaml
services:
  nut:
    image: edgd1er/webnut
    container_name: webnut
    environment:
      - UPS_HOST=your-host.local.lan
      - UPS_PORT=3493
      - UPS_USER=admin
      - UPS_PASSWORD=secret
    restart: unless-stopped
    security_opt:
      - no-new-privileges:true
    networks:
      - nginxproxymanager_default
    ports:
      - 6543:6543
networks:
  nginxproxymanager_default:
    external: true
```

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

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

Next step is your programming still with nut client api that you are familiar with like nodejs:

# Copy MultiThread trên windows

```bash
robocopy "\\wsl.localhost\Ubuntu-22.04\home\son" "D:\WSL-BACKUP-3-7-2025" /E /MT:128 /R:0 /W:0 /XD .cache node_modules .vscode-remote-containers .vscode-server .yarn /TEE /NP /ZB /NFL /NDL

```

128 threads

ignore các folder: .cache node\_modules .vscode-remote-containers .vscode-server .yarn

# Download Streaming Buffer Video với yt-dlp

Open PowerShell

```bash
winget install --id yt-dlp.yt-dlp
```

Download aria2 để có speed x 2 download:

```bash
winget install --id=aria2.aria2  -e
```

##### Best Option:

sau khi cài **yt dlp, ffmpeg và aria2c** thì sử dụng command format sau:

```
yt-dlp --external-downloader aria2c --external-downloader-args "-x 16 -s 16 -k 1M" "VIDEO_URL"
```

ví dụ thực tế, download với highspeed 16 concurrent threads

```bash
yt-dlp --external-downloader aria2c --external-downloader-args "-x 16 -s 16 -k 1M" "https://southeastasia1-mediap.svc.ms/transform/videomanifest?provider=spo&inputFormat=mp4&cs=fFNQTw&correlationId=7a4a8aa1-e0bc-4000-d0f3-6e134e669b49&docid=https%3A%2F%2Fcaskvietnam-my.sharepoint.com%2Fpersonal%2Fstorageadmin_cask_vn%2F_api%2Fv2.0%2Fdrives%2Fb%21MvyyCCTQ4Eutu3r8U9lOLzEJitllXbdGqZ2NatFHNgke3qPStJtIQ6fu_FviFeA1%2Fitems%2F016FAKD5LOEGBE7TBK35AKQ4AT2XBEMWA6%3Ftempauth%3Dv1.eyJzaXRlaWQiOiIwOGIyZmMzMi1kMDI0LTRiZTAtYWRiYi03YWZjNTNkOTRlMmYiLCJhdWQiOiIwMDAwMDAwMy0wMDAwLTBmZjEtY2UwMC0wMDAwMDAwMDAwMDAvY2Fza3ZpZXRuYW0tbXkuc2hhcmVwb2ludC5jb21AZWY2YWNkZTItOGZmZS00NDA5LTgzZWMtYzRiMGNjZDIzNjc2IiwiZXhwIjoiMTc0MTk0MDg3OCJ9.CiMKCXNoYXJpbmdpZBIWNlJLUDdhMWFxVTZ3UlVoQkJBL1c2QQoKCgRzbmlkEgIyORILCPil3-C7qvE9EAUaDDExNS43OC4xLjEwNSIUbWljcm9zb2Z0LnNoYXJlcG9pbnQqLFMyNm5vN1lnR05qT3piT0h5Wnp6Zmc2WE5UMEJBblgwandkSzNGSXNYdnc9MMABOAFCEKGKSnq84ABA0PNuE05mm0lKEGhhc2hlZHByb29mdG9rZW5iBHRydWVyYTBoLmZ8bWVtYmVyc2hpcHx1cm4lM2FzcG8lM2Fhbm9uIzg2OTRkNzI1N2VmOGQ3Y2UxZjE4OTQ2MDEwMzQ5MWM3YzQ0NWUwZjJjN2EwZDU3Y2QwZWQwMDEyZjhkYWFlOWN6ATDCAWEwIy5mfG1lbWJlcnNoaXB8dXJuJTNhc3BvJTNhYW5vbiM4Njk0ZDcyNTdlZjhkN2NlMWYxODk0NjAxMDM0OTFjN2M0NDVlMGYyYzdhMGQ1N2NkMGVkMDAxMmY4ZGFhZTljyAEB.IqjI3hF_qXe43mmy5E7HnpnDha64me5NXjJqlbepTIw%26version%3DPublished&psi=2769b4fc-413e-4874-b32b-14ce8412997e&enhanceAudio=true&cTag=%22c%3A%7B4F82216E-2ACC-40DF-A870-13D5C246581E%7D%2C2%22&action=Access&part=index&format=dash" -o test.mp4
```

##### **Giải thích từng phần**:

1. **`yt-dlp`**
    
    
    - Đây là công cụ dùng để tải video từ nhiều trang web khác nhau (bao gồm YouTube, Facebook, Twitter, v.v.).
2. **`--external-downloader aria2c`**
    
    
    - Thay vì để `yt-dlp` tự tải video, nó sẽ sử dụng **aria2c** (một công cụ tải đa luồng mạnh mẽ) để tăng tốc độ tải.
3. **`--external-downloader-args "-x 16 -s 16 -k 1M"`**
    
    
    - Đây là các tham số được truyền cho **aria2c**: 
        - `-x 16`: Cho phép tối đa **16 kết nối song song** để tải xuống.
        - `-s 16`: Sử dụng **16 luồng tải** (mỗi luồng lấy một phần của tệp).
        - `-k 1M`: Kích thước khối tải về là **1 MB**. Điều này giúp tối ưu hóa tốc độ tải.
4. **`"VIDEO_URL"`**
    
    
    - Đây là **URL của video** mà bạn muốn tải về (trong trường hợp này là một file MP4 DASH từ SharePoint).
5. **`-o test.mp4`**
    
    
    - **Lưu video với tên** `test.mp4`.

##### **Instruction**:

1. F12 on Browser
2. CTRL+R on the page, Click on The Play button
3. look for filter: videomanifest?provider
4. Stop The Play
5. Find "index&amp;format=dash" and remove all after that including &amp;

```bash
https://southeastasia1-mediap.svc.ms/transform/videomanifest?provider=spo&inputFormat=mp4&cs=fFNQTw&correlationId=e9528aa1-d08e-4000-d0f3-66c30839695e&docid=https%3A%2F%2Fcaskvietnam-my.sharepoint.com%2Fpersonal%2Fstorageadmin_cask_vn%2F_api%2Fv2.0%2Fdrives%2Fb%21MvyyCCTQ4Eutu3r8U9lOLzEJitllXbdGqZ2NatFHNgke3qPStJtIQ6fu_FviFeA1%2Fitems%2F016FAKD5LOEGBE7TBK35AKQ4AT2XBEMWA6%3Ftempauth%3Dv1.eyJzaXRlaWQiOiIwOGIyZmMzMi1kMDI0LTRiZTAtYWRiYi03YWZjNTNkOTRlMmYiLCJhdWQiOiIwMDAwMDAwMy0wMDAwLTBmZjEtY2UwMC0wMDAwMDAwMDAwMDAvY2Fza3ZpZXRuYW0tbXkuc2hhcmVwb2ludC5jb21AZWY2YWNkZTItOGZmZS00NDA5LTgzZWMtYzRiMGNjZDIzNjc2IiwiZXhwIjoiMTc0MTk0OTcyMCJ9.CiMKCXNoYXJpbmdpZBIWNlJLUDdhMWFxVTZ3UlVoQkJBL1c2QQoKCgRzbmlkEgIyORILCIKN1MnOr_E9EAUaDDExNS43OC4xLjEwNSIUbWljcm9zb2Z0LnNoYXJlcG9pbnQqLFMyNm5vN1lnR05qT3piT0h5Wnp6Zmc2WE5UMEJBblgwandkSzNGSXNYdnc9MMABOAFCEKGKUumO0ABA0PNmwwg5aV5KEGhhc2hlZHByb29mdG9rZW5iBHRydWVyYTBoLmZ8bWVtYmVyc2hpcHx1cm4lM2FzcG8lM2Fhbm9uIzg2OTRkNzI1N2VmOGQ3Y2UxZjE4OTQ2MDEwMzQ5MWM3YzQ0NWUwZjJjN2EwZDU3Y2QwZWQwMDEyZjhkYWFlOWN6ATDCAWEwIy5mfG1lbWJlcnNoaXB8dXJuJTNhc3BvJTNhYW5vbiM4Njk0ZDcyNTdlZjhkN2NlMWYxODk0NjAxMDM0OTFjN2M0NDVlMGYyYzdhMGQ1N2NkMGVkMDAxMmY4ZGFhZTljyAEB._7Xn98uOvn7JBih7kjlMMpiDBbFsA9BrG1V2dD1DJkk%26version%3DPublished&psi=f3663a6b-84f3-40eb-8432-a282e474ad4f&enhanceAudio=true&cTag=%22c%3A%7B4F82216E-2ACC-40DF-A870-13D5C246581E%7D%2C2%22&action=Access&part=index&format=dash
```

[https://cloud.kyluat.com/s/d4daw5nQM8KL3Fo](https://cloud.kyluat.com/s/d4daw5nQM8KL3Fo)

1. Copy from the beginning of url to the end.
2. Use the best option above

# Cloudflare Error 521: Proxmox Host and VM with Web Servers Are Down

Cloudflare Error 521: web server is down

#### Things to check:

- Check Error Logs
- Check All Services is running ( Nginx, PHP-fpm, mysql )
- Check Firewall Forwarding Rules
- Check Cloudflare DNS Records
- Check Domain Expired

#### My Host infrastructure: 

- Host Proxmox pve1 
    - pve1 has firewall rules and Route masquerading NAT which port forwarding port 80 , 443 to the VM 100
    - The host proxmox has VM 100 
        - VM 100 has firewall rules respond back to the host pve1

### Problem 1: Proxmox Host Firewall Rules are Gone after Restart

The problem here is when we restart the host proxmox pve1 , all firewall rules has been gone.

#### Solution:

ip address of VM 100: 192.168.xxx.3

##### Port Forwarding 

Forward Port For HTTP (Port 80)

```bash
sudo iptables -t nat -A PREROUTING -p tcp --dport 80 -j DNAT --to-destination 192.168.xxx.3:80
sudo iptables -A FORWARD -p tcp -d 192.168.xxx.3 --dport 80 -j ACCEPT
```

Forward Port for HTTPS ( port 443 )

```bash
sudo iptables -t nat -A PREROUTING -p tcp --dport 443 -j DNAT --to-destination 192.168.xxx.3:443
sudo iptables -A FORWARD -p tcp -d 192.168.xxx.3 --dport 443 -j ACCEPT
```

Allow Traffic on Host:

```bash
sudo iptables -A INPUT -p tcp --dport 80 -j ACCEPT
sudo iptables -A INPUT -p tcp --dport 443 -j ACCEPT
```

Enable IP Forwarding:

To make this change persistent across reboots, edit `/etc/sysctl.conf` and ensure the following line is uncommented:

```bash
net.ipv4.ip_forward = 1
```

apply the changes with

```bash
sudo sysctl -p
```

Verify the Configuration

To check if the port forwarding is working, you can:

Try accessing the web service on the host IP (e.g., http://public.ip.address or https://your.public.ip.address).

Ensure the VM’s web service is running and listening on the correct ports (80 for HTTP and 443 for HTTPS).

##### Save the iptables Rules

If everything works as expected, save your `iptables` rules to ensure they persist across reboots.

For most Linux distributions, you can save the rules with:

```bash
sudo iptables-save > /etc/iptables/rules.v4
```

Check again, to see ports are being forwarded to the right vm ip addresses

List all `iptables` rules including NAT (Network Address Translation)

```bash
sudo iptables -t nat -L -n -v --line-numbers
```

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

Check Forward Rules

```bash
sudo iptables -L FORWARD -n -v --line-numbers
```

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

##### Save the current iptables rules

```bash
sudo iptables-save > /etc/iptables/rules.v4
sudo apt install iptables-persistent
sudo netfilter-persistent save
sudo systemctl enable netfilter-persistent

```