vault backup: 2024-01-11 20:42:16
This commit is contained in:
6
.obsidian/workspace.json
vendored
6
.obsidian/workspace.json
vendored
@@ -43,9 +43,9 @@
|
|||||||
"state": {
|
"state": {
|
||||||
"file": "00. Inbox/樹莓派.canvas",
|
"file": "00. Inbox/樹莓派.canvas",
|
||||||
"viewState": {
|
"viewState": {
|
||||||
"x": 86.357177734375,
|
"x": 185.30005424431187,
|
||||||
"y": 272.6786193847656,
|
"y": 718.2152005479293,
|
||||||
"zoom": 0
|
"zoom": -0.5833333333333334
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,7 +3,8 @@
|
|||||||
{"id":"2379c5036a2ef1af","type":"text","text":"# 設定\n## 更新\n1. `sudo apt update`\n2. `sudo apt upgrade -y`\n\n## `raspi-config`\n1. 打開ssh與vnc\n2. 開機進入console","x":-60,"y":-135,"width":371,"height":315},
|
{"id":"2379c5036a2ef1af","type":"text","text":"# 設定\n## 更新\n1. `sudo apt update`\n2. `sudo apt upgrade -y`\n\n## `raspi-config`\n1. 打開ssh與vnc\n2. 開機進入console","x":-60,"y":-135,"width":371,"height":315},
|
||||||
{"id":"e5bba63eeea5211f","type":"text","text":"# 安裝\n1. 到[官網](https://www.raspberrypi.com/software/)下載`imager`\n2. 記得在`imager`裡面設定ssh public key","x":-440,"y":-47,"width":340,"height":140},
|
{"id":"e5bba63eeea5211f","type":"text","text":"# 安裝\n1. 到[官網](https://www.raspberrypi.com/software/)下載`imager`\n2. 記得在`imager`裡面設定ssh public key","x":-440,"y":-47,"width":340,"height":140},
|
||||||
{"id":"3a39140e3c8408cf","type":"text","text":"## 設定 static IP\n1. `sudo vim /etc/dhcpcd.conf`\n2. 填入\n```\ninterface wlan0\nstatic ip_address=192.168.1.21/24\nstatic routers=192.168.1.1\nstatic domain_name_servers=168.95.192.1\n```\n3. reboot","x":-60,"y":200,"width":371,"height":280},
|
{"id":"3a39140e3c8408cf","type":"text","text":"## 設定 static IP\n1. `sudo vim /etc/dhcpcd.conf`\n2. 填入\n```\ninterface wlan0\nstatic ip_address=192.168.1.21/24\nstatic routers=192.168.1.1\nstatic domain_name_servers=168.95.192.1\n```\n3. reboot","x":-60,"y":200,"width":371,"height":280},
|
||||||
{"id":"48eb138daa4f0fbe","x":-60,"y":500,"width":371,"height":100,"type":"text","text":"## 安裝必須的工具\n1. `sudo apt install dnsutils`"}
|
{"id":"48eb138daa4f0fbe","x":-60,"y":500,"width":371,"height":100,"type":"text","text":"## 安裝必須的工具\n1. `sudo apt install dnsutils`"},
|
||||||
|
{"id":"6ad2c15172b3b925","x":-60,"y":620,"width":931,"height":423,"type":"text","text":"## 設定 DDNS of Cloudflare\n`~/script/ddns.sh`\n```bash\n#!/bin/bash\nCF_ACCESS_TOKEN=<API_TOKEN>\nCF_ZONE_ID=<ZONE_ID>\nURLS=('awin.one'\n 'blog.awin.one'\n 'ftp.awin.one'\n 'git.awin.one',\n 'storj.awin.one')\nCF_RECORD_IDS=('RECORD_ID_FOR_awin.one'\n 'RECORD_ID_FOR_blog.awin.one'\n 'RECORD_ID_FOR_ftp.awin.one'\n 'RECORD_ID_FOR_git.awin.one'\n 'RECORD_ID_FOR_storj.awin.one')\n\nINTERNET_IP=`curl -s http://ipv4.icanhazip.com`\nINTERFACE_IP=`ip address show ppp0 | grep ppp0 | grep global | awk '{print$2}'`\nDNS_RECORD_IP=`dig +short \"${URLS[0]}\" | grep -Eo '([0-9]{1,3}\\.){3}[0-9]{1,3}' | awk 'NR==1{print}'`\n\nif [ \"$INTERNET_IP\" != \"$DNS_RECORD_IP\" ]\nthen\n echo \"Renew IP: ${DNS_RECORD_IP} to ${INTERNET_IP}\"\n for ((i = 0; i < ${#URLS[@]}; i++)); do\n curl -X PUT \"https://api.cloudflare.com/client/v4/zones/${CF_ZONE_ID}/dns_records/${CF_RECORD_IDS[$i]}\" \\\n -H \"Authorization: Bearer ${CF_ACCESS_TOKEN}\" \\\n -H \"Content-Type: application/json\" \\\n --data '{\"type\":\"A\",\"name\":\"'${URLS[$i]}'\",\"content\":\"'${INTERNET_IP}'\",\"ttl\":120,\"proxied\":false}'\n done\nelse\n echo \"No change: ${INTERNET_IP}\"\nfi\n```\n\n### 參考\n- [5 分鐘整合 Cloudflare API 實做 Cloudflare DDNS 動態 IP 對應網址](https://blog.toright.com/posts/7333/cloudflare-ddns)\n- [自架 DDNS 教學:用 Cloudflare API 達成多域名同步更新! | by Rex | Medium](https://blog.rexyuan.com/%E7%94%A8-cloudflare-dns-api-%E4%BE%86%E9%81%94%E6%88%90-ddns-adaee3c5a84d)"}
|
||||||
],
|
],
|
||||||
"edges":[
|
"edges":[
|
||||||
{"id":"f01be3b2d50be1dd","fromNode":"2379c5036a2ef1af","fromSide":"bottom","toNode":"3a39140e3c8408cf","toSide":"top"},
|
{"id":"f01be3b2d50be1dd","fromNode":"2379c5036a2ef1af","fromSide":"bottom","toNode":"3a39140e3c8408cf","toSide":"top"},
|
||||||
|
|||||||
Reference in New Issue
Block a user