Linux: Porovnání verzí
Z Poznámkový blok
(→Linux) |
|||
Řádka 1: | Řádka 1: | ||
− | Základní balíčky | + | == První nastavení serveru == |
+ | === Základní balíčky === | ||
sudo apt update | sudo apt update | ||
− | sudo apt install htop | + | sudo apt install htop ssh sudo wget curl git net-tools open-vm-tools |
− | + | === Firewall & antivirus === | |
− | |||
sudo apt update | sudo apt update | ||
sudo apt install clamav clamav-freshclam clamav-daemon ufw | sudo apt install clamav clamav-freshclam clamav-daemon ufw | ||
− | + | Povolení SSH portu pro ufw | |
− | |||
− | |||
ufw allow ssh | ufw allow ssh | ||
ufw enable | ufw enable | ||
− | + | * https://wiki.mikrotik.com/wiki/Use_Mikrotik_as_Fail2ban_firewall | |
− | + | ||
+ | == Balíčky pro usnadnění práce == | ||
sudo apt update | sudo apt update | ||
sudo apt install fzf ncdu dos2unix | sudo apt install fzf ncdu dos2unix | ||
− | * fzf - Fuzzy finder better find | + | * '''fzf''' - Fuzzy finder better find |
− | * ncdu - NCurses disk usage better du | + | * '''ncdu''' - NCurses disk usage better du |
− | * dos2unix - Smaže | + | * '''dos2unix''' - Smaže divný '''^M''' ze souboru |
− | |||
− | + | * '''ll''' - Je to ls -l, musí se vytvořit alias | |
− | ''' | + | |
− | + | == Vypnutí swap == | |
− | + | Vypnutí swap kvůli virtualizace kontejnerů | |
− | + | sudo swapoff -a; sudo swapon -a | |
− | sudo apt install | + | |
+ | == Instalace pip3 == | ||
+ | sudo apt update | ||
+ | sudo apt install python3-pip | ||
+ | == TUI & CLI == | ||
+ | === ZSH === | ||
+ | ==== Instalace ==== | ||
sudo apt update | sudo apt update | ||
sudo apt install zsh | sudo apt install zsh | ||
Řádka 37: | Řádka 41: | ||
sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" | sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" | ||
+ | ==== Pluginy a vzhled ==== | ||
+ | ===== Stáhnutí ===== | ||
Stáhnutí theme a plugins | 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 --depth=1 https://github.com/romkatv/powerlevel10k.git ${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/themes/powerlevel10k | ||
Řádka 42: | Řádka 48: | ||
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting | git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting | ||
− | Propojení theme a plugins v configu .zshrc | + | ===== Konfigurace ===== |
+ | Propojení theme a plugins v configu '''.zshrc''' | ||
ZSH_THEME="powerlevel10k/powerlevel10k" | ZSH_THEME="powerlevel10k/powerlevel10k" | ||
plugins=(git nomad zsh-autosuggestions zsh-syntax-highlighting) | 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/Chad === | ||
+ | ==== Instalace ==== | ||
curl -JLO https://github.com/neovim/neovim/releases/download/stable/nvim.appimage | curl -JLO https://github.com/neovim/neovim/releases/download/stable/nvim.appimage | ||
Řádka 55: | Řádka 70: | ||
git clone https://github.com/NvChad/NvChad ~/.config/nvim --depth 1 && nvim | git clone https://github.com/NvChad/NvChad ~/.config/nvim --depth 1 && nvim | ||
+ | === NNN === | ||
+ | ==== Instalace ==== | ||
+ | sudo apt update | ||
+ | sudo apt install nnn | ||
− | + | * https://github.com/jarun/nnn | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− |
Verze z 12. 5. 2023, 09:24
Obsah
První nastavení serveru
Základní balíčky
sudo apt update sudo apt install htop ssh sudo wget curl git net-tools open-vm-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
Vypnutí swap
Vypnutí swap kvůli virtualizace kontejnerů
sudo swapoff -a; sudo swapon -a
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/Chad
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
NNN
Instalace
sudo apt update sudo apt install nnn