# Мелочи

# Чистим System volume

DiskShadow  
Delete shadows OLDEST c:\\

# ffmpeg

g729 to wav

```
ffmpeg -f g729 -i "C:\Video\wav\123.g729" -f wav "C:\Video\wav\123.wav"
```

avi to mov с использованием GPU

```
ffmpeg -i video.avi -c:v h264_nvenc -preset p7 -pix_fmt yuv420p -an test.mov
 50\50 CPU и GPU
ffmpeg -hwaccel cuda -c:v h264_cuvid -i input.avi -c:v h264_nvenc -preset p7 -pix_fmt yuv420p -an output.mov
100% GPU
```

mov to mov

```
ffmpeg -hwaccel cuvid -i input.mov -c:v h264_nvenc -bsf:v h264_mp4toannexb -b:v 5M -c:a copy output.mov
```

100%GPU

# Восстанавливаем после ошибки Check of pool pve/data failed (status:64)

```
lvconvert --repair pve/data
```

занимет около 5 минут но может и больше

# Админские шары без домена

\[HKEY\_LOCAL\_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Policies\\System\]  
"LocalAccountTokenFilterPolicy"=dword:00000001

# Ollama

## 1. Prerequisites

- Ubuntu 22.04 server
- NVIDIA GPU with at least 16 GB VRAM
- Root or sudo access
- Stable internet connection

---

## 2. Install NVIDIA Drivers

Make sure your GPU drivers are installed and working.

<figure class="highlighted-code" id="bkmrk-sudo-apt-update-sudo">```bash
sudo apt update
sudo apt install -y ubuntu-drivers-common
ubuntu-drivers devices   # check recommended drivers
sudo ubuntu-drivers autoinstall
```

</figure>Reboot and confirm GPU availability:

<figure class="highlighted-code" id="bkmrk-sudo-reboot-nvidia-s">```bash
sudo reboot
nvidia-smi
```

</figure>You should see details of your GPU.

---

## 3. Install CUDA Toolkit

Ollama uses CUDA for GPU acceleration. Install CUDA 12.x (recommended).

<figure class="highlighted-code" id="bkmrk-wget-https%3A%2F%2Fdevelop">```bash
wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2204/x86_64/cuda-ubuntu2204.pin
sudo mv cuda-ubuntu2204.pin /etc/apt/preferences.d/cuda-repository-pin-600

wget https://developer.download.nvidia.com/compute/cuda/12.2.2/local_installers/cuda-repo-ubuntu2204-12-2-local_12.2.2-1_amd64.deb
sudo dpkg -i cuda-repo-ubuntu2204-12-2-local_12.2.2-1_amd64.deb
sudo cp /var/cuda-repo-ubuntu2204-12-2-local/cuda-*-keyring.gpg /usr/share/keyrings/
sudo apt update
sudo apt install -y cuda
```

</figure>Check CUDA installation:

<figure class="highlighted-code" id="bkmrk-nvcc---version">```bash
nvcc --version
```

</figure>---

## 3.1 

<table class="installerTable" id="bkmrk-cuda-toolkit-install" style="width: 479.136%; height: 140.781px;"><tbody><tr style="height: 29.7969px;"><td class="installerPanelTitleBar" style="width: 89.8459%; height: 29.7969px;">CUDA Toolkit Installer</td><td class="installerPanelTitleBar" style="width: 10.1323%; height: 29.7969px;">[](https://developer.download.nvidia.com/compute/cuda/13.0.2/local_installers/cuda-repo-ubuntu2204-13-0-local_13.0.2-580.95.05-1_amd64.deb "cuda-repo-ubuntu2204-13-0-local_13.0.2-580.95.05-1_amd64.deb 3.8 GB")</td></tr><tr style="height: 29.7969px;"><td class="installationInstructions" colspan="2" style="width: 99.9782%; height: 29.7969px;">Installation Instructions:</td></tr><tr style="height: 81.1875px;"><td colspan="2" style="width: 99.9782%; height: 81.1875px;">```
wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2204/x86_64/cuda-ubuntu2204.pin
sudo mv cuda-ubuntu2204.pin /etc/apt/preferences.d/cuda-repository-pin-600
wget https://developer.download.nvidia.com/compute/cuda/13.0.2/local_installers/cuda-repo-ubuntu2204-13-0-local_13.0.2-580.95.05-1_amd64.deb
sudo dpkg -i cuda-repo-ubuntu2204-13-0-local_13.0.2-580.95.05-1_amd64.deb
sudo cp /var/cuda-repo-ubuntu2204-13-0-local/cuda-*-keyring.gpg /usr/share/keyrings/sudo apt-get update
sudo apt-get -y install cuda-toolkit-13-0
```

<span id="bkmrk--4"></span></td></tr></tbody></table>

## 3.2

```
sudo apt install nvidia-cuda-toolkit
```

## 4. Install Ollama

Download and install Ollama runtime:

<figure class="highlighted-code" id="bkmrk-curl--fssl-https%3A%2F%2Fo">```bash
curl -fsSL https://ollama.com/install.sh | sh
```

</figure>Verify service is running:

<figure class="highlighted-code" id="bkmrk-systemctl-status-oll">```bash
systemctl status ollama
```

</figure>### Test Ollama

Run a quick model test:

<figure class="highlighted-code" id="bkmrk-ollama-run-tinyllama">```bash
ollama run tinyllama
```

</figure>Other models available:

<figure class="highlighted-code" id="bkmrk-ollama-pull-gpt-oss%3A">```bash
ollama pull gpt-oss:20b
```

</figure>---

## 5. Install Docker

Open WebUI runs inside Docker. Follow these steps to install Docker and Docker Compose:

<figure class="highlighted-code" id="bkmrk-%23-remove-any-old-ver">```bash
# Remove any old versions
sudo apt remove -y docker docker-engine docker.io containerd runc

# Install required packages
sudo apt update
sudo apt install -y ca-certificates curl gnupg lsb-release

# Add Docker’s official GPG key
sudo mkdir -p /etc/apt/keyrings
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg

# Add Docker repository
echo \"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable\" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null

# Install Docker and Docker Compose
sudo apt update
sudo apt install -y docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
```

</figure>Enable and test Docker:

<figure class="highlighted-code" id="bkmrk-sudo-systemctl-enabl">```bash
sudo systemctl enable --now docker
sudo docker run hello-world
```

</figure>Allow your user to run Docker without sudo:

<figure class="highlighted-code" id="bkmrk-sudo-usermod--ag-doc">```bash
sudo usermod -aG docker $USER
newgrp docker
```

</figure>Check Docker Compose version:

<figure class="highlighted-code" id="bkmrk-docker-compose-versi">```bash
docker compose version
```

</figure>---

## 6. Install Open WebUI

Clone and run Open WebUI:

<figure class="highlighted-code" id="bkmrk-git-clone-https%3A%2F%2Fgi">```bash
git clone https://github.com/open-webui/open-webui.git
cd open-webui
docker compose up -d
```

</figure>Access the interface at:

<figure class="highlighted-code" id="bkmrk-http%3A%2F%2F%3Cserver-ip%3E%3A3">```plaintext
http://<server-ip>:3000
```

</figure>---

## 7. Connect Open WebUI to Ollama

In the WebUI:

- Go to **Settings → Backends → Ollama**
- Set API URL:
    
    <figure class="highlighted-code">```plaintext
    http://host.docker.internal:11434
    ```
    
    </figure>Or, if accessing remotely:
    
    <figure class="highlighted-code">```plaintext
    http://<server-ip>:11434
    ```
    
    </figure>

---

## 8. Enable GPU Support in Docker (Optional)

If you want Docker containers (like Open WebUI) to access GPU directly:

<figure class="highlighted-code" id="bkmrk-%23-install-nvidia-con">```bash
# Install NVIDIA Container Toolkit
distribution=$(. /etc/os-release;echo $ID$VERSION_ID)
curl -s -L https://nvidia.github.io/nvidia-docker/gpgkey | sudo apt-key add -
curl -s -L https://nvidia.github.io/nvidia-docker/$distribution/nvidia-docker.list | sudo tee /etc/apt/sources.list.d/nvidia-docker.list
sudo apt update
sudo apt install -y nvidia-container-toolkit
sudo systemctl restart docker
```

</figure>Edit `docker-compose.yml` for Open WebUI:

<figure class="highlighted-code" id="bkmrk-services%3A-open-webui">```yaml
services:
  open-webui:
    deploy:
      resources:
        reservations:
          devices:
            - driver: nvidia
              count: all
              capabilities: [gpu]
```

</figure>Restart:

<figure class="highlighted-code" id="bkmrk-docker-compose-down-">```bash
docker compose down
docker compose up -d
```

</figure>---

## 9. Verify GPU Usage

Run a model and check GPU utilization:

<figure class="highlighted-code" id="bkmrk-ollama-run-gpt-oss%3A2">```bash
ollama run gpt-oss:20b
```

</figure>In another terminal:

<figure class="highlighted-code" id="bkmrk-nvidia-smi">```bash
nvidia-smi
```

</figure>You should see `ollama` using GPU memory.

---

## 10. Start Chatting with any Model You Like

Now you can:

1. Pull models with Ollama:
    
    <figure class="highlighted-code">```bash
    ollama pull gpt-oss
    ollama pull deepseek-r1
    ollama pull llama3
    ollama pull llama4
    ollama pull gemma3
    ollama pull phi4
    ollama pull codellama
    ```
    
    </figure>
2. Select the model in **Open WebUI**.
3. Chat through your browser!

# Reverse proxy для WebSocket в Nginx

Минимальные настройки: /etc/nginx/conf.d/include/proxy.conf

```
# WebSocket support
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
```

отключаем буферизацию

```
proxy_buffering off;
```