首先要將 UAC 關掉
2022年11月25日 星期五
2022年11月8日 星期二
在 RPi 上用 TinyCore 建立一個簡單的 sftp server
TinyCore 的好處是, 系統跑起來之後, 都在 RAM 中,
所以不會一直存取 MicroSD or USB flash drive, 以免固定讀取
同樣的地方造成 NAND 壽命出問題.
TinyCore 的網站在 http://www.tinycorelinux.net/
建立 server 的步驟有 :
1. create TinyCore system on MicroSD card :
先從 TinyCore 網站下載 RPi 的 image, RPi 只有一種選擇,
不像 x86 有三種 image 選擇.
下載的 piCore-xx-x-x.zip 反解壓成 .img 檔案後,
用 dd 或者 rufus 將 image 寫到 MicroSD card 上.
2. create extra storage space :
將做好的 microSD card 在 RPi 上開機後, login : rc, passwd : piCore
接下來用 fdisk 看系統的分割 :
Disk /dev/mmcblk0: 59 GB, 63218647040 bytes, 123473920 sectors
1929280 cylinders, 4 heads, 16 sectors/track
Units: sectors of 1 * 512 = 512 bytes
Device Boot StartCHS EndCHS StartLBA EndLBA Sectors Size Id Type
/dev/mmcblk0p1 128,0,1 127,3,16 8192 139263 131072 64.0M c Win95 FAT32 (LBA)
/dev/mmcblk0p2 128,0,1 639,3,16 139264 172031 32768 16.0M 83 Linux
ChrootDirectory /home/newuser
ForceCommand internal-sftp
AllowTcpForwarding no#!/bin/sh # If you are booting Tiny Core from a very fast storage such as SSD / NVMe Drive and getting # "ifconfig: SIOCSIFADDR: No such Device" or "route: SIOCADDRT: Network is unreachable" # error during system boot, use this sleep statemet, otherwise you can remove it - sleep .2 # kill dhcp client for eth0 sleep 1 if [ -f /var/run/udhcpc.eth0.pid ]; then kill `cat /var/run/udhcpc.eth0.pid` sleep 0.1 fi # configure interface eth0 ifconfig eth0 192.168.0.1 netmask 255.255.255.0 broadcast 192.168.0.255 up route add default gw 192.168.0.254
echo nameserver 192.168.0.254 > /etc/resolv.conf
iptables -A INPUT -p tcp -s localhost -m tcp -m multiport ! --dports 22,80 -j ACCEPT
iptables -A INPUT -p tcp -m tcp -m multiport ! --dports 22,80 -j DROP
#!/bin/sh
# Block all incoming/outgoing traffic except for ssh
iptables -Z # zero counters
iptables -F # flush (delete) rules
iptables -X # delete all extra chains
# Set default filter policy to DROP
iptables -P INPUT DROP
iptables -P OUTPUT DROP
iptables -P FORWARD DROP
# Allow DNS
#iptables -A INPUT --proto udp --sport 53 --jump ACCEPT
#iptables -A OUTPUT --proto udp --dport 53 --jump ACCEPT
#iptables -A OUTPUT --proto tcp --dport 53 --jump ACCEPT
# Allow unlimited traffic on loopback (localhost)
iptables -A INPUT -i lo -j ACCEPT
iptables -A OUTPUT -o lo -j ACCEPT
# Allow ssh (22)
iptables -A INPUT -p tcp -m multiport --dports 22 -j ACCEPT
# Continue accepting packets after connection is established (and moved to some random >1024 port)
iptables -A INPUT --match state --state ESTABLISHED,RELATED -j ACCEPT
iptables -A OUTPUT --match state --state ESTABLISHED,RELATED -j ACCEPT2022年9月19日 星期一
QNAP TR-004 使用心得
QNAP TR-004 DAS 裡面用的是 JMicron chip,
使用心得 :
- 用 software configure 與直接 DIP SW 的 hardware RAID configure 基本上相同作用, 用 hardware RAID 只是將固定的 configuration 寫入吧, software configuration 可以透過軟體, 去設定比較不同的形態(例如兩台, 兩台 各組成 RAID1)
- 切換 RAID mode 時, 要切換 DIP SW 到 independent mode, 按 SET button, 之後切換到想要的 RAID mode DIP SW 後, 再按一次 SET button, 猜測應該是藉由切換到 independent mode 時, 會將 RAID mode 的資料洗掉
- 切換新的 RAID 5 mode 之後, 機器應該需要好幾天建立 RAID 5 checksum 機制, 所以在做好之前, 硬碟會一直動作(硬碟燈幾秒會閃一下或兩下). 在做完之前, 如果傳輸資料到 RAID, 速度大概只有 50MB/sec 左右. 目前等 RAID5 checksum 做完後, 再測看看速度是否可以上到 100MB/sec
- 結果應該不是 RAID5 本身需要建立的問題, 應該是傳輸檔案如果都只有 100MB 或不到, 算是小檔案傳輸, 速度就會在 40-80MB/sec 之間, 要傳好幾 GB 的情況, 速度才會有 100MB/sec 已上.
2021年12月12日 星期日
Denon 與一些擴大機品牌無法再接收 internet radio 問題
根據網路上的訊息,
一些擴大機的 internet radio 應該都是使用 vtune 的服務,
由 vtune 提供一堆整理過的 internet radio 的列表/搜尋,
但是 vtune 後來決定將服務變成要收費,
所以一堆擴大機的 internet radio 都變空了.
所以只要找到一個方式完全取代 vtune 的內容,
就可以讓原來的 internet radio 部分重生.
其中一個方式就是用 ycast
https://pypi.org/project/ycast/
可以在 raspberry pi 上灌 ycast 之後,
並且提供 DNS redirect 的方法,
將原本讀取 *.vtune.com 的 DNS 動作,
都導到 raspberry pi 上
- Yamaha AVRs:
radioyamaha.vtuner.com(and optionallyradioyamaha2.vtuner.com) - Onkyo AVRs:
onkyo.vtuner.com(and optionallyonkyo2.vtuner.com) - Denon/Marantz AVRs:
denon.vtuner.com(and optionallydenon2.vtuner.com) - Grundig radios:
grundig.vtuner.com,grundig.radiosetup.com(and optionallygrundig2.vtuner.comandgrundig2.radiosetup.com)
再將擴大機的網路設定, 把 DNS server 指向 redirect 的機器
2021年11月23日 星期二
XBOX original remote on OSMC issue
最主要的問題在於, 最新的 OSMC 19 做的一些改變 :
(1). 換成用 gpio-ir-recv 及 gpio-ir-tx
(2). lircd 的參數(原本從 hardware.conf 或 lirc_option.conf 指定)
要將 driver 從 devinput 換成 default
(1) 造成的影響, 會造成在 /boot/config.txt(或 config-user.txt) 中
dtoverlay=lirc-rpi,... 的修改, 變成
dtoverlay=gpio-ir,...
而這部分直接在 OSMC config->RPI config->hardware 中
可以透過 UI 就可以修改
(2) 造成的影響, 原本使用 raw 方式操作的程式,
例如 mode2 或 irrecord, 收到的資料方式不同.
所以如果用 devinput, 應該就是針對現成的格式 decode,
例如 rc-5, 如果用 default, 就是用 raw timing. 因為
xbox original remote 不是用標準格式可以解, 一定要走
raw timing 方式, 不然就要搭配原本 xbox 的 IR 接收器,
走 USB 進 RPi.
有關於 devinput 及 default driver 的差別, 可以參考
https://stackoverflow.com/questions/62646773/lirc-driver-option-default-vs-devinput
The devinput driver uses the kernel decoder, and feeds these decoded events to the lircd fifo. This fifo is what clients read from.
The default driver reads raw timing data from the kernel and makes it's own decoding using lircd.conf.
In general, if the devinput driver works it could safely be used and is a simpler setup. The default driver is useful in contexts where the kernel decoding doesn't work for example when a remote isn't supported by the kernel or there is a need to send (blast) ir signals -- the latter cannot be done using the devinput driver.
Xbox original remote 的 config 檔, 可以參考
https://forum.libreelec.tv/thread/12272-xbox-original-remote-on-kodi-leia-problems-to-create-keytable-no-events/
2021年4月6日 星期二
DVDStyler 無法 build 出 image 的問題
問題描述 :
如果檔名有中文, 不管在 Win10 or Win7 下,
都會導致 build image 時, 呼叫 ffmpeg-vbr.bat 時有一些 error,
產生不了 vob, 因此無法產生最終 image.
解決方法:
編輯 ffmpeg-vbr.bat, 在檔案第一行加入
chcp 65001
原因解釋 :
直接開啟 MS-DOS 視窗, 內定的編碼(code page)
通常不是 ANSI, 就是 65000,
但是 DVDStyler 傳入的非 ANSI 字元, 為 UTF-8,
所以要將 code page 改為 65001(UTF-8),
這樣 ffmpeg-vbr 接到的路徑字串才正確.
2019年12月25日 星期三
compress DVD into 60fps mp4 file
The key point to the whole process is :
- if you feed VOB into aviutl, it will not have audio output(using DVD2AVI to overcome)
- if you feed VOB directly in MeGUI, there is no way to do 60fps conversion(using aviutl to do it)
- if you feed VOB directly to MeGUI, File Indexer will parse the chapter information, and let you choose only a part of video to convert
- there is no way to re-capsulize the output of aviutl for MeGUI. VFAPI can generate to capsulized AVI but it cannot be read by MeGUI. That's why we use UT video codec to generate loseless real AVI files for MeGUI.
- DVD 720x480 is not 1:1 aspect ratio. We must enable advanced options in MeGUI config to assign 10:11 to correct the aspect ratio.





