https://avatars.githubusercontent.com/u/6058558

程式狂想筆記

Raspberry PI Git Webhook...

將應用程式部署到 Raspberry Pi 時,手動 SSH 登入再執行 git pull 的方式既麻煩又容易出錯。透過 GitHub Webhook 搭配內網穿透工具,可以實現每次推送程式碼到 GitHub 時,Raspberry Pi 自動拉取更新並重啟服務的 CI/CD 流程。

[BitBucket]做git pull一直問你輸入密碼

前幾個月有個程式,因為需要多人做設定檔 所以就使用bitbucket來管理 在樹莓派一直遇到要打帳號、密碼 其怪,私鑰那些我都要試過阿 結果Google一下,發現這篇 Git on Bitbucket: Always asked for password, even after uploading my public SSH key - Stack Overflow 預設是https情況下會問密碼 在.git/config把網址改成ssh網址確實可運做了 ssh://git@bitbucket.org/userName/repoName.git 1 2 3 4 5 6 7 As explained here, if you clone with SSH url, you don't need to enter username / password each time you push / pull. Check above answer by @manojlds But if you want to clone with HTTPS and want to avoid entering username / password each time, you can store credentials into cache with below command: git config --global credential.

Crontab指令打百分比需要跳脫符號

在 crontab 的指令設定中,百分比符號(%)有特殊含義:它會被解釋為換行字元(newline)。如果你的指令中有 %(例如 date "+%Y-%m-%d"),必須用反斜線跳脫,否則 cron 會靜默地執行錯誤,甚至不執行任何動作。

Server Side Includes(SSI)記錄

Server Side Includes(SSI)是一種伺服器端的指令集,讓 Web 伺服器在將 HTML 回應傳送給瀏覽器之前,先解析並執行嵌入在 HTML 中的特殊指令。這通常用於靜態網站中動態插入共用元件,例如頁首、頁尾、導覽列等,避免在每個頁面重複相同的 HTML 程式碼。