顯示具有 Debug 標籤的文章。 顯示所有文章
顯示具有 Debug 標籤的文章。 顯示所有文章

2025/03/02

修正 Ubuntu 24.04 systemd-networkd-wait-online 導致開機過慢問題

 輸入下方指令


sudo systemctl edit systemctl-networkd-wait-online.service
# 再ExecStart=/usr/lib/systemd/systemd-networkd-wait-online 加入--timeout=15
sudo systemctl daemon-reload


參考資料:

https://www.reddit.com/r/Ubuntu/comments/16xi5h0/how_do_i_fix_systemdnetworkdwaitonlineservice/

2025/02/26

打造自建 GitHub Actions 2.322 環境:在 Windows 11 設置 Self-Hosted Runner 並建置.Net Core專案

Windows 相較於 macOS 和 Linux 設置較為繁瑣
在 Windows 上設定 GitHub Actions Runner 需要額外的權限與步驟。請先 以管理員身份 開啟 PowerShell,然後執行以下指令:
下載並安裝 GitHub Actions Runner
# 回到 C:\
cd ..\..\

# 創建一個文件夾
mkdir actions-runner; cd actions-runner

# 下載最新的runner包
Invoke-WebRequest -Uri https://github.com/actions/runner/releases/download/v2.322.0/actions-runner-win-x64-2.322.0.zip -OutFile actions-runner-win-x64-2.322.0.zip

# 可選:驗證哈希值
if((Get-FileHash -Path actions-runner-win-x64-2.322.0.zip -Algorithm SHA256).Hash.ToUpper() -ne 'ace5de018c88492ca80a2323af53ff3f43d2c82741853efb302928f250516015'.ToUpper()){ throw 'Computed checksum did not match' }

# 解壓安裝程序
Add-Type -AssemblyName System.IO.Compression.FileSystem ; [System.IO.Compression.ZipFile]::ExtractToDirectory("$PWD/actions-runner-win-x64-2.322.0.zip", "$PWD")

# 配置 GitHub Actions runner
# 接著填入需要配置的設定即可
./config.cmd --url https://github.com/YourOrganization --token yourToken

MSB4276: The default SDK resolver failed to resolve SDK "Microsoft.NET.Sdk" because directory did not exist

因環境變數缺少MSBuildSDKsPath
MSBuildSDKsPath=C:\Program Files\dotnet\sdk\8.0.406\Sdks

參考資料:

Windows 11 免帳號登入

到安裝畫面時按下「Shift+F10」輸入
OOBE\BYPASSNRO

2024/09/18

透過Eeupdate修改Intel Mac Address

  1. 先透過Rufus燒錄一隻MS-DOS的USB
  2. 接著下載Eeupdate將其解壓縮出來後放在剛燒錄好的usb內
  3. 將USB放入要修改的電腦上,進入BIOS確保能讀取到非UEFI開機磁區,並透過該磁區開機
  4. 開機後輸入以下命令
cd EE
# 先執行看是否有讀取到Intel網路卡
Eeupdate
# 有的話在執行下列指令,舉例:要改為00:11:22:33:44:55
EEUPDATE -NIC=1 -MAC=001122334455

修改完重開機即可生效

2024/09/02

Kubernetes x509 certificate signed by unknown authority- Kubernetes

可能是因為root缺少配置,或者是因為當前配置是舊的關係,用root輸入以下指令即可
rm -rd ~/.kube
mkdir -p ~/.kube
cp -i /etc/kubernetes/admin.conf ~/.kube/config
echo "export KUBECONFIG=/etc/kubernetes/admin.conf" >> ~/.bash_profile
source ~/.bash_profile

Kubernetes error execution phase preflight: [preflight] Some fatal errors occurred

如果你的錯誤跟我下方差不多,可以試試看這樣解決
error execution phase preflight: [preflight] Some fatal errors occurred:
    [ERROR Port-6443]: Port 6443 is in use
    [ERROR Port-10251]: Port 10251 is in use
    [ERROR Port-10252]: Port 10252 is in use
    [ERROR FileAvailable--etc-kubernetes-manifests-kube-apiserver.yaml]: /etc/kubernetes/manifests/kube-apiserver.yaml already exists
    [ERROR FileAvailable--etc-kubernetes-manifests-kube-controller-manager.yaml]: /etc/kubernetes/manifests/kube-controller-manager.yaml already exists
    [ERROR FileAvailable--etc-kubernetes-manifests-kube-scheduler.yaml]: /etc/kubernetes/manifests/kube-scheduler.yaml already exists
    [ERROR FileAvailable--etc-kubernetes-manifests-etcd.yaml]: /etc/kubernetes/manifests/etcd.yaml already exists
    [ERROR Port-10250]: Port 10250 is in use
    [ERROR Port-2379]: Port 2379 is in use
    [ERROR Port-2380]: Port 2380 is in use
    [ERROR DirAvailable--var-lib-etcd]: /var/lib/etcd is not empty

解決 The connection to the server localhost:8080 was refused - did you specify the right host or port?

如果是Slave出錯可以嘗試以下方式: Master Node:將配置檔案複製到Slave Node
scp /etc/kubernetes/admin.conf accountName@IPOrDNS:/etc/kubernetes/admin.conf

Slave Node:
mkdir -p $HOME/.kube
sudo cp -i /etc/kubernetes/admin.conf $HOME/.kube/config
sudo chown $(id -u):$(id -g) $HOME/.kube/config
sudo mkdir -p /root/.kube
sudo cp -i /etc/kubernetes/admin.conf /root/.kube/config
echo "export KUBECONFIG=/etc/kubernetes/admin.conf" >> /root/.bash_profile
echo "export KUBECONFIG=/etc/kubernetes/admin.conf" >> ~/.bash_profile
source ~/.bash_profile

解決 Ubuntu 啟動失敗:手動執行 fsck 修復檔案系統



輸入下方指令即可
fsck /dev/mapper/ubuntu--vg-ubuntu--lv -y

2023/10/05

nvm ERROR open \settings.txt: The system cannot find the file specified.

發生這個問題大概是因為環境變數被不知道什麼軟體修改到了

至環境變數/系統變數加入「NVM_HOME」以及「NVM_SYMLINK」


NVM_HOME路徑為:
C:\Users\username\AppData\Roaming\nvm


2023/09/25

CloudFlare CDN 導致Vue網頁不會更新問題

最近在公司遇到很無奈的問題

用npm run build出來的檔案會Cache在某個版本
用npm run serve則不會

2023/09/16

加入Kubernetes Cluster 卡住 [preflight] Running pre-flight checks

是Token過期了,重新透過Master Node產生即可
#重新產生Token
kubeadm token create --ttl 24h --print-join-command
#刪除Token
kubeadm token delete tokenxxxxxx

2023/09/15

Disable Vue 3.x ESLint

再Package.json的eslintConfig加入下方的配置
    "ignorePatterns": [
      "src/*"
    ]

2023/09/10