2020/01/15

Maintain ssh tunnel

Based on this: https://github.com/daradib/sidedoor

1. installation
sudo apt install sidedoor
2. create ssh public key and add to remote user ~/.ssh/authorized_keys
sudo ssh-keygen -t rsa -N '' -f /home/myaccount/id_rsa
cat /home/myaccount/id_rsa.pub | ssh myaccount@my.remote.server 'cat >> .ssh/authorized_keys'
3. modify /etc/sidedoor/config
Host my.remote.server
  # SSH private key to access the remote server.
  IdentityFile /home/myname/id_rsa

  # because I am using ddns, my IP might change, so I set it to no
  StrictHostKeyChecking no

  # SSH host key of the remote server.
  UserKnownHostsFile /dev/null

  # If tunneled traffic is encrypted (e.g., SSH),
  # it probably does not compress well.
  Compression no

  # Disable password authentication.
  BatchMode yes

  # Terminate if unable to set up port forwarding.
  ExitOnForwardFailure yes

  # Enable SSH keepalives.
  ServerAliveInterval 30

  # Disconnect after unresponsive SSH keepalives.
  ServerAliveCountMax 3

4. modify /etc/default/sidedoor
# Configuration for sidedoor service

# Arguments to pass to sidedoor, which are in turn passed to ssh.
# See man ssh for possible options.
# For example, uncomment the line below to create a remote port forward
# to the local SSH server (running on port 22, exposed on port 8022).
OPTIONS='-R 12345:localhost:9999'

# Remote SSH server to connect to, i.e., [user@]hostname.
REMOTE_SERVER=myaccount@my.remote.server

5. start up sidedoor service and check sidedoor status
sudo systemctl enable sidedoor.service
sudo systemctl restart sidedoor.service
systemctl status sidedoor.service

How to clean reinstall hassio ?

1. stop services
systemctl stop hassio-supervisor.service
systemctl stop hassio-apparmor.service

2. stop docker container
docker ps #list containers
docker container stop @containerid # remove @containerid with image name start with homeassistant
docker container prune # remove all stopped containers

3. remove docker images
docker images # list all images
docker image remove @imagename # remove @imangename start with homeassistant

4. remove data when install hassio.
# if you install like this 'hassio_install.sh -m raspberrypi3 -d /share/ha_data', remove all data in /share/ha_data
rm -rf /share/ha_data
rm -f /etc/systemd/system/hassio-*

Raspberry PI wifi mac 重啟後一直改變

想把 raspberry pi wifi 連線成固定某個 IP,
當設定好後發現每次重啟 raspberry pi wifi 的 mac 一直改變。

要修正這部份,可以新增一個檔案 "100-disable-wifi-mac-randomization.conf" 至 /etc/NetworkManager/conf.d
內容如下
[connection]
wifi.mac-address-randomization=1
 
[device]
wifi.scan-rand-mac-address=no
可透過以下指令確認 wifi mac 是否還有一直變動
sudo systemctl restart NetworkManager

2020/01/14

網站資料庫 v133

目前所有支援網站: https://goo.gl/jXLsJu

更新紀錄:
版本: 133 - 20200114
+ 新增 '起點' 登入支援
+ '輕小說文庫 [Wenku8]' 新增強制分頁功能
+ 新增 '鯉魚鄉 [腐書網]' 2020y 分類
- 調整 '新筆趣閣', '下書網', '黃金屋中文', '卡提諾小說網 [101novel]', '飛速中文網', '八零電子書' 使用網址
- 調整 '木子書屋' 朗讀問題
- 修正針對 android 4.4 機型載入問題
- 修正'豆豆小說閱讀網'簡介問題
- 再度修正 '全本小說網 [Quanben5]' 內文部份載入問題
- 修正 '4K 文學' 內文載入問題
- 修正 '中網文學' 搜尋問題
- 修正 '卡提諾小說網 [101novel]', '好看小說網' 載入問題
- 修正 'ESJZone' 部份內文載入問題
- 修正 'FC2' 解析以及部份內文載入問題
- 修正 '飛速中文網' 內文載入問題
- 修正 '繁體小說網', '耽美中文網' 搜尋問題

更新方式:
1. 手動更新
a) 設定的網站資料庫
b) 點擊下載
c) 下載檔案 "網站資料庫更新包x_v133.zip"
d) 設定的網站資料庫
e) 匯入

2. 自動更新
a) 設定的網站資料庫
b) 點擊版本

2020/01/12

Ssh port forwarding

操作之前記得先修改 sshd_config 加上
PermitTunnel yes # 允許做 ssh tunnel
GatewayPorts yes # 允許 remote port forwarding

Local Port forwarding (Local to Remote)
ssh -L 1234:192.168.1.1:80 user@example.com 
當使用帳號 user ssh 到 example.com 後,本地端的 port 1234 會對應到遠端 192.168.1.1 的 port 80。
當這個連線保持開啟時,開啟瀏覽器連線至 127.00.1:1234 則會變成連線到 192.168.1.1:80。

Remote Port Forwarding (Remote to Local)
ssh -R 1234:192.168.1.1:80 user@example.com 
當使用帳號 user ssh 到 example.com 後,遠端的 port 1234 會對應到 192.168.1.1 的 port 80。
(192.168.1.1 為本地端的 IP) 這表示當此連線保持開啟時,連線至 example.com:1234 都會直接導至本地端的 port 80。

2019/11/25

網站資料庫 v132

目前所有支援網站: https://goo.gl/jXLsJu

更新紀錄:
版本: 132 - 20191125
+ 新增 '小說娃', '新卡夜閣', '追書幫', '愛下電子書', '筆趣閣 [Biqubao]', '頂點小說 [230book]' 支援
+ 新增 '蛋文庫' 解析支援
- 修正 'ESJZone' 部份內文載入問題
- 修正 '全本小說網 [Quanben5]' 內文部份載入問題
- 修改 '鯉魚鄉 [腐書網]' 部份內文朗讀問題
- 修正 '縱橫小說網 - 女生站' 章節, 內文載入問題
- 修正 '鉛筆小說網' 小說清單問題
- 修正 '101 小說典藏網' 章節載入問題
- 修正 '木子書屋' 章節目錄問題
- 修正 '鉛筆小說網' 分類下一頁的問題

更新方式:
1. 手動更新
a) 設定的網站資料庫
b) 點擊下載
c) 下載檔案 "網站資料庫更新包x_v132.zip"
d) 設定的網站資料庫
e) 匯入

2. 自動更新
a) 設定的網站資料庫
b) 點擊版本

2019/10/25

輕鬆讀小說 v 5.4.4

v 5.4.4
+ 更新網站資料庫至 131
+ 支援解析密碼輸入的功能
+ 我的書櫃新增加入時間排序
BUGS
- 修正部份強制關閉的問題
- 修正閱讀文字檔時,沒網路下方一樣有黑條的問題
- 修正字體大小問題

Google Play: 輕鬆讀小說
========================
支援網站: https://goo.gl/jXLsJu
使用說明與教學: FAQ
更新紀錄: changelog
========================