2025/04/25

近期用rclone備份到google時會一直出現如下的錯誤而不成功

 2025/04/23 09:00:26 ERROR : testdisk-7.1-WIP/icons/scalable/apps: error reading destination directory: couldn't list directory: googleapi: Error 403: Quota exceeded for quota metric 'Queries' and limit 'Queries per minute' of service 'drive.googleapis.com' for consumer 'project_number:20644'.

Details:

[

  {

    "@type": "type.googleapis.com/google.rpc.ErrorInfo",

    "domain": "googleapis.com",

    "metadata": {

      "consumer": "projects/20644",

      "quota_limit": "defaultPerMinutePerProject",

      "quota_limit_value": "420000",

      "quota_location": "global",

      "quota_metric": "drive.googleapis.com/default",

      "service": "drive.googleapis.com"

    },

    "reason": "RATE_LIMIT_EXCEEDED"

  },

  {

    "@type": "type.googleapis.com/google.rpc.Help",

    "links": [

      {

        "description": "Request a higher quota limit.",

        "url": "https://cloud.google.com/docs/quotas/help/request_increase"

      }

    ]

  }

]

, rateLimitExceeded


應該是google調整了備分api的相關設定

必須在 rclone加上以下的參數才行


--drive-chunk-size 256M --transfers=3 --tpslimit 3



2025/04/08

早上發現所有lxc的備分都沒有成功
出現如下的log

'/mnt/pve/nfs98_bck/dump/vzdump-lxc-123-2025_04_06-21_24_12.tar.zst'
INFO: tar: /mnt/pve/nfs98_bck/dump/vzdump-lxc-123-2025_04_06-21_24_12.tmp: Cannot open: Permission denied
INFO: tar: Error is not recoverable: exiting now

之前用qnap備分都沒問題 換成群灰就不行了
查了一下有二個解決方法

1.
把 tmpdir 指到 /tmp

vi /etc//etc/vzdump.conf

#tmpdir: DIR
tmpdir: /tmp


2.
改變群灰 共用資料夾 nfs權限
























2025/03/20

之前一直都是使用nc來傳資料到 syslog
但這几天發現做好的檔案都被砍了
反正eset現在不允許nc的執行
另外找了一個 sfk
之前有試過 但當時有不少bug
語法如下

sfk oload log.txt +udpsend 10.0.0.1:514


2025/03/15

最近又有人反應讀取mail的速度很慢
讀寫大量小檔的效能基本上很難提升
查到使用 noatime nodiratime 應該可以改善一些
原理讀取時不會再去update 檔案資訊 
這裡說的資訊如下 

stat test

檔案:test
  大小:87              區塊:8          IO 區塊:4096   一般檔案
裝置:801h/2049d        Inode:15466774    實際連結 (hardlink) :1
權限:(0664/-rw-rw-r--)    Uid:( 1000/      aa)  Gid:( 1000/      aa)
最近存取:2025-03-15 08:40:59.971496391 +0800
最近變更:2020-10-14 05:42:44.007905808 +0800
最近變更:2020-10-14 05:42:44.059906505 +0800
建立時間:-

把以上二個參數加到 /etc/fstab裡要作用的分區 再remount 即可

UUID=xxxx-xxxx-xxxx-xxxx /home xfs defaults,noatime,nodiratime 0 0


再觀察看看效果有多少

2025/03/12

最近要移除client端的軟体
包括 anydesk teamviewer winrar java 等等
一開始的想法是從eset protect定期下指令
於是設定了以下指令排程

"%ProgramFiles(x86)%\anydesk\anydesk.exe" --silent --remove
"%ProgramFiles%\TeamViewer\uninstall.exe" /S
"%ProgramFiles(x86)%\TeamViewer\uninstall.exe" /S
"%programfiles%\WinRAR\uninstall.exe" /s
"%programfiles(x86)%\WinRAR\uninstall.exe" /s

但發現不一定會有 uninstall.exe 這個檔案 所以不一定會成功
接著查到可以使用 powershell來處理 指令如下

powershell -Command "Get-WmiObject -Query 'SELECT * FROM Win32_Product WHERE Name LIKE ''Java%'' AND vendor LIKE ''oracle%''' | ForEach-Object { $_.Uninstall() }"

試了一下 powershell指令無法直接從eset protect直接下

為了執行時不跳出訊息
只能依照之前的做法 寫成uninstall.vbs   再加入client排程

Set WshShell = CreateObject("WScript.Shell")
WshShell.Run "powershell -Command ""Get-WmiObject -Query 'SELECT * FROM Win32_Product WHERE Name LIKE ''Java%'' AND vendor LIKE ''oracle%''' | ForEach-Object { $_.Uninstall() }""", 0, False


schtasks /create /tn "uninstall task" /tr "C:\ProgramData\uninstall.vbs" /sc weekly /d MON /st 09:00 /ru abc /f

之後如果需要再移除其他軟体 再更改 uninstall.vbs重新派送即可


20250329 補充

在某些狀況下 還是需要切換到系統管理員身分才有作用
必須再安裝 gsudo 
安裝後使用 gsudo 執行指令 才行

2025/02/14

今天在 almalinux 9 dnf update出現以下錯誤


Error:

Problem: package iptables-legacy-1.8.10-4.1.el9.x86_64 from @System requires (iptables-libs(x86-64) = 1.8.10-4.el9 or iptables-libs(x86-64) = 1.8.10-4.el9_4), but none of the providers can be installed

- cannot install both iptables-libs-1.8.10-11.el9_5.x86_64 from baseos and iptables-libs-1.8.10-4.el9_4.x86_64 from @System

- cannot install both iptables-libs-1.8.10-4.el9_4.x86_64 from baseos and iptables-libs-1.8.10-11.el9_5.x86_64 from baseos

- cannot install the best update candidate for package iptables-libs-1.8.10-4.el9_4.x86_64

- cannot install the best update candidate for package iptables-legacy-1.8.10-4.1.el9.x86_64

(try to add '--allowerasing' to command line to replace conflicting packages or '--skip-broken' to skip uninstallable packages or '--nobest' to use not only best candidate packages)

本來想把iptables-legacy iptables-libs 都移除 但因為這台跑docker 如果移除會連docker一起移掉

查到官方 forum有人提供解法

dnf --assumeyes swap iptables-legacy iptables-nft


https://forums.almalinux.org/t/almalinux-9-yum-update-iptables-legacy-and-iptables-libs-conflict/3818/2

2025/02/06

要如何讓使用者能看影片但不被下載

首先把 mp4 分片

ffmpeg -i abc.mp4 -codec: copy -start_number 0 -hls_time 15 -hls_list_size 0 -f hls abc.m3u8

分片後把 abc.mp4 移出目錄


建立 index.html


<html>
<head>
  <link href="https://vjs.zencdn.net/8.16.1/video-js.css" rel="stylesheet" />

  <!-- If you'd like to support IE8 (for Video.js versions prior to v7) -->
  <!-- <script src="https://vjs.zencdn.net/ie8/1.1.2/videojs-ie8.min.js"></script> -->
</head>

<body>
  <video
    id="my-video"
    class="video-js"
    controls
    preload="auto"
    width="640"
    height="480"
    刪除以下一行
    poster="MY_VIDEO_POSTER.jpg"
    data-setup="{}"
  >
    <source src="MY_VIDEO.mp4" type="video/mp4" />
    <source src="MY_VIDEO.webm" type="video/webm" />
   刪除以上二行

    把第一步產生的所有分片檔放到 web server 的目錄 並依需求修改以下文字

    <source src='http://10.0.0.1/test/abc.m3u8' type="application/x-mpegURL">   
    
    <p class="vjs-no-js">
      To view this video please enable JavaScript, and consider upgrading to a
      web browser that
      <a href="https://videojs.com/html5-video-support/" target="_blank"
        >supports HTML5 video</a
      >
    </p>
  </video>

  <script src="https://vjs.zencdn.net/8.16.1/video.min.js"></script>
</body>
</html>


用browser打開即可觀看