vault backup: 2022-09-26 18:39:43
Affected files: .obsidian/workspace 03. 資料收集/HTTP Server/Nginx.md 03. 資料收集/Hobby/RC.md 03. 資料收集/Hobby/模型/Traxxas Sledge.md 03. 資料收集/Hobby/模型/舊化作例.md 03. 資料收集/Hobby/軍武/虎式.md 03. 資料收集/Programming/COM/20210726 - COM Interface.md 03. 資料收集/Programming/DB/MySQL.md 03. 資料收集/Programming/DB/sqlite.md 03. 資料收集/Programming/Design Pattern.md 03. 資料收集/Programming/FFMPEG/00. Introduction.md 03. 資料收集/Programming/FFMPEG/01. Setup.md 03. 資料收集/Programming/FFMpeg.md 03. 資料收集/Programming/Flask.md 03. 資料收集/Programming/Media Foundation/20210604 - Windows media foundation.md 03. 資料收集/Programming/OpenCV.md 03. 資料收集/Programming/OpenGL.md 03. 資料收集/Programming/Python/argparse.ArgumentParser.md 03. 資料收集/Programming/Python/decorator.md 03. 資料收集/Programming/Python/logging.md 03. 資料收集/Programming/Python/opencv.md 03. 資料收集/Programming/Python/subprocess.md 03. 資料收集/Programming/Python/threading.md 03. 資料收集/Programming/Python/tkinter.md 03. 資料收集/Programming/Python/檢測工具.md 03. 資料收集/Programming/QT/Dropdown button.md 03. 資料收集/Programming/QT/QVariant.md 03. 資料收集/Programming/QT/Qt.md 03. 資料收集/Programming/Qt.md 03. 資料收集/Programming/UML.md 03. 資料收集/Programming/演算法.md 03. 資料收集/架站/03. Trojan.md 03. 資料收集/架站/Gitea.md 03. 資料收集/架站/HTTP Server/Apache.md 03. 資料收集/架站/HTTP Server/Nginx/Reverse Proxy(Layer4).md 03. 資料收集/架站/Pelican blog.md 03. 資料收集/架站/Proxmox VE.md 03. 資料收集/架站/SWAG Reverse proxy.md 03. 資料收集/架站/Storj.md 03. 資料收集/架站/Trojan.md 03. 資料收集/科技/802.11.md 03. 資料收集/科技/HDR Sensor.md 03. 資料收集/科技/量子電腦.md 03. 資料收集/科技/鋰電池.md 03. 資料收集/軟體工具/IPFS.md 03. 資料收集/軟體工具/MkDocs.md 03. 資料收集/軟體工具/Obsidian.md 03. 資料收集/軟體工具/docker.md 03. 資料收集/軟體工具/git/apply.md 03. 資料收集/軟體工具/git/submodule.md
This commit is contained in:
@@ -1,14 +0,0 @@
|
||||
## 準備
|
||||
### 安裝Maria DB
|
||||
|
||||
|
||||
## 1. 下載trojan安裝檔
|
||||
```
|
||||
wget https://raw.githubusercontent.com/Jrohy/trojan/master/install.sh
|
||||
```
|
||||
|
||||
## 參考
|
||||
- [Trojan史上最全面的脚本!Trojan所有脚本集合! - 简书](https://www.jianshu.com/p/bb14fc75292d)
|
||||
- [VPS 初体验(三)在 VPS 上快速搭建 trojan 服务 - Kiku 的个人博客](https://kiku.vip/2021/10/16/%E5%9C%A8%20VPS%20%E5%BF%AB%E9%80%9F%E6%90%AD%E5%BB%BA%20trojan%20%E6%9C%8D%E5%8A%A1/)
|
||||
- [mku228/trojan: 科学上网/翻墙梯子/自由上网/trojan 搭建教程 免费机场、VPN工具 小白科学上网一键搭建VPN梯子最新2022教程](https://github.com/mku228/trojan)
|
||||
- [Jrohy/trojan: trojan多用户管理部署程序, 支持web页面管理](https://github.com/Jrohy/trojan)
|
||||
108
03. 資料收集/架站/HTTP Server/Apache.md
Normal file
108
03. 資料收集/架站/HTTP Server/Apache.md
Normal file
@@ -0,0 +1,108 @@
|
||||
## Install
|
||||
```
|
||||
sudo apt update && sudo apt install apache2
|
||||
```
|
||||
|
||||
## 測試Apache
|
||||
```
|
||||
sudo service apache2 status
|
||||
```
|
||||
|
||||
## 設置虛擬主機(Virtual Hosts)
|
||||
假設要建立2個網站*test1.ui-code.com*與*test2.ui-code.com*
|
||||
|
||||
### 建立目錄並設置權限(Permissions)
|
||||
```
|
||||
sudo mkdir -p /var/www/test1.ui-code.com/public_html
|
||||
sudo mkdir -p /var/www/test2.ui-code.com/public_html
|
||||
sudo chmod -R 755 /var/www
|
||||
```
|
||||
|
||||
### 建立測試頁面
|
||||
#### 建立test1.ui-code.com的測試頁面
|
||||
```
|
||||
sudo nano /var/www/test1.ui-code.com/public_html/index.html
|
||||
```
|
||||
填入以下內容:
|
||||
```html
|
||||
<html>
|
||||
<head>
|
||||
<title>Welcome to test1.ui-code.com</title>
|
||||
</head>
|
||||
<body>
|
||||
<h1>Welcome to test1.ui-code.com</h2>
|
||||
</body>
|
||||
</html>
|
||||
```
|
||||
|
||||
#### 建立test2.ui-code.com的測試頁面
|
||||
```
|
||||
sudo nano /var/www/test2.ui-code.com/public_html/index.html
|
||||
```
|
||||
填入以下內容:
|
||||
```html
|
||||
<html>
|
||||
<head>
|
||||
<title>Welcome to test2.ui-code.com</title>
|
||||
</head>
|
||||
<body>
|
||||
<h1>Welcome to test2.ui-code.com</h2>
|
||||
</body>
|
||||
</html>
|
||||
```
|
||||
|
||||
### 建立虛擬主機文件(Virtual Host Files)
|
||||
虛擬主機文件位於 /etc/apache2/sites-available/ 中,其用於告訴 Apache 網頁伺服器如何響應(Respond )各種網域請求(Request)。
|
||||
讓我們為test1.ui-code.com 網域創建一個新的虛擬主機文件。
|
||||
```
|
||||
sudo nano /etc/apache2/sites-available/test1.ui-code.com.conf
|
||||
```
|
||||
|
||||
將以下內容貼上:
|
||||
```
|
||||
<VirtualHost *:80>
|
||||
ServerAdmin webmaster@test1.ui-code.com
|
||||
ServerName test1.ui-code.com
|
||||
ServerAlias www.test1.ui-code.com
|
||||
DocumentRoot /var/www/test1.ui-code.com/public_html
|
||||
ErrorLog ${APACHE_LOG_DIR}/error.log
|
||||
CustomLog ${APACHE_LOG_DIR}/access.log combined
|
||||
</VirtualHost>
|
||||
```
|
||||
|
||||
再來為test2.ui-code.com 網域創建一個新的虛擬主機文件。
|
||||
```
|
||||
sudo nano /etc/apache2/sites-available/test2.ui-code.com.conf
|
||||
```
|
||||
|
||||
將以下內容貼上:
|
||||
```
|
||||
<VirtualHost *:80>
|
||||
ServerAdmin webmaster@test2.ui-code.com
|
||||
ServerName test2.ui-code.com
|
||||
ServerAlias www.test2.ui-code.com
|
||||
DocumentRoot /var/www/test2.ui-code.com/public_html
|
||||
ErrorLog ${APACHE_LOG_DIR}/error.log
|
||||
CustomLog ${APACHE_LOG_DIR}/access.log combined
|
||||
</VirtualHost>
|
||||
```
|
||||
|
||||
### 啟用新的虛擬主機文件(Virtual Host Files)
|
||||
現在我們有兩個虛擬主機文件,我們需要使用 a2ensite 工具來啟用它們。
|
||||
```
|
||||
sudo a2ensite test1.ui-code.com
|
||||
sudo a2ensite test2.ui-code.com
|
||||
```
|
||||
|
||||
測試配置語法是否有錯誤。
|
||||
```
|
||||
apachectl configtest
|
||||
```
|
||||
|
||||
如果「Syntax OK」,重啟 Apache。
|
||||
```
|
||||
sudo systemctl reload apache2
|
||||
```
|
||||
|
||||
## 參考
|
||||
- [[教學][Ubuntu 架站] 在 Ubuntu 20.04 安裝 Apache 網頁伺服器,並架設多個網站(多網域) | 優程式](https://ui-code.com/archives/271)
|
||||
@@ -1,5 +1,5 @@
|
||||
## Reverse Proxy(Layer4)
|
||||
[[Reverse Proxy(Layer4)#Reverse Proxy]]所用的方法雖然可以反向代理多個網站,但是對於像是Trojan這種TLS不行被中斷的服務來說,會導致handshake失敗,所以需要用Nginx的stream來做Layer 4的轉發。
|
||||
一般的Reverse Proxy所用的方法雖然可以反向代理多個網站,但是對於像是Trojan這種TLS不行被中斷的服務來說,會導致handshake失敗,所以需要用Nginx的stream來做Layer 4的轉發。
|
||||
|
||||
### docker-compose.yaml
|
||||
需要先把`nginx.conf`與`mime.types`給copy到data目錄下。
|
||||
26
03. 資料收集/架站/Pelican blog.md
Normal file
26
03. 資料收集/架站/Pelican blog.md
Normal file
@@ -0,0 +1,26 @@
|
||||
## Create a site
|
||||
Use `pelican-quickstart` to create a new site.
|
||||
|
||||
## Plugin
|
||||
```bash
|
||||
git clone --recursive https://github.com/getpelican/pelican-plugins.git
|
||||
```
|
||||
|
||||
## Theme
|
||||
先把所有佈景主題都clone下來:
|
||||
```bash
|
||||
git clone --recursive https://github.com/getpelican/pelican-themes.git
|
||||
```
|
||||
|
||||
把`pelicanconf.py`裡面的`THEME`指向theme的目錄就可以換佈景主題了。例如要用[[blue-penguin](https://github.com/jody-frankowski/blue-penguin)]這一個主題。把`pelicanconf.py`裡面加入`THEME = 'pelican-themes/blue-penguin'`就可以了。
|
||||
|
||||
## 預覽
|
||||
```
|
||||
make html
|
||||
make serve
|
||||
```
|
||||
|
||||
參考:
|
||||
- [koko's Note – Python - 安裝 Pelican Theme 來改變你的靜態網站主題](https://note.koko.guru/install-pelican-theme.html)
|
||||
- [nest theme](https://github.com/molivier/nest)
|
||||
- [Flex theme](https://github.com/alexandrevicenzi/Flex/wiki/Custom-Settings)
|
||||
260
03. 資料收集/架站/Proxmox VE.md
Normal file
260
03. 資料收集/架站/Proxmox VE.md
Normal file
@@ -0,0 +1,260 @@
|
||||
# 安裝
|
||||
## 下載ISO
|
||||
- [Get the free Proxmox VE ISO installer](https://www.proxmox.com/en/downloads/category/iso-images-pve)
|
||||
|
||||
## 準備USB disk
|
||||
- 用[Rufus](https://rufus.ie/)的話
|
||||
1. 在遇到詢問是否要下載 Grub 時,請選擇「否」
|
||||
2. 必須使用DD mode來建立開機碟。(參考:[Prepare Installation Media - Proxmox VE](https://pve.proxmox.com/wiki/Prepare_Installation_Media#_instructions_for_windows))
|
||||
![[Pasted image 20210128212917.png]]
|
||||
|
||||
# 設定
|
||||
## 關閉「闔上螢幕後休眠」
|
||||
打開`/etc/systemd/logind.conf`:
|
||||
```
|
||||
nano /etc/systemd/logind.conf
|
||||
```
|
||||
找到下面兩行,把值改成ignore:
|
||||
```
|
||||
HandleLidSwitch=ignore
|
||||
HandleLidSwitchDocked=ignore
|
||||
```
|
||||
然後重開機:
|
||||
```
|
||||
systemctl restart systemd-logind.service
|
||||
```
|
||||
圖示:
|
||||
![[Pasted image 20210129194144.png]]
|
||||
|
||||
## 增加硬碟
|
||||
先用`lsblk`列出所有硬碟,這裡假設`sda`是我們的開機磁碟,我要要新增`sdb`:
|
||||
```
|
||||
root@pve:~# lsblk
|
||||
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
|
||||
sda 8:0 0 931.5G 0 disk <-- 目前在用的
|
||||
├─sda1 8:1 0 1007K 0 part
|
||||
├─sda2 8:2 0 512M 0 part
|
||||
└─sda3 8:3 0 931G 0 part
|
||||
sdb 8:16 0 111.8G 0 disk <-- 要新增的
|
||||
├─sdb1 8:17 0 100M 0 part
|
||||
├─sdb2 8:18 0 16M 0 part
|
||||
├─sdb3 8:19 0 111.1G 0 part
|
||||
└─sdb4 8:20 0 563M 0 part
|
||||
```
|
||||
|
||||
然後安裝`parted`,我們要用它來分割硬碟:
|
||||
```
|
||||
apt install parted
|
||||
```
|
||||
|
||||
開始分割:
|
||||
```
|
||||
parted /dev/sdb mklabel gpt
|
||||
```
|
||||
|
||||
建立primary partition,格式為`ext4`:
|
||||
```
|
||||
parted -a opt /dev/sdb mkpart primary ext4 0% 100%
|
||||
```
|
||||
|
||||
再來將分割好的硬碟格式化為`ext4`,label命名為`data2`:
|
||||
```
|
||||
mkfs.ext4 -L data2 /dev/sdb1
|
||||
```
|
||||
|
||||
再用`lsblk`看一次,會發現sdb已經重新分割成1個partition了:
|
||||
```
|
||||
root@pve:~# lsblk
|
||||
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
|
||||
sda 8:0 0 931.5G 0 disk
|
||||
├─sda1 8:1 0 1007K 0 part
|
||||
├─sda2 8:2 0 512M 0 part
|
||||
└─sda3 8:3 0 931G 0 part
|
||||
sdb 8:16 0 111.8G 0 disk
|
||||
└─sdb1 8:17 0 111.8G 0 part
|
||||
```
|
||||
|
||||
用`lsblk -fs`可以看到每一個硬碟的檔案系統格式:
|
||||
```
|
||||
root@pve:~# lsblk -fs
|
||||
NAME FSTYPE LABEL UUID FSAVAIL FSUSE% MOUNTPOINT
|
||||
sda1 zfs_member rpool 11775123664036754029
|
||||
└─sda zfs_member rpool 11775123664036754029
|
||||
sda2 vfat rpool 32D0-3449
|
||||
└─sda zfs_member rpool 11775123664036754029
|
||||
sda3 zfs_member rpool 11775123664036754029
|
||||
└─sda zfs_member rpool 11775123664036754029
|
||||
sdb1 ext4 data2 bc6d2c41-a3ca-4b0f-a5de-51ee28ae9cec <-- 剛剛分割的
|
||||
└─sdb
|
||||
```
|
||||
|
||||
接下來,將新硬碟掛載到檔案目錄上,先建立一個新目錄來掛載新硬碟:
|
||||
```shell
|
||||
mkdir -p /mnt/data
|
||||
```
|
||||
|
||||
接下來編輯`/etc/fstab`,將新硬碟寫進來,這樣開機之後才會自動把它掛載起來:
|
||||
```
|
||||
nano /etc/fstab
|
||||
```
|
||||
加入這一行(注意:**data2**要改成你自己的label):
|
||||
```
|
||||
LABEL=data2 /mnt/data ext4 defaults 0 2
|
||||
```
|
||||
|
||||
剛新硬碟掛起來:
|
||||
```
|
||||
mount -a
|
||||
```
|
||||
|
||||
用`df`就可以看到新硬碟了:
|
||||
```
|
||||
root@pve:~# df
|
||||
Filesystem 1K-blocks Used Available Use% Mounted on
|
||||
udev 16288892 0 16288892 0% /dev
|
||||
tmpfs 3262688 9324 3253364 1% /run
|
||||
rpool/ROOT/pve-1 942667136 1267584 941399552 1% /
|
||||
tmpfs 16313440 43680 16269760 1% /dev/shm
|
||||
tmpfs 5120 0 5120 0% /run/lock
|
||||
tmpfs 16313440 0 16313440 0% /sys/fs/cgroup
|
||||
rpool 941399680 128 941399552 1% /rpool
|
||||
rpool/data 941399680 128 941399552 1% /rpool/data
|
||||
rpool/ROOT 941399680 128 941399552 1% /rpool/ROOT
|
||||
/dev/fuse 30720 16 30704 1% /etc/pve
|
||||
tmpfs 3262688 0 3262688 0% /run/user/0
|
||||
/dev/sdb1 114854020 61464 108915208 1% /mnt/data <-- 新硬碟在這裡
|
||||
```
|
||||
|
||||
參考:
|
||||
- [How to add storage to Proxmox](https://nubcakes.net/index.php/2019/03/05/how-to-add-storage-to-proxmox/)
|
||||
|
||||
## 增加iSCSI磁碟
|
||||
### 增加需要CHAP認證的iSCSI磁碟
|
||||
1. 先確認找的到iSCSI磁碟
|
||||
```
|
||||
iscsiadm -m discovery -t st -p 192.168.1.11:3260
|
||||
```
|
||||
如果有找到的話會回傳一串IQN值,像是:
|
||||
```
|
||||
root@pve:~# iscsiadm -m discovery -t st -p 192.168.1.11:3260
|
||||
192.168.1.11:3260,1 iqn.2000-01.com.synology:DiskStation.Target-1.3e589efea3
|
||||
[fe80::211:32ff:fe20:eadd]:3260,1 iqn.2000-01.com.synology:DiskStation.Target-1.3e589efea3
|
||||
```
|
||||
2. 有IQN就可以用下列的命令連線與掛載:
|
||||
```
|
||||
iscsiadm -m node -T iqn.2000-01.com.synology:DiskStation.Target-1.3e589efea3 --op update --name node.session.auth.username --value=名字
|
||||
iscsiadm -m node -T iqn.2000-01.com.synology:DiskStation.Target-1.3e589efea3 --op update --name node.session.auth.password --value=密碼
|
||||
iscsiadm -m node -T iqn.2000-01.com.synology:DiskStation.Target-1.3e589efea3 -l #連線
|
||||
iscsiadm -m node -o update -n node.startup -v automatic #設定開機自動掛載
|
||||
```
|
||||
|
||||
## 增加NFS磁碟
|
||||
1. 先在Synology上開一個NFS disk,設定如下:
|
||||
![[Pasted image 20220506091522.png]]
|
||||
2. 再到Proxmox的 Datacenter->Storage->Add 來增加一個 *NFS*,設定如下
|
||||
![[Pasted image 20220506091624.png]]
|
||||
|
||||
### 更改NFS mount為soft
|
||||
1. 編輯`/etc/pve/storage.cfg`
|
||||
2. 做如下修改
|
||||
![[Pasted image 20220506095531.png]]
|
||||
|
||||
### 參考
|
||||
- [[經驗分享]Proxmox VE 採用 NFS 連接儲存的重點事項](http://blog.jason.tools/2019/02/pve-nfs-mount.html)
|
||||
|
||||
## 設定VM備份目錄
|
||||
如果將VM或LXC備份到某個目錄,先建立要備份的目錄:
|
||||
```shell
|
||||
mkdir -p /mnt/data/backup/
|
||||
```
|
||||
|
||||
再來用WEB UI,操作如下:
|
||||
![[Pasted image 20210129202041.png]]
|
||||
![[Pasted image 20210129202047.png]]
|
||||
|
||||
最後再到 Datacenter->Backups,建立一個scheule來備份就可以了:
|
||||
![[Pasted image 20210129202231.png]]
|
||||
|
||||
## 將資料備份到NAS
|
||||
1. 先在NAS開一個share folder跟一個帳號。
|
||||
![[Pasted image 20210202190402.png]]
|
||||
![[Pasted image 20210202190537.png]]
|
||||
2. Proxmox:到裡將剛剛新開的folder給掛載起來。
|
||||
![[Pasted image 20210202190640.png]]
|
||||
會跳出一個視窗,如下圖來填,記得**content**那一欄有4個要選。
|
||||
![[Pasted image 20210202190709.png]]
|
||||
3. Proxmox:到 Datacenter->Backup 新增一個排程。
|
||||
![[Pasted image 20210202190903.png]]
|
||||
一樣會跳出一個視窗,依需求來填,要注意的是**Storage**必須是前一步驟的**ID**,**Selection Mode**可以選擇**All**。
|
||||
![[Pasted image 20210202191150.png]]
|
||||
|
||||
參考:
|
||||
- [HASS + Proxmox: Automatic Backups to Synology NAS](https://kleypot.com/automatic-offline-backups/)
|
||||
|
||||
## 設定 UPS
|
||||
因為 UPS 的 USB 是連接在 NAS 上,所以Proxmox這邊必須要去monitor NAS那邊所回報的狀態,請確定NAS端有打開「啟用網路不斷電系統伺服器」。
|
||||
1. 安裝 nut:`apt-get install nut`
|
||||
2. 修改 `/etc/nut/nut.conf`,設定 `MODE=netclient`
|
||||
3. 修改 `/etc/nut/upsmon.conf`,加入一行:`MONITOR ups@<NAS_IP> 1 <NAS_Username> <NAS_UserPassword> slave`
|
||||
4. 開始 upsmon:`upsmon start`
|
||||
5. 用 `ps -ef | grep upsmon` 確認 upsmon是否執行:
|
||||
![[Pasted image 20220811145852.png|600]]
|
||||
6. 若正常,可以取回UPS的一些硬體資料,`upsc ups@<NAS_IP>`
|
||||
![[Pasted image 20220811150034.png|360]]
|
||||
|
||||
### 參考
|
||||
- [UPSMON(8)](https://networkupstools.org/docs/man/upsmon.html)
|
||||
- [不斷電系統 | DSM - Synology 知識中心](https://kb.synology.com/zh-tw/DSM/help/DSM/AdminCenter/system_hardware_ups?version=6)
|
||||
- [設定 Proxmox VE連動Synology的不斷電系統](https://cychien.tw/wordpress/2022/02/02/%E8%A8%AD%E5%AE%9A-proxmox-ve%E9%80%A3%E5%8B%95synology%E7%9A%84%E4%B8%8D%E6%96%B7%E9%9B%BB%E7%B3%BB%E7%B5%B1/)
|
||||
|
||||
## 更新
|
||||
### 加入更新來源
|
||||
編輯`/etc/apt/sources.list`,加入:
|
||||
```
|
||||
deb http://ftp.debian.org/debian bullseye main contrib
|
||||
deb http://ftp.debian.org/debian bullseye-updates main contrib
|
||||
|
||||
# PVE pve-no-subscription repository provided by proxmox.com,
|
||||
# NOT recommended for production use
|
||||
deb http://download.proxmox.com/debian/pve bullseye pve-no-subscription
|
||||
|
||||
# security updates
|
||||
deb http://security.debian.org/debian-security bullseye-security main contrib
|
||||
```
|
||||
|
||||
### 取消訂閱服務
|
||||
編輯`/etc/apt/sources.list.d/pve-enterprise.list`,把下面這行注釋掉:
|
||||
```
|
||||
deb https://enterprise.proxmox.com/debian/pve buster pve-enterprise
|
||||
```
|
||||
也就是變成:
|
||||
```
|
||||
#deb https://enterprise.proxmox.com/debian/pve buster pve-enterprise
|
||||
```
|
||||
|
||||
使用`apt update`來更新套件。
|
||||
使用`apt dist-upgrade`來升級系統版本。
|
||||
|
||||
## 重灌後要做的事情
|
||||
1. 建立ZFS pool。
|
||||
2. 確認S.M.A.R.T. 是否啟用,預設是啟用的。
|
||||
`smartctl -a /dev/<SDA_N>`
|
||||
1. 打開IOMMU
|
||||
2. 打開vm aware
|
||||
3. 增加NFS共享磁碟
|
||||
4. 排程備份
|
||||
5. 上傳安裝Windows需要的驅動ISO
|
||||
1. [Windows VirtIO Drivers](https://pve.proxmox.com/wiki/Windows_VirtIO_Drivers)
|
||||
6. 把常用的VM轉為template
|
||||
7. 安裝[Cockpit-Linux Server](https://pvecli.xuan2host.com/cockpit/), 讓您的PVE有更棒的圖形管理介面。
|
||||
|
||||
## 參考
|
||||
- [套件功能的更新(Proxmox update)](https://wiki.freedomstu.com/books/proxmox-ve-%E8%99%9B%E6%93%AC%E7%B3%BB%E7%B5%B1%E8%A8%98%E9%8C%84/page/%E5%A5%97%E4%BB%B6%E5%8A%9F%E8%83%BD%E7%9A%84%E6%9B%B4%E6%96%B0%EF%BC%88proxmox-update%EF%BC%89)
|
||||
- [裝完PVE後的11件必作清單 (中文翻譯)](https://www.youtube.com/watch?v=pY4Lm2Hoqik)
|
||||
- [Before I do anything on Proxmox, I do this first...](https://www.youtube.com/watch?v=GoZaMgEgrHw&t=0s)
|
||||
|
||||
# Trouble shooting
|
||||
- *Emergency mode*,表示開機失敗,請檢查`/etc/fstab`是不是有無法掛載的disk。
|
||||
|
||||
## 參考
|
||||
- [[Fix] Getting out of emergency mode : Proxmox](https://www.reddit.com/r/Proxmox/comments/hai75k/fix_getting_out_of_emergency_mode/)
|
||||
80
03. 資料收集/架站/Storj.md
Normal file
80
03. 資料收集/架站/Storj.md
Normal file
@@ -0,0 +1,80 @@
|
||||
# Documentation
|
||||
- [Introduction - Storj](https://documentation.storj.io/)
|
||||
|
||||
## Setup
|
||||
Pull image
|
||||
```shell
|
||||
sudo docker pull storjlabs/storagenode:latest
|
||||
```
|
||||
|
||||
Do this **once**.
|
||||
```shell
|
||||
sudo docker run --rm -e SETUP="true" \
|
||||
--mount type=bind,source="/volume1/homes/awin/Storj/key",destination=/app/identity \
|
||||
--mount type=bind,source="/volume1/docker/Storj/data",destination=/app/config \
|
||||
--name storagenode storjlabs/storagenode:latest
|
||||
```
|
||||
|
||||
## Run
|
||||
```shell
|
||||
sudo docker run -d --restart unless-stopped --stop-timeout 300 \
|
||||
-p 28967:28967 \
|
||||
-p 28967:28967/udp \
|
||||
-p 14002:14002 \
|
||||
-e WALLET="0x9Ce80345355Ad8C17991620E13d8423900CEDcd0" \
|
||||
-e EMAIL="awinhuang@gmail.com" \
|
||||
-e ADDRESS="awin.myds.me:28967" \
|
||||
-e STORAGE="2TB" \
|
||||
--mount type=bind,source="/volume1/homes/awin/Storj/key",destination=/app/identity \
|
||||
--mount type=bind,source="/volume1/docker/Storj/data",destination=/app/config \
|
||||
--name storagenode storjlabs/storagenode:latest
|
||||
```
|
||||
|
||||
## Update configuration
|
||||
### Linux
|
||||
1. Stop docker container
|
||||
```shell
|
||||
sudo docker stop -t 300 storagenode ;\
|
||||
sudo docker rm storagenode ;\
|
||||
sudo docker pull storjlabs/storagenode
|
||||
```
|
||||
2. Run docker again. Check [[Storj#Run]]. [^1]
|
||||
3. Or, create a task, and run below command:
|
||||
```shell
|
||||
echo "Stop storagenode" ;\
|
||||
sudo docker stop -t 300 storagenode ;\
|
||||
sudo docker rm storagenode ;\
|
||||
echo "Pull storagenode" ;\
|
||||
sudo docker pull storjlabs/storagenode ;\
|
||||
echo "Start storagenode" ;\
|
||||
sudo docker run -d --restart unless-stopped --stop-timeout 300 \
|
||||
-p 28967:28967 \
|
||||
-p 14002:14002 \
|
||||
-e WALLET="0x9Ce80345355Ad8C17991620E13d8423900CEDcd0" \
|
||||
-e EMAIL="awinhuang@gmail.com" \
|
||||
-e ADDRESS="awin.myds.me:28967" \
|
||||
-e STORAGE="2TB" \
|
||||
--mount type=bind,source="/volume1/homes/awin/Storj/key",destination=/app/identity \
|
||||
--mount type=bind,source="/volume1/docker/Storj/data",destination=/app/config \
|
||||
--name storagenode storjlabs/storagenode:latest ;\
|
||||
sudo docker ps -a
|
||||
```
|
||||
|
||||
## Start/Stop service
|
||||
### Windows
|
||||
#### Start service
|
||||
In PowerShell:
|
||||
```powershell
|
||||
Start-Service storagenode
|
||||
```
|
||||
|
||||
#### Stop service
|
||||
In PowerShell:
|
||||
```powershell
|
||||
Stop-Service storagenode
|
||||
```
|
||||
|
||||
[^2]
|
||||
|
||||
[^1]: [How do I change values like wallet address or storage capacity? - Storj](https://documentation.storj.io/resources/faq/how-do-i-change-my-parameters-such-as-payout-address-allotted-storage-space-and-bandwidth)
|
||||
[^2]: [How do I shutdown my node for system maintenance? - Storj](https://documentation.storj.io/resources/faq/system-maintenance)
|
||||
38
03. 資料收集/架站/Trojan.md
Normal file
38
03. 資料收集/架站/Trojan.md
Normal file
@@ -0,0 +1,38 @@
|
||||
## 準備
|
||||
1. 新增一台container,先更新container:
|
||||
```
|
||||
apt update ;\
|
||||
apu upgrade -y ;\
|
||||
apt install curl vim -y
|
||||
```
|
||||
2. 安裝trojan:
|
||||
```
|
||||
mkdir -p ~/trojan ;\
|
||||
cd ~/trojan
|
||||
curl -O https://raw.githubusercontent.com/atrandys/trojan/master/trojan_mult.sh ; chmod +x trojan_mult.sh ; ./trojan_mult.sh
|
||||
```
|
||||
3. 
|
||||
4. 
|
||||
5. 
|
||||
6. 
|
||||
|
||||
-----
|
||||
參考:
|
||||
1. [Trojan 上網架設(替代VPN)爬梯子 科學上網 利器 - TWIDC](https://lab.twidc.net/trojan-%E4%B8%8A%E7%B6%B2%E6%9E%B6%E7%BD%AE%E6%9B%BF%E4%BB%A3vpn/)
|
||||
2. [Trojan搭建私人VPN - Lingme](https://lingmin.me/2020/03/03/TrojanVPS/)
|
||||
3. [[转载+修改]使用Trojan-Go科学上网 - 996 RIP](https://typecho.996.rip/index.php/archives/20/)
|
||||
4. Source code: [Releases · trojan-gfw/trojan](https://github.com/trojan-gfw/trojan/releases)
|
||||
|
||||
## 更新憑證
|
||||
1. 更新acme:`acme.sh --upgrade`
|
||||
2. 先停止 trojan-web
|
||||
```bash
|
||||
systemctl stop trojan-web
|
||||
```
|
||||
3. 停止 trojan,如下圖
|
||||
![[Pasted image 20220815134750.png|500]]
|
||||
4. 切換到 `/root/.acme.sh`,執行 `./acme.sh --cron -f`,如果憑證更新成功,應該會看到類似如下訊息:
|
||||
![[Pasted image 20220815135026.png|800]]
|
||||
5. 重啟 trojan:
|
||||
![[Pasted image 20220815135248.png|400]]
|
||||
6. 重啟trojan-web:`systemctl start trojan-web`
|
||||
Reference in New Issue
Block a user