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,27 +4,34 @@ visible: true
--- ---
[toc] [toc]
## Keyboard layout ## Keyboard layout
`loadkeys de_CH-latin1` `loadkeys de_CH-latin1`
## Check UEFI mode ## Check UEFI mode
If the following command works, the system is booted in EFI. If the following command works, the system is booted in EFI.
`ls /sys/firmware/efi/efivars` `ls /sys/firmware/efi/efivars`
## Verify internet connection ## Verify internet connection
`ping www.realstickman.net` `ping www.realstickman.net`
## Update system clock ## Update system clock
`timedatectl set-ntp true` `timedatectl set-ntp true`
## Creating partitions ## Creating partitions
`cfdisk` `cfdisk`
Use `EFI System` for EFI partition Use `EFI System` for EFI partition
Use `Linux filesystem` for other partitions Use `Linux filesystem` for other partitions
## (LUKS) Create encrypted partition ## (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 Create encrypted Partition
`cryptsetup luksFormat /dev/(partition) --type luks1` `cryptsetup luksFormat /dev/(partition) --type luks1`
@ -40,26 +47,29 @@ Check if this worked with `ls /dev/mapper/`
The name should show up there The name should show up there
## Format partitions ## Format partitions
Fat 32: Fat 32:
`mkfs.fat -F32 /dev/(partition)` `mkfs.fat -F32 /dev/(partition)`
*For EFI or BOOT partition* _For EFI or BOOT partition_
Ext4: Ext4:
`mkfs.ext4 /dev/(partition)` `mkfs.ext4 /dev/(partition)`
*All other partitions* _All other partitions_
btrfs: btrfs:
`mkfs.btrfs /dev/(partition)` `mkfs.btrfs /dev/(partition)`
*All other partitions* _All other partitions_
F2FS: F2FS:
`mkfs.f2fs -O extra_attr,inode_checksum,sb_checksum,compression /dev/(partition)` `mkfs.f2fs -O extra_attr,inode_checksum,sb_checksum,compression /dev/(partition)`
*All other partitions* _All other partitions_
## Mounting partitions ## Mounting partitions
Generally partitions have to be mounted where you will later use them in your system. Generally partitions have to be mounted where you will later use them in your system.
BTRFS with its subvolumes is a special case BTRFS with its subvolumes is a special case
For EFI, prefer the /efi mountpoint For EFI, prefer the /efi mountpoint
``` ```
Root: /mnt Root: /mnt
EFI: /mnt/efi or /mnt/boot EFI: /mnt/efi or /mnt/boot
@ -68,6 +78,7 @@ etc...
``` ```
### (BTRFS) Btrfs preparation of subvolumes and mounting ### (BTRFS) Btrfs preparation of subvolumes and mounting
Mount root partition Mount root partition
`mount /dev/(partition) /mnt` `mount /dev/(partition) /mnt`
@ -86,7 +97,7 @@ Snapshots subvolume for timeshift
Var subvolume 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 Swap subvolume
`btrfs subv create /mnt/@swap` `btrfs subv create /mnt/@swap`
@ -119,6 +130,7 @@ Swap subvolume
**Don't forget mounting other partitions!!** **Don't forget mounting other partitions!!**
### (F2FS) Mounting ### (F2FS) Mounting
Mount partition with compression algorithm specified Mount partition with compression algorithm specified
`mount -o compress_algorithm=zstd /dev/(partition) /mnt` `mount -o compress_algorithm=zstd /dev/(partition) /mnt`
@ -130,17 +142,22 @@ With /boot
**Don't forget mounting other partitions!!** **Don't forget mounting other partitions!!**
## Swap ## Swap
### Swap partition ### Swap partition
TODO TODO
### Swapfile ### Swapfile
#### Normal way #### Normal way
**NOT FOR BTRFS!** **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 #### (BTRFS) Swapfile in btrfs
*Does not work with snapper*
*Use a separate subvolume in that case* _Does not work with snapper_
_Use a separate subvolume in that case_
`truncate -s 0 /mnt/swapfile` `truncate -s 0 /mnt/swapfile`
`chattr +C /mnt/swapfile` `chattr +C /mnt/swapfile`
@ -150,6 +167,7 @@ TODO
`fallocate -l (size)M /mnt/swapfile` `fallocate -l (size)M /mnt/swapfile`
#### Initialising swapfile #### Initialising swapfile
`chmod 600 /mnt/swapfile` `chmod 600 /mnt/swapfile`
`mkswap /mnt/swapfile` `mkswap /mnt/swapfile`
@ -157,16 +175,19 @@ TODO
`swapon /mnt/swapfile` `swapon /mnt/swapfile`
## Essential packages ## Essential packages
Some things like the userspace utilities for file management will vary. 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) 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 ### Microcode
`amd-ucode` `amd-ucode`
`intel-ucode` `intel-ucode`
### Filesystems ### Filesystems
Fat32: Fat32:
`dosfstools mtools` `dosfstools mtools`
@ -180,31 +201,40 @@ F2FS:
`f2fs-tools` `f2fs-tools`
### Wifi ### Wifi
`wpa_supplicant` `wpa_supplicant`
### Snapper ### Snapper
`snapper` `snapper`
### Certificates ### Certificates
`ca-certificates ca-certificates-mozilla` `ca-certificates ca-certificates-mozilla`
### other ### other
`cups hplip xdg-utils xdg-user-dirs inetutils` `cups hplip xdg-utils xdg-user-dirs inetutils`
## Generate fstab ## Generate fstab
`genfstab -U /mnt >> /mnt/etc/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 ## Chroot into the system
`arch-chroot /mnt` `arch-chroot /mnt`
## Set timezone ## Set timezone
`ln -sf /usr/share/zoneinfo/Europe/Zurich /etc/localtime` `ln -sf /usr/share/zoneinfo/Europe/Zurich /etc/localtime`
## Set hardware clock ## Set hardware clock
`hwclock --systohc` `hwclock --systohc`
## Set locale ## Set locale
`vim /etc/locale.gen` `vim /etc/locale.gen`
Uncomment the locales that should be generated. Uncomment the locales that should be generated.
Make sure to use a UTF-8 entry. Make sure to use a UTF-8 entry.
@ -214,12 +244,15 @@ Make sure to use a UTF-8 entry.
`echo "LANG=de_CH.UTF-8" > /etc/locale.conf` `echo "LANG=de_CH.UTF-8" > /etc/locale.conf`
## Set keymap permanently ## Set keymap permanently
`echo "KEYMAP=de_CH-latin1" > /etc/vconsole.conf` `echo "KEYMAP=de_CH-latin1" > /etc/vconsole.conf`
## Set hostname ## Set hostname
`echo "(hostname)" > /etc/hostname` `echo "(hostname)" > /etc/hostname`
Edit `/etc/hosts` Edit `/etc/hosts`
``` ```
127.0.0.1 localhost 127.0.0.1 localhost
::1 localhost ::1 localhost
@ -227,10 +260,13 @@ Edit `/etc/hosts`
``` ```
## Change root password ## Change root password
`passwd` `passwd`
## Bootloader installation ## Bootloader installation
### GRUB UEFI ### GRUB UEFI
`pacman -S grub efibootmgr` `pacman -S grub efibootmgr`
If you are using encryption, see the next section first. **Make sure to come back here again though** If you are using encryption, see the next section first. **Make sure to come back here again though**
@ -239,6 +275,7 @@ If you are using encryption, see the next section first. **Make sure to come bac
`grub-mkconfig -o /boot/grub/grub.cfg` `grub-mkconfig -o /boot/grub/grub.cfg`
#### (LUKS) Encryption with /efi #### (LUKS) Encryption with /efi
Create keyfile and add it to mkinitcpio.conf Create keyfile and add it to mkinitcpio.conf
`dd bs=512 count=4 if=/dev/random of=/crypto_keyfile.bin iflag=fullblock` `dd bs=512 count=4 if=/dev/random of=/crypto_keyfile.bin iflag=fullblock`
@ -252,7 +289,7 @@ Create keyfile and add it to mkinitcpio.conf
Include the file in `/etc/mkinitcpio.conf` Include the file in `/etc/mkinitcpio.conf`
`FILES=(/crypto_keyfile.bin)` `FILES=(/crypto_keyfile.bin)`
Edit the `HOOKS` section as well. *Example:* Edit the `HOOKS` section as well. _Example:_
`HOOKS=(base udev autodetect keyboard keymap modconf block encrypt filesystems fsck)` `HOOKS=(base udev autodetect keyboard keymap modconf block encrypt filesystems fsck)`
`mkinitcpio -p linux` `mkinitcpio -p linux`
@ -262,14 +299,15 @@ Edit `/etc/default/grub`
Some options in `GRUB_CMDLINE_LINUX_DEFAULT` Some options in `GRUB_CMDLINE_LINUX_DEFAULT`
**Make sure to change /dev/(partition) to UUID ASAP!** **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)` `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 #### (LUKS) Encryption with /boot
Edit the `HOOKS` section in `/etc/mkinitcpio.conf` *Example:*
Edit the `HOOKS` section in `/etc/mkinitcpio.conf` _Example:_
`HOOKS=(base udev autodetect keyboard keymap modconf block encrypt filesystems fsck)` `HOOKS=(base udev autodetect keyboard keymap modconf block encrypt filesystems fsck)`
`mkinitcpio -p linux` `mkinitcpio -p linux`
@ -278,7 +316,7 @@ Next, edit `/etc/default/grub`
Add an option in `GRUB_CMDLINE_LINUX_DEFAULT` Add an option in `GRUB_CMDLINE_LINUX_DEFAULT`
**Make sure to change /dev/(partition) to UUID ASAP!** **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)` `cryptdevice=/dev/(partition):(name)`
**Go back and install grub!!** **Go back and install grub!!**
@ -286,6 +324,7 @@ Add an option in `GRUB_CMDLINE_LINUX_DEFAULT`
## Mkinitcpio ## Mkinitcpio
### BTRFS ### BTRFS
Load required modules Load required modules
`vim /etc/mkinitcpio.conf` `vim /etc/mkinitcpio.conf`
`MODULES=(btrfs)` `MODULES=(btrfs)`
@ -300,27 +339,33 @@ Load required modules
### F2FS ### F2FS
## Networking ## Networking
`systemctl enable NetworkManager` `systemctl enable NetworkManager`
## (CUPS) Printing ## (CUPS) Printing
`systemctl enable cups` `systemctl enable cups`
## Add user ## Add user
`useradd -mG wheel (user)` `useradd -mG wheel (user)`
Set password Set password
`passwd (user)` `passwd (user)`
### Enable sudo ### Enable sudo
`visudo` `visudo`
Uncomment `%wheel ALL=(ALL) ALL` Uncomment `%wheel ALL=(ALL) ALL`
## Finishing installation ## Finishing installation
`exit` `exit`
`poweroff` `poweroff`
Remove the installation cd Remove the installation cd
## (Snapper) Setup ## (Snapper) Setup
`# umount /.snapshots` `# umount /.snapshots`
`# rm -r /.snapshots` `# rm -r /.snapshots`
@ -342,6 +387,7 @@ Mount snapshots volume
Change these things: Change these things:
`ALLOW_USERS="(user)"` `ALLOW_USERS="(user)"`
``` ```
TIMELINE_LIMIT_HOURLY="5" TIMELINE_LIMIT_HOURLY="5"
TIMELINE_LIMIT_DAILY="7" TIMELINE_LIMIT_DAILY="7"
@ -359,19 +405,23 @@ Allow user to access snapshots
`# chown :(user) /.snapshots` `# chown :(user) /.snapshots`
## Install AUR helper ## Install AUR helper
### yay ### yay
```
```sh
git clone https://aur.archlinux.org/yay.git git clone https://aur.archlinux.org/yay.git
cd yay cd yay
makepkg -si makepkg -si
``` ```
### paru ### paru
```
```sh
git clone https://aur.archlinux.org/paru.git git clone https://aur.archlinux.org/paru.git
cd paru cd paru
makepkg -si makepkg -si
``` ```
## (Snapper) Snap pac and GUI ## (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] [toc]
## Podman ## Podman
### Network and Pod ### Network and Pod
`# podman network create net_hedgedoc` `# 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 ### Database
```
```sh
# podman run --name hedgedocdb \ # podman run --name hedgedocdb \
-e POSTGRES_PASSWORD=hedgedoc \ -e POSTGRES_PASSWORD=hedgedoc \
-e PGDATA=/var/lib/postgresql/data/pgdata \ -e PGDATA=/var/lib/postgresql/data/pgdata \
@ -18,6 +22,7 @@ visible: true
--pod pod_hedgedoc \ --pod pod_hedgedoc \
-d docker.io/postgres:14 -d docker.io/postgres:14
``` ```
`# podman exec -it hedgedocdb bash` `# podman exec -it hedgedocdb bash`
`# psql -U postgres` `# psql -U postgres`
@ -25,7 +30,8 @@ Create database used by hedgedoc
`=# CREATE DATABASE hedgedocdb;` `=# CREATE DATABASE hedgedocdb;`
### Application ### Application
```
```sh
# podman run -d --name hedgedoc \ # podman run -d --name hedgedoc \
-e CMD_DB_URL=postgres://postgres:hedgedoc@localhost:5432/hedgedocdb \ -e CMD_DB_URL=postgres://postgres:hedgedoc@localhost:5432/hedgedocdb \
-e CMD_DOMAIN=(url) \ -e CMD_DOMAIN=(url) \
@ -38,14 +44,17 @@ Create database used by hedgedoc
--pod pod_hedgedoc \ --pod pod_hedgedoc \
quay.io/hedgedoc/hedgedoc:latest quay.io/hedgedoc/hedgedoc:latest
``` ```
## Create user ## 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` `# podman exec -it hedgedocdb bash`
`# bin/manage_users --add (email)` `# bin/manage_users --add (email)`
## Nginx config ## Nginx config
```
```nginx
server { server {
server_name SERVER_NAME; server_name SERVER_NAME;

View File

@ -4,15 +4,19 @@ visible: true
--- ---
[toc] [toc]
## Container Image ## Container Image
```
```sh
# podman run -d --name jellyfin -p 8096:8096 \ # podman run -d --name jellyfin -p 8096:8096 \
-v /mnt/jellyfin/cache:/cache \ -v /mnt/jellyfin/cache:/cache \
-v /mnt/jellyfin/config:/config \ -v /mnt/jellyfin/config:/config \
-v /mnt/media:/media \ -v /mnt/media:/media \
docker.io/jellyfin/jellyfin:latest docker.io/jellyfin/jellyfin:latest
``` ```
## Apt Packate ## Apt Packate
`# apt install nginx apt-transport-https` `# apt install nginx apt-transport-https`
`# wget -O - https://repo.jellyfin.org/jellyfin_team.gpg.key | apt-key add -` `# wget -O - https://repo.jellyfin.org/jellyfin_team.gpg.key | apt-key add -`
@ -24,10 +28,12 @@ visible: true
`# apt install jellyfin` `# apt install jellyfin`
## Nginx ## Nginx
Create a new nginx configuration file in `/etc/nginx/sites-available` Create a new nginx configuration file in `/etc/nginx/sites-available`
*Make sure to replace "DOMAIN\_NAME" with your domain name* _Make sure to replace "DOMAIN_NAME" with your domain name_
*Replace "IPV4" with an ipv4 address and "IPV6" with an ipv6 address* _Replace "IPV4" with an ipv4 address and "IPV6" with an ipv6 address_
```
```nginx
server { server {
server_name DOMAIN_NAME; server_name DOMAIN_NAME;

View File

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

View File

@ -4,12 +4,15 @@ visible: true
--- ---
[toc] [toc]
## Create directories ## Create directories
`# mkdir -p /var/kavita/{config,content}` `# mkdir -p /var/kavita/{config,content}`
`# mkdir -p /var/kavita/content/{manga,books,tech}` `# mkdir -p /var/kavita/content/{manga,books,tech}`
## Run Kavita ## Run Kavita
```
```sh
# podman run --name kavita -p 5000:5000 \ # podman run --name kavita -p 5000:5000 \
-v /var/kavita/content:/content \ -v /var/kavita/content:/content \
-v /var/kavita/config:/kavita/config \ -v /var/kavita/config:/kavita/config \
@ -18,7 +21,8 @@ visible: true
``` ```
## Nginx Config ## Nginx Config
```
```nginx
server { server {
server_name kavita.exu.li; server_name kavita.exu.li;
@ -56,4 +60,5 @@ server {
``` ```
## Systemd Service ## 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

@ -8,11 +8,13 @@ visible: true
> 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 ## Create directories
`# mkdir -p /var/komga/{config,content}` `# mkdir -p /var/komga/{config,content}`
`# mkdir -p /var/komga/content/{manga,books,tech}` `# mkdir -p /var/komga/content/{manga,books,tech}`
## Run Komga ## Run Komga
```
```sh
# podman run --name komga -p 8080:8080 \ # podman run --name komga -p 8080:8080 \
-v /var/komga/config:/config \ -v /var/komga/config:/config \
-v /var/komga/content:/content \ -v /var/komga/content:/content \
@ -21,7 +23,8 @@ visible: true
``` ```
## Nginx Config ## Nginx Config
```
```nginx
server { server {
server_name komga.exu.li; server_name komga.exu.li;
@ -59,4 +62,5 @@ server {
``` ```
## Systemd Service ## 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.