[覚書]ラズベリーパイの環境構築
 
									Raspberry Piを使うために、私がいつも設定していそうな事を、覚書としてまとめてます。
OS確認
getconf LONG_BIT #-> 64
lsb_release -a有線LANの再設定
eth0のネットワーク再設定
sudo vim /etc/dhcpcd.conf
reboot無線LAN
SSIDの一覧
sudo iwlist wlan0 scan | grep ESSIDセキュリティ
sudo vim /etc/ssh/sshd_config
sudo systemctl restart ssh今現在のraspi osを最新の状態にする
sudo apt update
sudo apt full-upgrade
sudo apt autoremove
sudo apt clean仮想メモリの増加
デフォルトでは100MB >> 1GBへ変更する。
sudo service dphys-swapfile stop
sudo vim /etc/dphys-swapfileMB単位になっているので1GBに変更
(-)CONF_SWAPSIZE=100
(+)CONF_SWAPSIZE=1024sudo service dphys-swapfile start確認
swapon -sI2C
i2cdetect コマンドでモジュールが正しく接続されているかを確認する。
sudo i2cdetect -y 1shellをfishへ変更
ログインシェルとしては変更せず、例えばbashが起動後に、fishに起動変更するとそれまでの依存関係も有効のままで良いかもしれない。
echo 'deb http://download.opensuse.org/repositories/shells:/fish:/release:/3/Debian_11/ /' | sudo tee /etc/apt/sources.list.d/shells:fish:release:3.list
curl -fsSL https://download.opensuse.org/repositories/shells:fish:release:3/Debian_11/Release.key | gpg --dearmor | sudo tee /etc/apt/trusted.gpg.d/shells:fish:release:3.gpg > /dev/null
sudo apt update
sudo apt install fish起動
fishデフォルトのシェルへ設定
.bashrcなどに、fishが最後に起動するように設定したほうが良いかも。
ここではログインシェルの変更
cat /etc/shells
chsh -s /usr/bin/fishテーマ変更例
oh-my-fishを追加、bobthefishというテーマにする。
curl https://raw.githubusercontent.com/oh-my-fish/oh-my-fish/master/bin/install | fish
omf install bobthefish
# フォントの追加
git clone https://github.com/powerline/fonts.git
cd fonts
./install.sh
cd ..
rm -rf fonts(fisherman 改め) fisher
プラグインやテーマの管理に使う。
インストール
curl -Lo ~/.config/fish/functions/fisher.fish --create-dirs https://git.io/fisherpowerline フォントも入れると幸せになるらしい。
sudo apt install fonts-powerlineパスの追加
fish_add_path /snap/bin確認
fisher -v
fisher listfzf
fishと一緒に使うと便利みたい。
sudo apt install fzf
curl https://git.io/fisher --create-dirs -sLo ~/.config/fish/functions/fisher.fish
# (shell をfishになって)
fisher install jethrokuan/fzfctrl + c   # コマンド履歴の曖昧検索
ctrl + o   # ファイルの曖昧検索z
cd履歴が増えていけば、だんだん便利になる。cdで移動するより曖昧で行けるので楽になってくる。fisherでインストールする
fisher install jethrokuan/z以下はgitからダウンロードしてインストールする方法
git clone git@github.com:rupa/z.git ~/z設定ファイルに記入(.bashrcとか.zshrcなど)
. ~/z/z.sh使い方
z hogebashのパスを通す(設定ファイルを読み込む?)
fisher add edc/bass
vim ~/.config/fish/config.fish
# config.fishに以下を追加
bass source /etc/profile再ログインする。
fish ロゴ
fisher install laughedelic/fish_logo
fish_logo
Zshもついでに
sudo apt install zshDocker
Dockerエンジンはshで、docker-composeはpipでインストールする。
curl -fsSL https://get.docker.com -o get-docker.sh
sudo sh get-docker.shsudo権限付与
sudo usermod -aG docker pidocker-compose
sudo pip install docker-compose以上になります。またお会いしましょう






