2026/04/26

手動更新 docker並重啟


#!/bin/bash

rm -f /tmp/docker_run

read -p "docker name:" docker_name

ori=$(docker ps -a --filter "name=^/${docker_name}$" --format "{{.Image}}")

docker pull $ori

docker run --rm -v /var/run/docker.sock:/var/run/docker.sock assaflavie/runlike $docker_name > /tmp/docker_run

chmod +x /tmp/docker_run

docker rm -f $docker_name

/tmp/docker_run

2026/04/22

前几天把grafana升到 13 版後

原本可以捉的圖都無法出現了

查了一下才知道 13 版 已經把  

grafana-image-renderer 的plugin 拿掉了

官方文件有提到怎麼理

https://grafana.com/docs/grafana/latest/setup-grafana/image-rendering/


2026/04/17

昨天看文章有提到 MediaMTX 這個軟体
單一檔案就可以執行
想說下載來玩玩
有几個點要注意

使用obs串流時 輸出 設定一定要修改如下 否則無法串流成功


















另外就是直接用browser 打開 使用 webrtc 時 影像沒問題 但完全沒聲音
但這時用 vlc 去開 影像聲音都沒問題
查到說是音訊編碼的問題
但srs沒有這個問題

使用如下指令推流 影音都沒問題

ffmpeg -re -i input.mp4 \
  -c:v libx264 -preset veryfast -tune zerolatency \
  -c:a libopus -ar 48000 -ac 2 -b:a 96k \
  -f rtsp rtsp://localhost:8554/live


還有一個問題就是browser打開後預設是靜音 要手動打開



使用以下指令進行螢幕擷取並串流 影音都沒問題

ffmpeg -f x11grab -video_size 1024x768 -framerate 30 -i :0.0 \
-f pulse -i default \
-c:v libx264 -preset veryfast -pix_fmt yuv420p -g 60 -bf 0 \
-c:a libopus -b:a 128k -ar 48000 -ac 2 \
-flags +global_header \
-rtsp_transport tcp -f rtsp rtsp://localhost:8554/live


obs目前還沒找到方法

2026/04/14

之前filegator docker 更新後 之前建的user都會不見
而且admin的密碼也會還原成預設

原來是少加了一個對應

-v filegator-private:/var/www/filegator/private

完整如下

docker run -d -p 9999:8080 -v filegator-data:/var/www/filegator/repository -v filegator-private:/var/www/filegator/private --name filegator --restart=always filegator/filegator:latest

2026/03/21

超級好用的docker更新工具

https://github.com/mag37/dockcheck

2026/03/10

安裝openclaw時 大模型的選單裡沒有 ollama 可以選
只能利用ollama去呼叫

ollama launch openclaw --model gpt-oss:120b-cloud

一些ollama會用到的指令

ollama ls



一些openclaw會用到的指令

openclaw plugins list

openclaw update

openclaw logs --follow

openclaw onboard

openclaw approvals allowlist 


2026/03/09

上週因為ruckus switch 的power壞了
查log時竟然查到內部攻擊者








想說能不能從vsz把user踢掉
程式如下

#!/bin/bash

#how to use

#./vsz_kick_ip ip

VSZ="https://10.1.1.1:8443"
USER="user"
PASS="passwd"

IP="$1"

#拿到cookie.txt

curl -k -c /tmp/cookie.txt -X POST "$VSZ/wsg/api/public/v6_1/session" \
  -H "Content-Type: application/json" \
  -d "{\"username\": \"$USER\", \"password\": \"$PASS\"}"

#使用cookie.txt 找出 ip 是那個 mac

MAC=$(curl -sk -b /tmp/cookie.txt -X POST "$VSZ/wsg/api/public/v6_1/query/client" -H "Content-Type: application/json" -d '{"limit": 100000,"index": 0}'|jq|grep $IP -A 2|tail -n 1|cut -d '"' -f 4)

echo $MAC


#取出 mac 並斷線

curl -sk -b /tmp/cookie.txt -X POST "$VSZ/wsg/api/public/v6_1/clients/disconnect" -H "Content-Type: application/json" -d '{"mac":"'$MAC'"}'

運作沒問題
但踢掉後又會馬上連線 所以沒用
本來是想再加入黑名單
但現在的無線又是隨几mac
所以感覺作用不大
再想想要怎麼處理