--
預設帳號、密碼
root
dietpi
--
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
───────────────────────────────────────────────────── DietPi v7.3.2 : 08:25 - Tue 07/13/21 ───────────────────────────────────────────────────── - Device model : NanoPi NEO (armv7l) - CPU temp : 42'C : 107'F (Optimal temperature) - LAN IP : 172.16.1.149 (eth0) - MOTD : DietPi v7.3 has been released: https://dietpi.com/docs/releases/ ───────────────────────────────────────────────────── DietPi Team : MichaIng (lead), Daniel Knight (founder), Joulinar (support) Image by : DietPi Core Team (pre-image: Armbian) Web : https://dietpi.com | https://twitter.com/DietPi_ Patreon Legends : Camry2731 Contribute : https://dietpi.com/contribute.html DietPi Hosting : Powered by https://myvirtualserver.com dietpi-launcher : All the DietPi programs in one place. dietpi-config : Feature rich configuration tool for your device. dietpi-software : Select optimized software for installation. htop : Resource monitor. cpu : Shows CPU information and stats. root@DietPi:~# |
--
vi
1 |
# apt install vim |
--
https://apt.armbian.com buster Release Redirection from https to
1 2 |
# vi /etc/apt/sources.list.d/armbian.list deb http://apt.armbian.com/ buster main |
將 https:// 改成 http://
都會指向大陸學校網站,不知道是否台灣沒有 armbian 鏡射網站,至少 Google 過是沒有
--
SSH
預設使用 Dropbear,如要使用 sftp 就要改回 OpenSSH
dietpi-software → SSH Server
--
DietPi 7.6 UART 無法開啟
1 |
# vi /boot/armbianEnv.txt |
修改 overlays 增加 uart1,以及增加 uart1 的設定
1 |
overlays=usbhost1 usbhost2 uart1 |
編輯完成後重新啟動,使用 echo "a" > /dev/ttyS1 應該就可以正常執行
--
UART
硬體記得開啟,服務全部關閉
dietpi-config → 4 : Advanced Options → Serial/UART
--
route, ifconfig command not found
1 |
# apt-get install net-tools |
--
關閉開機 NTP
dietpi-config → 4 : Advanced Options → Time sync mode : [Custom]
--
--
Python3 & pip3
1 |
# apt install python3 |
預設安裝版本為 3.7
1 2 3 |
# apt install python3-distutils python3-apt # wget --no-check-certificate https://bootstrap.pypa.io/get-pip.py # python3 get-pip.py |
--
Python 3.9
1 2 3 4 5 6 7 8 |
# apt update # apt install build-essential zlib1g-dev libncurses5-dev libgdbm-dev libnss3-dev libssl-dev libsqlite3-dev libreadline-dev libffi-dev curl libbz2-dev # curl -O https://www.python.org/ftp/python/3.9.6/Python-3.9.6.tar.xz # tar -xf Python-3.9.6.tar.xz Python-3.9.6/ # cd Python-3.9.6/ # ./configure --enable-optimizations # make -j 4 # make altinstall |
1 |
WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv |
pip3
1 |
# python3.9 -m pip install pip |
--
磁碟情況紀錄
1 2 3 4 5 6 7 8 9 10 |
g# df -h Filesystem Size Used Avail Use% Mounted on udev 189M 0 189M 0% /dev tmpfs 50M 1.6M 48M 4% /run /dev/mmcblk0p1 15G 2.6G 12G 19% / tmpfs 246M 0 246M 0% /dev/shm tmpfs 5.0M 0 5.0M 0% /run/lock tmpfs 246M 0 246M 0% /sys/fs/cgroup tmpfs 50M 0 50M 0% /var/log tmpfs 1.0G 520K 1.0G 1% /tmp |
--
SD 瘦身
1 2 |
# wget https://raw.githubusercontent.com/Drewsif/PiShrink/master/pishrink.sh # chmod +x pishrink.sh |
1 |
# dd if=SBS_A01.1.img of=/dev/mmcblk0 status=progress |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
# ./pishrink.sh dietpi.img pishrink.sh v0.1.2 pishrink.sh: Gathering data ... pishrink.sh: Checking filesystem ... /dev/loop1: 40925/1418480 files (0.7% non-contiguous), 777985/3888512 blocks resize2fs 1.45.5 (07-Jan-2020) pishrink.sh: Shrinking filesystem ... resize2fs 1.45.5 (07-Jan-2020) Resizing the filesystem on /dev/loop1 to 1107406 (4k) blocks. Begin pass 2 (max = 43386) Relocating blocks XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX Begin pass 3 (max = 119) Scanning inode table XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX The filesystem on /dev/loop1 is now 1107406 (4k) blocks long. pishrink.sh: Shrinking image ... pishrink.sh: Shrunk dietpi.img from 15G to 4.3G ... |
啟動恢復最大空間
1 |
# systemctl restart dietpi-fs_partition_resize.service |
--
3,502 total views, 1 views today