アカウント
root権限を持つ一般ユーザーの作成
BASH
# rootアカウントで操作
adduser <username>
usermod -aG sudo <username> # ユーザーをsudoグループに追加
# パスワードなしsudoの設定
visudo
# ファイル末尾に追加
<username> ALL=(ALL) NOPASSWD:ALLzsh
まずフォントをインストール
BASH
# Macは標準搭載、インストール不要
sudo apt install zsh
sudo chsh -s /usr/bin/zsh $USER
# 初期設定は不要、後でPowerlevel10kで設定
# oh-my-zsh、zshの設定フレームワーク
sh -c "$(curl -fsSL https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"
# Powerlevel10k、oh-my-zshのテーマ
git clone --depth=1 https://github.com/romkatv/powerlevel10k.git ${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/themes/powerlevel10k
echo 'source ${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/themes/powerlevel10k/powerlevel10k.zsh-theme' >>~/.zshrc
# シェルを再起動して設定に入るプラグイン
BASH
git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting
# ~/.zshrcでプラグインを有効化
plugins=(git sudo z zsh-autosuggestions zsh-syntax-highlighting)Vim
nvimのインストール
MacOS
BASH
brew install neovim
# vim ~/.zshrc
alias vim="nvim"Ubuntu
BASH
curl -LO https://github.com/neovim/neovim/releases/latest/download/nvim-linux-x86_64.tar.gz
# ラズパイはArm
curl -LO https://github.com/neovim/neovim/releases/latest/download/nvim-linux-arm64.tar.gz
sudo rm -rf /opt/nvim
sudo tar -C /opt -xzf nvim-linux-x86_64.tar.gz
# vim ~/.zshrc
export PATH="$PATH:/opt/nvim-linux-x86_64/bin"
alias vim="nvim"
# sudo nvim
sudo ln -s /opt/nvim-linux-x86_64/bin/nvim /usr/local/bin/nvimBASH
# 必須
mv ~/.config/nvim{,.bak}
git clone https://github.com/LazyVim/starter ~/.config/nvim
rm -rf ~/.config/nvim/.git
vim # 起動後に自動的に一連のダウンロードとインストールが行われるその他のコマンドラインツール
bat:強化版 cat
BASH
# macOS
brew install bat
alias cat="bat -pp"
# Linux
sudo apt install bat
alias cat='batcat -pp'
alias bat='batcat'eza:強化版 ls
- exaのコミュニティメンテナンス版
BASH
# macOS
brew install eza
# Linux
sudo apt install eza
alias ls='eza --color=always --icons'
alias ll='eza -la --color=always --icons --git'
alias la='eza -la --color=always --icons --git'
alias lt='eza --tree --color=always --icons'
alias tree='eza --tree --color=always --icons --level=3'
alias ltree='eza -Tla --color=always --icons --git --level=2 --git-repos'
alias bigtree='eza -Tla --total-size --sort=size --color=always --icons --level=2'ncdu:インタラクティブなディスク容量分析、強化版 du
- 📊 インタラクティブなインターフェースでディレクトリとファイルの使用容量を表示
- 🔍 大きなファイル/ディレクトリを素早く特定
- 🗑️ ファイル/ディレクトリの直接削除をサポート
BASH
# macOS
brew install ncdu
# Linux
sudo apt install ncdu
cd /path/to/dir
ncdu # 矢印キーでブラウズ、dキーで選択項目を削除duf:美しい df
- 🌈 すべてのマウントポイントをカラフルなテーブルで表示
- 📏 列でのソートをサポート
- 🖥 ターミナルの幅とテーマに自動適応
BASH
# macOS
brew install duf
dufbtop:強化版 top
BASH
brew install btoptldr:冗長なmanドキュメントを省略
BASH
brew install tldr
# 例
tldr tarSSH Key
クライアントでSSH Keyを生成
BASH
# Windows PowerShell
ssh-keygen -t ed25519 -C "razer-wsl" -f $env:USERPROFILE\.ssh\id_ed25519_razer_wsl
# Ubuntu & MacOS
ssh-keygen -t ed25519 -C "razer-wsl" -f ~/.ssh/id_ed25519_razer_wsl
cat ~/.ssh/id_ed25519_razer_wsl.pubPython
uvをインストールするだけで完了
BASH
curl -LsSf https://astral.sh/uv/install.sh | shいつでもpythonインタラクティブウィンドウ(REPL)を起動したい場合は uv run python
Samba
ラズパイでPLEXサーバー & SMBの設定
plex serverのインストール、公式サイトからArm64インストールパッケージをダウンロード
BASH
sudo dpkg -i plexmediaserver_1.41.7.9823-59f304c16_arm64.debSMBのインストールと設定
BASH
sudo apt install samba samba-common-bin
sudo mkdir -p /media/plex
sudo chown isumi:isumi /media/plex
sudo vim /etc/samba/smb.confSMB設定ファイルの末尾に追加、homeの共有も追加設定可能
PLAINTEXT
[homes]
comment = Home Directories
browseable = no
# By default, the home directories are exported read-only. Change the
# next parameter to 'no' if you want to be able to write to them.
read only = no
# File creation mask is set to 0700 for security reasons. If you want to
# create files with group=rw permissions, set next parameter to 0775.
create mask = 0775
# Directory creation mask is set to 0700 for security reasons. If you want to
# create dirs. with group=rw permissions, set next parameter to 0775.
directory mask = 0775
# By default, \\server\username shares can be connected to by anyone
# with access to the samba server.
# The following parameter makes sure that only "username" can connect
# to \\server\username
# This might need tweaking when using external authentication schemes
valid users = %S
[plex]
comment = Plex Media
path = /media/plex
browseable = yes
writeable = yes
only guest = no
create mask = 0777
directory mask = 0777
public = no
valid users = isumiSMBアカウントの作成、SMBサービスの開始
BASH
# isumiは既存のLinuxユーザー名
sudo smbpasswd -a isumi
sudo systemctl restart smbd
sudo systemctl enable smbd\\IP\plex にアクセス可能

