Linux
Z Poznámkový blok
Obsah
První nastavení serveru
Základní balíčky
sudo apt update sudo apt install htop ssh sudo wget curl git net-tools
Firewall & antivirus
sudo apt update sudo apt install clamav clamav-freshclam clamav-daemon ufw
Povolení SSH portu pro ufw
ufw allow ssh ufw enable
Balíčky pro usnadnění práce
sudo apt update sudo apt install fzf ncdu dos2unix
- fzf - Fuzzy finder better find
- ncdu - NCurses disk usage better du
- dos2unix - Smaže divný ^M ze souboru
- ll - Je to ls -l, musí se vytvořit alias
Swap
Vypnutí swap
Identifikace swap oddílu
cat /proc/swaps
Vypnutí swap
sudo swapoff -a
Odkaz na smazání swap oddílu
sudo nano /etc/fstab
Zapnutí swap
Zapnutí swap
sudo swapon -a
Guest tool pro Xen server
Nainstalování xen guest tool pro linux systém
curl -sfL https://github.com/clazzor/Xen-guest-autoinstall/releases/download/latest/autoinstall.sh | bash -
Instalace pip3
sudo apt update sudo apt install python3-pip
TUI & CLI
ZSH
Instalace
sudo apt update sudo apt install zsh
Pro přenastavení BASH na ZSH pro účet
sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
Pluginy a vzhled
Stáhnutí
Stáhnutí theme a plugins
git clone --depth=1 https://github.com/romkatv/powerlevel10k.git ${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/themes/powerlevel10k 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
Konfigurace
Propojení theme a plugins v configu .zshrc
ZSH_THEME="powerlevel10k/powerlevel10k" plugins=(git nomad zsh-autosuggestions zsh-syntax-highlighting)
Problém s mc
MC blbné s zsh kvůli nvém shellu, načítá se dlouho, tohle jde vyřešit aliasem v .zshrc Další možnost je použít NNN
- viz: https://graffino.com/til/ZLcOA4Zcaq-fix-slow-loading-or-freezing-midnight-commander-mc-with-zsh
alias mc="mc --nosubshell"
NeoVim/NvChad
Instalace
curl -JLO https://github.com/neovim/neovim/releases/download/stable/nvim.appimage
sudo chown root:root nvim.appimage sudo chmod 755 nvim.appimage sudo mv nvim.appimage /usr/bin/nvim
git clone https://github.com/NvChad/NvChad ~/.config/nvim --depth 1 && nvim
- https://nvchad.com/docs/config/format_lint
- https://github.com/NvChad/NvChad
- https://docs.rockylinux.org/books/nvchad/install_nvchad/
NNN
Instalace
sudo apt update sudo apt install nnn
Pro plugin preview-tui potřebujeme tmux
sudo apt install tmux
Pro aktualizaci/stažení pluginu:
sh -c "$(curl -Ls https://raw.githubusercontent.com/jarun/nnn/master/plugins/getplugs)"
- https://github.com/jarun/nnn
- https://www.youtube.com/watch?v=-knZwdd1ScU&t=353s
- https://github.com/jarun/nnn/tree/master/plugins#installation
- https://github.com/jarun/nnn/wiki/Usage#configuration
- https://github.com/jarun/nnn/wiki/Troubleshooting#tmux-configuration
- https://github.com/jarun/nnn/wiki/Basic-use-cases#configure-cd-on-quit
- https://github.com/jarun/nnn/wiki/Live-previews
- https://github.com/luukvbaal/nnn.nvim