More language highlighting

This commit is contained in:
RealStickman 2022-12-16 11:50:40 +01:00
parent 78eec895b0
commit a6c40777f9
6 changed files with 226 additions and 145 deletions

View File

@ -4,62 +4,72 @@ visible: true
---
[toc]
## Keyboard layout
`loadkeys de_CH-latin1`
`loadkeys de_CH-latin1`
## Check UEFI mode
If the following command works, the system is booted in EFI.
`ls /sys/firmware/efi/efivars`
`ls /sys/firmware/efi/efivars`
## Verify internet connection
`ping www.realstickman.net`
`ping www.realstickman.net`
## Update system clock
`timedatectl set-ntp true`
`timedatectl set-ntp true`
## Creating partitions
`cfdisk`
`cfdisk`
Use `EFI System` for EFI partition
Use `Linux filesystem` for other partitions
Use `Linux filesystem` for other partitions
## (LUKS) Create encrypted partition
*Note: Do not put your /efi partition on an encrypted partition!*
_Note: Do not put your /efi partition on an encrypted partition!_
Create encrypted Partition
`cryptsetup luksFormat /dev/(partition) --type luks1`
`cryptsetup luksFormat /dev/(partition) --type luks1`
To view if this worked correctly
`cryptsetup luksDump /dev/(partition)`
`cryptsetup luksDump /dev/(partition)`
Open the partition
Give it a fitting name
`cryptsetup open /dev/(partition) (name)`
`cryptsetup open /dev/(partition) (name)`
Check if this worked with `ls /dev/mapper/`
The name should show up there
The name should show up there
## Format partitions
Fat 32:
`mkfs.fat -F32 /dev/(partition)`
*For EFI or BOOT partition*
_For EFI or BOOT partition_
Ext4:
`mkfs.ext4 /dev/(partition)`
*All other partitions*
_All other partitions_
btrfs:
`mkfs.btrfs /dev/(partition)`
*All other partitions*
_All other partitions_
F2FS:
`mkfs.f2fs -O extra_attr,inode_checksum,sb_checksum,compression /dev/(partition)`
*All other partitions*
_All other partitions_
## Mounting partitions
Generally partitions have to be mounted where you will later use them in your system.
BTRFS with its subvolumes is a special case
For EFI, prefer the /efi mountpoint
For EFI, prefer the /efi mountpoint
```
Root: /mnt
EFI: /mnt/efi or /mnt/boot
@ -68,39 +78,40 @@ etc...
```
### (BTRFS) Btrfs preparation of subvolumes and mounting
Mount root partition
`mount /dev/(partition) /mnt`
`mount /dev/(partition) /mnt`
Root subvolume
`btrfs subv create /mnt/@`
`btrfs subv create /mnt/@`
Home subvolume
`btrfs subv create /mnt/@home`
`btrfs subv create /mnt/@home`
Snapshots subvolume for snapper
`btrfs subv create /mnt/@snapshots`
`btrfs subv create /mnt/@snapshots`
Snapshots subvolume for timeshift
`btrfs subv create /mnt/@timeshift`
`btrfs subv create /mnt/@timeshift`
Var subvolume
`btrfs subv create /mnt/@var_log`
`btrfs subv create /mnt/@var_log`
*If you want to use a swapfile with Snapper, create a new subvolume now*
_If you want to use a swapfile with Snapper, create a new subvolume now_
Swap subvolume
`btrfs subv create /mnt/@swap`
`btrfs subv create /mnt/@swap`
`umount /mnt`
`umount /mnt`
Mount root
`mount -o noatime,compress-force=zstd,space_cache=v2,subvol=@ /dev/(partition) /mnt`
`mount -o noatime,compress-force=zstd,space_cache=v2,subvol=@ /dev/(partition) /mnt`
With /efi
`mkdir -p /mnt/{efi,home,.snapshots,var/log,swap}`
With /boot
`mkdir -p /mnt/{boot,home,.snapshots,var/log,swap}`
With /boot and timeshift
`mkdir -p /mnt/{boot,home,timeshift-btrfs,var/log,swap}`
`mkdir -p /mnt/{boot,home,timeshift-btrfs,var/log,swap}`
Mount home
`mount -o noatime,compress-force=zstd,space_cache=v2,subvol=@home /dev/(partition) /mnt/home`
@ -108,118 +119,140 @@ Mount home
Mount snapshots for snapper
`mount -o noatime,compress-force=zstd,space_cache=v2,subvol=@snapshots /dev/(partition) /mnt/.snapshots`
Mount snapshots for timeshift
`mount -o noatime,compress-force=zstd,space_cache=v2,subvol=@timeshift /dev/(partition) /mnt/timeshift-btrfs`
`mount -o noatime,compress-force=zstd,space_cache=v2,subvol=@timeshift /dev/(partition) /mnt/timeshift-btrfs`
Mount var
`mount -o noatime,compress-force=zstd,space_cache=v2,subvol=@var_log /dev/(partition) /mnt/var/log`
Swap subvolume
`mount -o noatime,compress-force=zstd,space_cache=v2,subvol=@swap /dev/(partition) /mnt/swap`
`mount -o noatime,compress-force=zstd,space_cache=v2,subvol=@swap /dev/(partition) /mnt/swap`
**Don't forget mounting other partitions!!**
**Don't forget mounting other partitions!!**
### (F2FS) Mounting
Mount partition with compression algorithm specified
`mount -o compress_algorithm=zstd /dev/(partition) /mnt`
`mount -o compress_algorithm=zstd /dev/(partition) /mnt`
With /efi
`mkdir -p /mnt/efi`
With /boot
`mkdir -p /mnt/boot`
`mkdir -p /mnt/boot`
**Don't forget mounting other partitions!!**
**Don't forget mounting other partitions!!**
## Swap
### Swap partition
TODO
### Swapfile
#### Normal way
**NOT FOR BTRFS!**
`dd if=/dev/zero of=/mnt/swapfile bs=1M count=(size) status=progress`
`dd if=/dev/zero of=/mnt/swapfile bs=1M count=(size) status=progress`
#### (BTRFS) Swapfile in btrfs
*Does not work with snapper*
*Use a separate subvolume in that case*
`truncate -s 0 /mnt/swapfile`
`chattr +C /mnt/swapfile`
_Does not work with snapper_
_Use a separate subvolume in that case_
`truncate -s 0 /mnt/swapfile`
`btrfs property set /mnt/swapfile compression none`
`chattr +C /mnt/swapfile`
`fallocate -l (size)M /mnt/swapfile`
`btrfs property set /mnt/swapfile compression none`
`fallocate -l (size)M /mnt/swapfile`
#### Initialising swapfile
`chmod 600 /mnt/swapfile`
`mkswap /mnt/swapfile`
`chmod 600 /mnt/swapfile`
`swapon /mnt/swapfile`
`mkswap /mnt/swapfile`
`swapon /mnt/swapfile`
## Essential packages
Some things like the userspace utilities for file management will vary.
See [file systems](https://wiki.archlinux.org/index.php/File_systems#Types_of_file_systems)
`pacstrap /mnt base linux linux-firmware vim git openssh networkmanager network-manager-applet dialog base-devel linux-headers`
`pacstrap /mnt base linux linux-firmware vim git openssh networkmanager network-manager-applet dialog base-devel linux-headers`
### Microcode
`amd-ucode`
`intel-ucode`
`amd-ucode`
`intel-ucode`
### Filesystems
Fat32:
`dosfstools mtools`
`dosfstools mtools`
Ext4:
`e2fsprogs`
`e2fsprogs`
Btrfs:
`btrfs-progs compsize`
`btrfs-progs compsize`
F2FS:
`f2fs-tools`
`f2fs-tools`
### Wifi
`wpa_supplicant`
`wpa_supplicant`
### Snapper
`snapper`
`snapper`
### Certificates
`ca-certificates ca-certificates-mozilla`
`ca-certificates ca-certificates-mozilla`
### other
`cups hplip xdg-utils xdg-user-dirs inetutils`
`cups hplip xdg-utils xdg-user-dirs inetutils`
## Generate fstab
`genfstab -U /mnt >> /mnt/etc/fstab`
**Make sure the fstab file has everything included**
**Make sure the fstab file has everything included**
## Chroot into the system
`arch-chroot /mnt`
`arch-chroot /mnt`
## Set timezone
`ln -sf /usr/share/zoneinfo/Europe/Zurich /etc/localtime`
`ln -sf /usr/share/zoneinfo/Europe/Zurich /etc/localtime`
## Set hardware clock
`hwclock --systohc`
`hwclock --systohc`
## Set locale
`vim /etc/locale.gen`
Uncomment the locales that should be generated.
Make sure to use a UTF-8 entry.
Make sure to use a UTF-8 entry.
`locale-gen`
`locale-gen`
`echo "LANG=de_CH.UTF-8" > /etc/locale.conf`
`echo "LANG=de_CH.UTF-8" > /etc/locale.conf`
## Set keymap permanently
`echo "KEYMAP=de_CH-latin1" > /etc/vconsole.conf`
`echo "KEYMAP=de_CH-latin1" > /etc/vconsole.conf`
## Set hostname
`echo "(hostname)" > /etc/hostname`
Edit `/etc/hosts`
`echo "(hostname)" > /etc/hostname`
Edit `/etc/hosts`
```
127.0.0.1 localhost
::1 localhost
@ -227,121 +260,134 @@ Edit `/etc/hosts`
```
## Change root password
`passwd`
`passwd`
## Bootloader installation
### GRUB UEFI
`pacman -S grub efibootmgr`
If you are using encryption, see the next section first. **Make sure to come back here again though**
`grub-install --target=x86_64-efi --efi-directory=(efi partition mountpoint) --bootloader-id=GRUB`
`pacman -S grub efibootmgr`
`grub-mkconfig -o /boot/grub/grub.cfg`
If you are using encryption, see the next section first. **Make sure to come back here again though**
`grub-install --target=x86_64-efi --efi-directory=(efi partition mountpoint) --bootloader-id=GRUB`
`grub-mkconfig -o /boot/grub/grub.cfg`
#### (LUKS) Encryption with /efi
Create keyfile and add it to mkinitcpio.conf
`dd bs=512 count=4 if=/dev/random of=/crypto_keyfile.bin iflag=fullblock`
`chmod 600 /crypto_keyfile.bin`
Create keyfile and add it to mkinitcpio.conf
`dd bs=512 count=4 if=/dev/random of=/crypto_keyfile.bin iflag=fullblock`
`chmod 600 /crypto_keyfile.bin`
**This command should be run after installing a new kernel!**
`chmod 600 /boot/initramfs-linux*`
`chmod 600 /boot/initramfs-linux*`
`cryptsetup luksAddKey /dev/(partition) /crypto_keyfile.bin`
`cryptsetup luksAddKey /dev/(partition) /crypto_keyfile.bin`
Include the file in `/etc/mkinitcpio.conf`
`FILES=(/crypto_keyfile.bin)`
`FILES=(/crypto_keyfile.bin)`
Edit the `HOOKS` section as well. *Example:*
`HOOKS=(base udev autodetect keyboard keymap modconf block encrypt filesystems fsck)`
Edit the `HOOKS` section as well. _Example:_
`HOOKS=(base udev autodetect keyboard keymap modconf block encrypt filesystems fsck)`
`mkinitcpio -p linux`
`mkinitcpio -p linux`
Edit `/etc/default/grub`
`GRUB_ENABLE_CRYPTODISK=y`
`GRUB_ENABLE_CRYPTODISK=y`
Some options in `GRUB_CMDLINE_LINUX_DEFAULT`
**Make sure to change /dev/(partition) to UUID ASAP!**
*Not sure how to actually do that though, will have to read some more.*
_Not sure how to actually do that though, will have to read some more._
`cryptdevice=/dev/(partition):(name)`
`cryptkey=/dev/mapper/(name):(filesystem):/crypto_keyfile.bin`
`cryptkey=/dev/mapper/(name):(filesystem):/crypto_keyfile.bin`
**Go back and install grub!!**
**Go back and install grub!!**
#### (LUKS) Encryption with /boot
Edit the `HOOKS` section in `/etc/mkinitcpio.conf` *Example:*
`HOOKS=(base udev autodetect keyboard keymap modconf block encrypt filesystems fsck)`
`mkinitcpio -p linux`
Edit the `HOOKS` section in `/etc/mkinitcpio.conf` _Example:_
`HOOKS=(base udev autodetect keyboard keymap modconf block encrypt filesystems fsck)`
Next, edit `/etc/default/grub`
`mkinitcpio -p linux`
Next, edit `/etc/default/grub`
Add an option in `GRUB_CMDLINE_LINUX_DEFAULT`
**Make sure to change /dev/(partition) to UUID ASAP!**
*Not sure how to actually do that though, will have to read some more.*
`cryptdevice=/dev/(partition):(name)`
_Not sure how to actually do that though, will have to read some more._
`cryptdevice=/dev/(partition):(name)`
**Go back and install grub!!**
**Go back and install grub!!**
## Mkinitcpio
### BTRFS
Load required modules
`vim /etc/mkinitcpio.conf`
`MODULES=(btrfs)`
`BINARIES=("/usr/bin/btrfs")`
`BINARIES=("/usr/bin/btrfs")`
`mkinitcpio -p linux`
`mkinitcpio -p linux`
**Go back and install grub!!**
**Go back and install grub!!**
### EXT4
### F2FS
## Networking
`systemctl enable NetworkManager`
`systemctl enable NetworkManager`
## (CUPS) Printing
`systemctl enable cups`
`systemctl enable cups`
## Add user
`useradd -mG wheel (user)`
`useradd -mG wheel (user)`
Set password
`passwd (user)`
`passwd (user)`
### Enable sudo
`visudo`
Uncomment `%wheel ALL=(ALL) ALL`
Uncomment `%wheel ALL=(ALL) ALL`
## Finishing installation
`exit`
`poweroff`
Remove the installation cd
Remove the installation cd
## (Snapper) Setup
`# umount /.snapshots`
`# rm -r /.snapshots`
`# umount /.snapshots`
`# rm -r /.snapshots`
Create snapper config
`# snapper -c root create-config /`
`# snapper -c root create-config /`
Delete unneeded volume
`# btrfs subv del /.snapshots/`
`# btrfs subv del /.snapshots/`
`# mkdir /.snapshots`
`# mkdir /.snapshots`
Mount snapshots volume
`# mount -a`
`# mount -a`
`# chmod 750 /.snapshots`
`# chmod 750 /.snapshots`
`# vim /etc/snapper/configs/root`
`# vim /etc/snapper/configs/root`
Change these things:
`ALLOW_USERS="(user)"`
`ALLOW_USERS="(user)"`
```
TIMELINE_LIMIT_HOURLY="5"
TIMELINE_LIMIT_DAILY="7"
@ -352,26 +398,30 @@ TIMELINE_LIMIT_YEARLY="0"
Enable snapper
`# systemctl enable --now snapper-timeline.timer`
`# systemctl enable --now snapper-cleanup.timer`
`# systemctl enable --now snapper-cleanup.timer`
Allow user to access snapshots
`# chmod a+rx /.snapshots`
`# chown :(user) /.snapshots`
`# chown :(user) /.snapshots`
## Install AUR helper
### yay
```
```sh
git clone https://aur.archlinux.org/yay.git
cd yay
makepkg -si
```
### paru
```
```sh
git clone https://aur.archlinux.org/paru.git
cd paru
makepkg -si
```
## (Snapper) Snap pac and GUI
`$ paru -S snap-pac-grub snapper-gui`
`$ paru -S snap-pac-grub snapper-gui`

View File

@ -4,13 +4,17 @@ visible: true
---
[toc]
## Podman
### Network and Pod
`# podman network create net_hedgedoc`
`# podman pod create --name pod_hedgedoc --network net_hedgedoc -p 127.0.0.1:5432:5432 -p 3005:3000`
`# podman pod create --name pod_hedgedoc --network net_hedgedoc -p 127.0.0.1:5432:5432 -p 3005:3000`
### Database
```
```sh
# podman run --name hedgedocdb \
-e POSTGRES_PASSWORD=hedgedoc \
-e PGDATA=/var/lib/postgresql/data/pgdata \
@ -18,14 +22,16 @@ visible: true
--pod pod_hedgedoc \
-d docker.io/postgres:14
```
`# podman exec -it hedgedocdb bash`
`# psql -U postgres`
`# psql -U postgres`
Create database used by hedgedoc
`=# CREATE DATABASE hedgedocdb;`
`=# CREATE DATABASE hedgedocdb;`
### Application
```
```sh
# podman run -d --name hedgedoc \
-e CMD_DB_URL=postgres://postgres:hedgedoc@localhost:5432/hedgedocdb \
-e CMD_DOMAIN=(url) \
@ -38,14 +44,17 @@ Create database used by hedgedoc
--pod pod_hedgedoc \
quay.io/hedgedoc/hedgedoc:latest
```
## Create user
Because `CMD_ALLOW_EMAIL_REGISTER` is set to `false`, registration of new users has to be done through the CLI interface using `bin/manage_users` in the container.
Because `CMD_ALLOW_EMAIL_REGISTER` is set to `false`, registration of new users has to be done through the CLI interface using `bin/manage_users` in the container.
`# podman exec -it hedgedocdb bash`
`# bin/manage_users --add (email)`
`# bin/manage_users --add (email)`
## Nginx config
```
```nginx
server {
server_name SERVER_NAME;
@ -65,7 +74,7 @@ server {
proxy_set_header X-Forwarded-Protocol $scheme;
proxy_set_header X-Forwarded-Host $http_host;
}
location /socket.io/ {
proxy_pass http://(SERVER);
proxy_set_header Host $host;

View File

@ -4,30 +4,36 @@ visible: true
---
[toc]
## Container Image
```
```sh
# podman run -d --name jellyfin -p 8096:8096 \
-v /mnt/jellyfin/cache:/cache \
-v /mnt/jellyfin/config:/config \
-v /mnt/media:/media \
docker.io/jellyfin/jellyfin:latest
```
## Apt Packate
`# apt install nginx apt-transport-https`
`# wget -O - https://repo.jellyfin.org/jellyfin_team.gpg.key | apt-key add -`
## Apt Packate
`# apt install nginx apt-transport-https`
`# wget -O - https://repo.jellyfin.org/jellyfin_team.gpg.key | apt-key add -`
`# echo "deb [arch=$( dpkg --print-architecture )] https://repo.jellyfin.org/$( awk -F'=' '/^ID=/{ print $NF }' /etc/os-release ) $( awk -F'=' '/^VERSION_CODENAME=/{ print $NF }' /etc/os-release ) main" | tee /etc/apt/sources.list.d/jellyfin.list`
`# apt update`
`# apt update`
`# apt install jellyfin`
`# apt install jellyfin`
## Nginx
Create a new nginx configuration file in `/etc/nginx/sites-available`
*Make sure to replace "DOMAIN\_NAME" with your domain name*
*Replace "IPV4" with an ipv4 address and "IPV6" with an ipv6 address*
```
_Make sure to replace "DOMAIN_NAME" with your domain name_
_Replace "IPV4" with an ipv4 address and "IPV6" with an ipv6 address_
```nginx
server {
server_name DOMAIN_NAME;
@ -105,7 +111,7 @@ server {
```
Enable the config
`$ ln -s /etc/nginx/sites-available/(config) /etc/nginx/sites-enabled/`
`$ ln -s /etc/nginx/sites-available/(config) /etc/nginx/sites-enabled/`
Restart nginx
`# systemctl restart nginx`
`# systemctl restart nginx`

View File

@ -4,18 +4,23 @@ visible: false
---
[toc]
## Podman
### Network and Pod
`# podman network create net_kaizoku`
`# podman pod create --name pod_kaizoku --network net_kaizoku -p 3000:3000`
`# podman pod create --name pod_kaizoku --network net_kaizoku -p 3000:3000`
#### Port Mappings
```
3000: Kaizoku WebUI
```
### Database
```
```sh
# podman run --name kaizoku-db \
-e POSTGRES_USER=kaizoku \
-e POSTGRES_PASSWORD=kaizoku \
@ -26,7 +31,8 @@ visible: false
```
### Redis
```
```sh
# podman run --name kaizoku-redis \
-v /mnt/kaizoku_redis:/data \
--pod pod_kaizoku \
@ -34,7 +40,8 @@ visible: false
```
### Application
```
```sh
# podman run --name kaizoku-app \
-e DATABASE_URL=postgresql://kaizoku:kaizoku@kaizoku-db:5432/kaizoku \
-e KAIZOKU_PORT=3000 \

View File

@ -4,12 +4,15 @@ visible: true
---
[toc]
## Create directories
`# mkdir -p /var/kavita/{config,content}`
`# mkdir -p /var/kavita/content/{manga,books,tech}`
`# mkdir -p /var/kavita/content/{manga,books,tech}`
## Run Kavita
```
```sh
# podman run --name kavita -p 5000:5000 \
-v /var/kavita/content:/content \
-v /var/kavita/config:/kavita/config \
@ -18,7 +21,8 @@ visible: true
```
## Nginx Config
```
```nginx
server {
server_name kavita.exu.li;
@ -56,4 +60,5 @@ server {
```
## Systemd Service
> See [Podman](/linux/podman#generate-systemd-service) to generate a service file.
> See [Podman](/linux/podman#generate-systemd-service) to generate a service file.

View File

@ -5,14 +5,16 @@ visible: true
[toc]
> I'm not using Komga anymore. This article might be out of date
> I'm not using Komga anymore. This article might be out of date
## Create directories
`# mkdir -p /var/komga/{config,content}`
`# mkdir -p /var/komga/content/{manga,books,tech}`
`# mkdir -p /var/komga/content/{manga,books,tech}`
## Run Komga
```
```sh
# podman run --name komga -p 8080:8080 \
-v /var/komga/config:/config \
-v /var/komga/content:/content \
@ -21,7 +23,8 @@ visible: true
```
## Nginx Config
```
```nginx
server {
server_name komga.exu.li;
@ -59,4 +62,5 @@ server {
```
## Systemd Service
> See [Podman](/linux/podman#generate-systemd-service) to generate a service file.
> See [Podman](/linux/podman#generate-systemd-service) to generate a service file.