digital ocean 設定密碼登入

因為ssh_config有Include /etc/ssh/ssh_config.d/*.conf,所以要修改/etc/ssh/sshd_config.d底下的檔案

Dell iDRAC 本機設定IP

先安裝racadm,在輸入service tag後的軟體下載頁面適用於 Microsoft Windows Server(R) 的 Dell EMC iDRAC 工具,v11.0.0.0
Dell-iDRACTools-Web-WINX64-11.3.0.0-609_A00

1
2
3
4
5
6
#查IP
racadm get iDRAC.IPv4
#設定IP
racadm set iDRAC.IPv4.Address 192.168.0.1
racadm set iDRAC.IPv4.Netmask 255.255.255.0
racadm set iDRAC.IPv4.Gateway 192.168.0.254

在作業系統打開iDrac網頁

  1. 下載對應型號的iDRAC Service Module for Windows
  2. 按iDRACSvcMod進行安裝
  3. 在開始用iDRAC UI Launcher打開網頁

https://www.dell.com/support/kbdoc/zh-tw/000194572/poweredge-%E5%A6%82%E4%BD%95%E5%AE%89%E8%A3%9D-ism-%E5%8F%8A%E5%95%9F%E5%8B%95-idrac-ui-%E5%95%9F%E5%8B%95%E5%99%A8

nvidia-tririon-inference-server-model-analyzer

環境

Ubuntu 22.04
trition inference server version : 23.08

在git clone下來的model_analyzer資料夾下啟動docker

1
2
3
4
5
docker run -it --gpus all \
-v /var/run/docker.sock:/var/run/docker.sock \
-v $(pwd)/examples/quick-start:$(pwd)/examples/quick-start \
-v $(pwd)/examples/quick-start/output-model-repo:$(pwd)/examples/quick-start/output-model-repo \
--net=host nvcr.io/nvidia/tritonserver:23.08-py3-sdk

假設現在所在路徑$(pwd)是/home/user/model_inference

啟動docker後會發現quick-start所在的的路徑會跟host主機一模一樣,因此下面的指令可以直接用跟host一模一樣的路徑去執行

1
2
3
4
5
model-analyzer profile \
--model-repository /home/user/model_inference/model_analyzer/examples/quick-start \
--profile-models add_sub --triton-launch-mode=docker \
--output-model-repository-path /home/user/model_inference/model_analyzer/examples/quick-start/output-model-repo/add \
--export-path profile_results

查詢

https://github.com/triton-inference-server/model_analyzer/blob/5e3746f738b56118b31f28d9472db04f7361aaf8/docs/config_search.md#examples-of-additional-model-config-parameters

https://github.com/triton-inference-server/tutorials/blob/main/Conceptual_Guide/Part_4-inference_acceleration/README.md

onnx execution_accelerators?

參考:

https://github.com/triton-inference-server/model_analyzer/blob/4b45d2daeb9f574d13ae0e774677c87c04ef2124/docs/quick_start.md

rclone

安裝

依照官網下在binary檔進行安裝,apt下載的版本是比較舊的

設定

依照rclone config的指示進行設定

  1. 申請google OAuth client id,以便提高效能,使用 rclone config的時候會被詢問Option client_id.和Option client_secret.的時候可以填入

https://rclone.org/drive/#making-your-own-client-id

如果需要使用服務帳號

填入 JSON 金鑰檔案的完整路徑,例如:

1
/home/username/.config/rclone/service-account.json

或使用 ~ 代表家目錄:

1
~/rclone-service-account.json

jenhaoyang: 從哪裡取得service-account.json

GitHub Copilot: # 如何取得 Service Account JSON 金鑰檔案

Service Account JSON 金鑰檔案需要從 Google Cloud Platform (GCP) 建立和下載。以下是完整步驟:

建立service account步驟

rclone 在個人帳戶不要使用service account,因為沒辦法打開GSuite來設定權取Google drive API的權限

測試rclone連線

如果使用service account,必須把資料夾分享給service account的gmail帳號,因為他不能直接存取我們的google drive。另外也檢查的時候也必須要指定顯示與我們共用的資料夾,不然會看不到東西。

1
rclone ls google-remote: --drive-shared-with-me

https://ivonblog.com/posts/rclone-linux/

rclone mount

  1. 記得加上--daemon啟用背景執行
  2. --drive-shared-with-me也記得要加
    On Linux/macOS/FreeBSD start the mount like this, where /path/to/local/mount is an empty existing directory:
    1
    rclone mount remote:path/to/files /path/to/local/mount --drive-shared-with-me --daemon

rclone copy

rclone copy gdrive:backups/photos_backup /home/user/photos_restored

rclone copy 下載參數

核心參數建議

這是一個針對下載大量照片的 rclone copy 建議指令範本:

1
rclone copy --transfers=32 --checkers=64 --fast-list --progress remote:path/to/photos /local/path/to/photos

參數詳解與設定建議

  • --transfers=N

    • 作用:設定同時傳輸的檔案數量。這是提升大量小檔案下載速度最重要的參數。
    • 預設值:4
    • 建議設定:對於大量照片,您可以大幅提高此數值。建議從 1632 開始測試,如果您的網路頻寬和 CPU 效能允許,可以逐步增加,例如 64 或更高。需要注意的是,過高的數值可能會導致記憶體耗盡或被雲端服務商限速。
  • --checkers=N

    • 作用:設定並行檢查檔案的執行緒數量。在開始傳輸前,rclone 會檢查來源和目的地的檔案。增加此數值可以加快這個過程。
    • 預設值:8
    • 建議設定:此數值通常可以設定為 --transfers 的兩倍。例如,如果您設定 --transfers=32,可以將 --checkers 設定為 64。這有助於檢查程序快速完成,讓傳輸程序盡快開始。
  • --fast-list

    • 作用:這個參數會一次性列出遠端所有的檔案,而不是逐級遞迴掃描。對於包含大量檔案的目錄,這可以顯著減少列出檔案所需的時間。
    • 建議設定:在下載大量照片時,強烈建議啟用此參數。
  • --progress (-P)

    • 作用:顯示即時的傳輸進度,包括傳輸速度、預計剩餘時間和正在傳輸的檔案。這不會直接提升速度,但能幫助您監控傳輸狀況並判斷參數調整是否有效。

其他可選優化參數

  • --order-by string

    • 作用:控制檔案的傳輸順序。在某些情況下,混合傳輸大小檔案可能比隨機傳輸更有效率。
    • 建議設定:可以嘗試 --order-by "size,mixed,75",這會讓 rclone 優先處理 75% 的小檔案和 25% 的大檔案,有助於保持傳輸管道飽和。
  • --no-traverse

    • 作用:如果您只是要複製少量新檔案到一個已經很大的本地目錄,使用此參數可以避免掃描整個目標目錄,從而加快啟動速度。
    • 建議設定:僅適用於增量備份的場景。
  • --checksum (-c)

    • 作用:讓 rclone 不僅僅依賴檔案大小和修改時間,還會檢查檔案的校驗和 (checksum) 來判斷檔案是否相同。這會增加一些 CPU 負擔,但在確保資料完整性上更可靠。如果您的首要目標是速度,可以不加此參數。

如何找到最適合您的設定?

  1. 從建議值開始:使用 --transfers=32--checkers=64 作為起點。
  2. 監控效能:執行指令並加上 --progress 參數,觀察傳輸速度和穩定性。
  3. 逐步調整
    • 如果您的 CPU 使用率和網路頻寬都還很低,可以嘗試逐步增加 --transfers--checkers 的數值。
    • 如果開始出現大量錯誤訊息(例如 rateLimitExceededtimeout),或者速度不升反降,表示數值設定得太高,需要調降。

注意事項

  • 雲端服務商的限制:不同的雲端儲存(如 Google Drive, Dropbox, S3)對 API 的請求頻率有不同的限制。特別是 Google Drive,對於檔案的建立(這也間接影響下載)有每秒約 2-3 個檔案的限制。在這種情況下,即使瘋狂提高 --transfers 參數,速度也無法提升,甚至可能因觸發限制而變得更慢。
  • 硬體資源:較高的 --transfers--checkers 會消耗更多的記憶體和 CPU 資源。請確保您的電腦有足夠的資源來應付。
  • 打包檔案:如果照片檔案極小(例如都只有幾 KB),且數量極大(數十萬甚至百萬),最有效率的方式可能是在遠端將它們打包成一個大的壓縮檔(如 .zip 或 .tar),然後再下載這個單一的大檔案。 這可以完全繞過小檔案傳輸的延遲問題。

reclone設為service

啟動gui

rclone rcd –rc-web-gui –rc-web-gui-update –rc-no-auth

rclone的服務設定檔放在~/.config/systemd/user/底下

參考

https://rclone.org/commands/rclone_rcd/
https://gist.github.com/kabili207/2cd2d637e5c7617411a666d8d7e97101

fiftyone讀取dataset錯誤

  • 錯誤訊息
    1
    2
    {"t":{"$date":"2025-06-04T08:11:32.830Z"},"s":"I",  "c":"CONTROL",  "id":20697,   "ctx":"-","msg":"Renamed existing log file","attr":{"oldLogPath":"/home/iisi/.fiftyone/var/lib/mongo/log/mongo.log","newLogPath":"/home/iisi/.fiftyone/var/lib/mongo/log/mongo.log.2025-06-04T08-11-32"}}
    Subprocess ['/home/iisi/2005013/model_training/YOLO/venv/lib/python3.10/site-packages/fiftyone/db/bin/mongod', '--dbpath', '/home/iisi/.fiftyone/var/lib/mongo', '--logpath', '/home/iisi/.fiftyone/var/lib/mongo/log/mongo.log', '--port', '0', '--nounixsocket'] exited with error 100:

解法

https://docs.voxel51.com/user_guide/config.html#configuring-a-mongodb-connection

用自建的mongo db

You can achieve this by adding the following entry to your ~/.fiftyone/config.json file:
environment variable

1
export FIFTYONE_DATABASE_URI=mongodb://[username:password@]host[:port]

VSCode_CMake_GoogleTest

重點:

下面這兩行要放在最外面的 CMakeLists.txt 中,這樣才能在build資料夾啟動ctest

1
2
include(CTest)
enable_testing()

讓VSCode的Ctest可以下中斷點

參考:
https://stackoverflow.com/a/76447033/22299707

https://github.com/microsoft/vscode-cmake-tools/blob/defc0b5369c64467c3466b1cee3faba9f9633a6a/docs/debug-launch.md#debugging-tests

launch.json

1
2
3
4
5
6
7
8
9
{
"name": "(ctest) Launch",
"type": "cppdbg",
"cwd": "${cmake.testWorkingDirectory}",
"request": "launch",
"program": "${cmake.testProgram}",
"args": [ "${cmake.testArgs}" ],
// other options...
}

參考:
https://github.com/esweet431/box2d-lite/blob/vs-launch/CMakePresets.json

cmake google test配置

範例

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
find_package(Threads REQUIRED)


include(FetchContent)
FetchContent_Declare(
googletest
GIT_REPOSITORY https://github.com/google/googletest.git
GIT_TAG 52eb8108c5bdec04579160ae17225d66034bd723 # release-1.17.0
)
FetchContent_MakeAvailable(googletest)
enable_testing()

# Create a libgmock target to be used as a dependency by test programs

add_subdirectory(testplate)

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
include(GoogleTest)
file(GLOB SRCS *.cpp)
add_executable(testplate ${SRCS})


target_link_libraries(testplate
gtest_main
libtestplate
)

gtest_add_tests(TARGET testplate
TEST_SUFFIX .noArgs
TEST_LIST noArgsTests
)

#gtest_add_tests(TARGET testplate
# EXTRA_ARGS --someArg someValue
# TEST_SUFFIX .withArgs
# TEST_LIST withArgsTests
#)

set_tests_properties(${noArgsTests} PROPERTIES TIMEOUT 10)
#set_tests_properties(${withArgsTests} PROPERTIES TIMEOUT 20)

參考:
https://cmake.org/cmake/help/latest/module/FetchContent.html#integrating-with-find-package

https://cmake.org/cmake/help/v3.31/module/GoogleTest.html#command:gtest_add_tests