2026/10/19

這几天在測試把免費的ai提供者整合起來
像 ollama nvidia google ai studio 等
找到了 litellm
記一下安裝流程

先建個目錄 並在目錄下產生 config.yaml
內容如下

model_list:
  - model_name: auto
    litellm_params:
      model: ollama/gemma4:31b
      api_base: "https://ollama.com"
      api_key: "fcfc69438036414CJtv9L-1EI1i2"

  - model_name: auto
    litellm_params:
      model: openai/nvidia/nemotron-3.5-super-vl-120b-a12b
      api_base: "https://integrate.api.nvidia.com/v1"
      #model: nvidia/nemotron-3.5-super-vl-120b-a12b
      #api_base: "https://integrate.api.nvidia.com"
      api_key: "nvapi-h6TxXTV08YRypl96bQ5VhXAaPWs"

#此區設定若有提供者有問題時會詢問其他  
router_settings:
  num_retries: 3
  allowed_fails: 1
  ##cooldown_time: 300
  timeout: 90

#設定要連到 litellm的密碼
general_settings:
  master_key: "password"

之後啟動docker

docker run -d   --name litellm-proxy   --restart unless-stopped   -p 4000:4000   -v /home/config.yaml:/app/config.yaml   ghcr.io/berriai/litellm:main-latest   --config /app/config.yaml --port 4000 --num_workers 8

跑起來後測試一下

curl http://10.0.0.1:4000/v1/chat/completions \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer password" \
  -d '{
    "model": "auto",
    "messages": [{"role": "user", "content": "Hello ai!"}]
  }'


如果要除錯可以先設定不同提供者不同的model_name
curl的 model 指定上述不同的 model_name

2026/10/15

昨天外稽
提到sbom
軟体盤點的東東

安裝 syft

curl -sSfL https://raw.githubusercontent.com/anchore/syft/main/install.sh | sh -s -- -b /tmp

產生 sbom

/tmp/syft dir:/ -o spdx-json=/tmp/linux_sbom.json --exclude "/home"


安裝 grype 後解析sbom並查看有無漏洞

grype db update

grype linux_sbom.json



2026/10/14

今天graylog 升到 7.2 後

發現資料都沒有出現

查了一下發現以下的問題









[c0047f66-c774-11f1-9869-bc24115e9a75]: index [graylog_345], id [c0047f66-c774-11f1-9869-bc24115e9a75], message [failed to parse field [nf_stop] of type [long] in document with id 'c0047f66-c774-11f1-9869-bc24115e9a75'. Preview of field's value: '2026-10-14T02:12:41.687Z']

[c0047f65-c774-11f1-9869-bc24115e9a75]: index [graylog_345], id [c0047f65-c774-11f1-9869-bc24115e9a75], message [failed to parse field [nf_stop] of type [long] in document with id 'c0047f65-c774-11f1-9869-bc24115e9a75'. Preview of field's value: '2026-10-14T02:11:46.808Z']

[c0047f68-c774-11f1-9869-bc24115e9a75]: index [graylog_345], id [c0047f68-c774-11f1-9869-bc24115e9a75], message [failed to parse field [nf_stop] of type [long] in document with id 'c0047f68-c774-11f1-9869-bc24115e9a75'. Preview of field's value: '2026-10-14T02:12:41.028Z']

[c0047f67-c774-11f1-9869-bc24115e9a75]: index [graylog_345], id [c0047f67-c774-11f1-9869-bc24115e9a75], message [failed to parse field [nf_stop] of type [long] in document with id 'c0047f67-c774-11f1-9869-bc24115e9a75'. Preview of field's value: '2026-10-14T02:12:41.028Z']


Rotate active index 就可以解決



2026/10/10

今天在升pve kernel時才發現很多guest都出現如下的問題
EFI disk 憑証 2026/6 就過期了
解決方法有說明
但因為做完要關几再開几
所以必須找適合的時間處理




2026/10/08

今天在升級 splunk時又出現以下問題

rpm -Uhv splunk-10.6.0.5-86587d4e3b27.x86_64.rpm
warning: splunk-10.6.0.5-86587d4e3b27.x86_64.rpm: Header V4 RSA/SHA256 Signature, key ID b3cd4420: NOKEY
Verifying...                          ################################# [100%]
Preparing...                          ################################# [100%]
verify that this sytem has all the commands we will require to perform the preflight step
This looks like an upgrade of an existing Splunk Server. Checking to see what component we are installing
extracting splunk_preinstall_base64 into splunk/bin directory
Cannot initialize: /opt/splunk/etc/system/metadata/local.meta: Permission denied
Cannot initialize: /opt/splunk/etc/apps/learned/metadata/local.meta: Permission denied
Currently configured KVStore database path="/opt/splunk/var/lib/splunk/kvstore"

-> Version file="/opt/splunk/var/run/splunk/kvstore_upgrade/versionFile70" does not exists or not accessible!
Failed to open file! Error=Permission denied

最近好几次有碰到同樣的狀況
搞了半天
最後用最簡單粗暴的方式解決
chmod -R 777 /opt/splunk/

再跑一次安裝就好了

2026/10/05

有user最近几天一直有大流量
但目前只能看到目的ip 無法知道是什麼程式造成
寫個bat 定時排程記錄
如果再發生有log可以查

@echo off
:: 取得年月日
set "yy=%date:~0,4%"
set "mm=%date:~5,2%"
set "dd=%date:~8,2%"

:: 取得時分秒
set "hh=%time:~0,2%"
set "min=%time:~3,2%"
set "ss=%time:~6,2%"

:: 如果小時小於 10(前面有空格),補 0
if "%hh:~0,1%"==" " set "hh=0%hh:~1,1%"

set "dt=%yy%%mm%%dd%_%hh%%min%%ss%"

echo 當前時間檔名:%dt%
tcpvcon.exe -a -c -n > "%dt%.csv"

2026/10/03

之前如果要打包並執行都會使用7z 再轉成執行檔
後來找了 bandizip 感覺方便許多

最近又發現 bat to exe
可以把所有需要的檔案一次打包並執行寫好的批次檔
重點是使用這個方式
就不用怕被看到原始碼了 

有個問題 很容易被M$誤判