Misc: setup, Helix, bash, packages, apps, font

- Setup: reorganize and add server specific setup
- Helix: use relative line numbers
- Bash: add aliases
- Packages: install GStreamer plugins for AV1 preview
- Apps: Video Trimmer
- Font: Simplified Chinese font priority fix
This commit is contained in:
DuckDuckWhale 2023-08-13 12:03:51 -07:00
parent bb3770036a
commit 39a45f459b
Signed by: DuckDuckWhale
GPG Key ID: E4B9FC170FFD71CE
5 changed files with 88 additions and 15 deletions

View File

@ -19,6 +19,11 @@ PS1='${debian_chroot:+($debian_chroot)}\[\e[01;38;5;11m\]\u\[\e[00;38;5;208m\]@\
PROMPT_DIRTRIM=3
alias ls='ls --color'
alias bat='batcat'
alias mosh='mosh -o'
alias cargo='cargo auditable'
alias md='pulldown-cmark -TFSLH'
alias auto-av1='nice ab-av1 auto-encode --min-samples 2 --keyint 2s --scd true'
# Shows a oneline preview of all files under the folder after changing directory.

View File

@ -37,6 +37,7 @@ space.i = ":toggle lsp.display-inlay-hints"
space.u = ":update"
[editor]
line-number = "relative"
auto-pairs = false
bufferline = "multiple"
rulers = [101]

View File

@ -0,0 +1,43 @@
# Debian Server Setup
Here's the minimum setup I put on my Debian 12 Bookworm servers.
## System configuration
```
# system updates
sudo apt update
sudo apt install -y openssh-server mosh ufw vim
sudo apt upgrade -y
sudo apt autoremove -y
# use Vim
sudo update-alternatives --config editor
# OpenSSH & Mosh & UFW
sudo groupadd --system ssh-users
sudo usermod -aG ssh-users $(whoami)
sudo cp /etc/ssh/sshd_config /etc/ssh/sshd_config.bak
sudo wget \
https://git.duckduckwhale.com/DuckDuckWhale/dotfiles/raw/branch/main/system/sshd/sshd_config \
-O /etc/ssh/sshd_config
sudo systemctl enable ssh --now
sudo systemctl reload ssh
sudo ufw limit OpenSSH # sudo ufw limit 22/tcp
sudo ufw allow mosh # sudo ufw allow 60001:60999/udp # mosh profile includes unused 60000 & 61000
sudo ufw enable
# sanity check
systemctl status ssh
sudo ufw status
su - $(whoami)
# apply all settings
sudo reboot
```
## User SSH keys
```
mkdir -p ~/.ssh
chmod 700 ~/.ssh
# insert your SSH public keys into the file
touch ~/.ssh/authorized_keys
chmod 600 ~/.ssh/authorized_keys
```

View File

@ -203,22 +203,35 @@ sudo chmod -R 700 /opt/grub
- Change `GRUB_TIMEOUT=10` to `GRUB_TIMEOUT=3`
- `$ sudo update-grub`
## OpenSSH Server & Mosh
### OpenSSH Server & Mosh & UFW
Installation and configuration:
```
sudo apt install -y openssh-server mosh
sudo cp /etc/ssh/sshd_config /etc/ssh/sshd_config.bak
sudo cp ../system/sshd/sshd_config /etc/ssh/sshd_config
sudo groupadd --system ssh-users
sudo usermod -aG ssh-users $(whoami)
sudo systemctl enable ssh --now
sudo systemctl reload ssh
```
Firewall:
```
sudo ufw limit OpenSSH # sudo ufw limit 22/tcp
sudo ufw allow mosh # sudo ufw allow 60001:60999/udp # mosh profile includes unused 60000 & 61000
sudo ufw show added
# check before you enable
sudo ufw enable
```
Per user:
```
mkdir -p ~/.ssh
chmod 700 ~/.ssh
# insert your SSH public keys into this file
touch ~/.ssh/authorized_keys
chmod 600 ~/.ssh/authorized_keys
# insert your SSH public keys into the file
sudo ufw limit 22/tcp
sudo ufw allow 60001:60999/udp
sudo systemctl restart ssh
```
## See logs as admin

View File

@ -13,7 +13,7 @@ Here's my personal Ubuntu 23.04 setup. (Make sure to use Wayland on Nvidia!)
- `sudo apt install arp-scan asciinema bookworm foliate gimp gnome-firmware gnome-games
gnome-nettool gnome-packagekit gnome-passwordsafe gnome-shell-pomodoro gnome-usage gthumb
heif-gdk-pixbuf heif-thumbnailer mkvtoolnix-gui openjdk-17-jdk pulseeffectsqpdf ranger
syncplay virtualbox-qt vlc audacity f3 prusa-slicer cmake`
syncplay virtualbox-qt vlc audacity f3 prusa-slicer cmake gstreamer1.0-plugins-bad`
- Remove all snaps:
- ```
# if this command fails, do the following then try again:
@ -93,6 +93,8 @@ Here's my personal Ubuntu 23.04 setup. (Make sure to use Wayland on Nvidia!)
- `flatpak install flathub com.obsproject.Studio`
- Background removal plugin:
- `flatpak install com.obsproject.Studio.Plugin.BackgroundRemoval`
- Video Trimmer
- `flatpak install flathub org.gnome.gitlab.YaLTeR.VideoTrimmer`
## Optional Apps
@ -158,11 +160,7 @@ Here's my personal Ubuntu 23.04 setup. (Make sure to use Wayland on Nvidia!)
echo '/swapfile none swap defaults 0 0' | sudo tee -a /etc/fstab > /dev/null
```
### UFW
`$ sudo ufw enable`
### OpenSSH Server & Mosh
### OpenSSH Server & Mosh & UFW
Installation and configuration:
```
@ -171,14 +169,17 @@ sudo cp /etc/ssh/sshd_config /etc/ssh/sshd_config.bak
sudo cp ../system/sshd/sshd_config /etc/ssh/sshd_config
sudo groupadd --system ssh-users
sudo usermod -aG ssh-users $(whoami)
sudo systemctl enable sshd --now
sudo systemctl reload sshd
sudo systemctl enable ssh --now
sudo systemctl reload ssh
```
Firewall:
```
sudo ufw limit OpenSSH
sudo ufw allow 60001:60999/udp
sudo ufw limit OpenSSH # sudo ufw limit 22/tcp
sudo ufw allow mosh # sudo ufw allow 60001:60999/udp # mosh profile includes unused 60000 & 61000
sudo ufw show added
# check before you enable
sudo ufw enable
```
Per user:
@ -198,6 +199,16 @@ See the `system` folder and run each script as they apply to your installation.
`sudo usermod -aG adm $(whoami)`
### Simplified Chinese Font Priority Fix
Move SC to the top by:
```
$ sudoedit $(realpath /etc/fonts/conf.d/64-language-selector-prefer.conf)
```
Source: <https://askubuntu.com/questions/901486/%E9%97%A8-looks-weird-on-my-system-default-font>
## Legacy
### For old Ubuntu versions