安裝個人常用套件腳本
安裝文字編輯器,螢幕鍵盤 (預防萬一只有滑鼠)
#!/bin/bash
echo "[1/5] update system"
# update, upgrade
sudo apt-get update -y
sudo apt-get upgrade -y
sudo apt update -y
# code editor
echo "[2/5] installing code editor"
sudo apt install vim -y
sudo apt install code -y
# keyboards
echo "[3/5] installing keyboards..."
sudo apt install matchbox-keyboard -y
sudo apt install florence -y
sudo apt install onboard -y
# apt-get
echo "[4/5] installing apt-get opencv"
sudo apt-get install libcblas-dev -y
sudo apt-get install libhdf5-dev -y
sudo apt-get install libhdf5-serial-dev -y
sudo apt-get install libatlas-base-dev -y
sudo apt-get install libjasper-dev -y
sudo apt-get install libqtgui4 -y
sudo apt-get install libqt4-test -y
# pip
echo "[5/5] installing pip python-opencv"
pip3 install opencv-python
pip3 install -U numpy
Raspberry Pi 3 系統設定
開機設定檔 (可將 SD 插入其他電腦中進行設定)
sudo vim /boot/config.txt
系統設定 (開啟特定功能需要,例如相機, ssh)
也可以從 GUI 中的 Raspberry Pi 設定中調整,下面附上的是使用 terminal 的方法
sudo raspi-config
可參考:https://ithelp.ithome.com.tw/articles/10235452
關機
sudo shutdown -h now
重新開機
sudo reboot
安裝 zsh or fish
這只是個人習慣,換個比較好用的 shell。
安裝 zsh shell / 自動化腳本
#!/bin/bash
echo "[1/5] update system"
sudo apt-get update -y
sudo apt-get upgrade -y
echo "[2/5] install zsh"
sh -c "$(wget https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh -O -)"
sudo apt-get install zsh -y
echo "[3/5] Show all current shells"
cat /etc/shells
echo $SHELL
echo "[4/5] install oh-my-zsh"
sh -c "$(wget https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh -O -)"
echo "[5/5] change default shell to zsh shell"
chsh -s /bin/zsh
#grep pi /etc/passwd #check change shell in /etc/passwd
# ----- powerlevel10k theme ------ #
echo "install powerlevel10k"
git clone --depth=1 https://github.com/romkatv/powerlevel10k.git ~/powerlevel10k
echo 'source ~/powerlevel10k/powerlevel10k.zsh-theme' >>! ~/.zshrc
echo "[restart] restart zsh"
source ~/.zshrc
echo "[optional] set ~/.zshrc (zsh seetings)"
#vim ~/.zshrc
echo "[optional] set ~/.p10k.zsh (powerlevel10k seetings)"
#p10k configure # GUI version
cp ~/.p10k.zsh ~/.p10k.zsh.bak # backup
vim ~/.p10k.zsh
echo "[restart] restart zsh"
source ~/.zshrc
# ----- zsh plugins ------ #
echo "[optional] install Syntax Highlighting Plugin"
# doc: https://github.com/zsh-users/zsh-syntax-highlighting/blob/master/INSTALL.md
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting
echo "[optional] install ZSH-AutoSuggestion Plugin"
# doc: https://github.com/zsh-users/zsh-autosuggestions/blob/master/INSTALL.md
git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions
echo "[optional] set ~/.zshrc to use plugins"
vim ~/.zshrc
#plugins=(
#git
#zsh-syntax-highlighting
#zsh-autosuggestions
#)
echo "[restart] restart zsh"
source ~/.zshrc
安裝 fish shell / 自動化腳本
#!/bin/bash
echo "[1/5] update system"
sudo apt-get update -y
sudo apt-get upgrade -y
echo "[2/5] install fish"
#sudo apt-add-repository ppa:fish-shell/release-3 # for ubuntu
sudo apt-get install fish -y
echo "[3/5] Show all current shells"
cat /etc/shells
echo $SHELL
echo "[4/5] install oh-my-fish"
curl -L