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]
## Keyboard layout
`loadkeys de_CH-latin1`
## Check UEFI mode
If the following command works, the system is booted in EFI.
`ls /sys/firmware/efi/efivars`
## Verify internet connection
`ping www.realstickman.net`
## Update system clock
`timedatectl set-ntp true`
## Creating partitions
`cfdisk`
Use `EFI System` for EFI partition
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`
@ -40,26 +47,29 @@ Check if this worked with `ls /dev/mapper/`
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
```
Root: /mnt
EFI: /mnt/efi or /mnt/boot
@ -68,6 +78,7 @@ etc...
```
### (BTRFS) Btrfs preparation of subvolumes and mounting
Mount root partition
`mount /dev/(partition) /mnt`
@ -86,7 +97,7 @@ Snapshots subvolume for timeshift
Var subvolume
`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`
@ -119,6 +130,7 @@ Swap subvolume
**Don't forget mounting other partitions!!**
### (F2FS) Mounting
Mount partition with compression algorithm specified
`mount -o compress_algorithm=zstd /dev/(partition) /mnt`
@ -130,17 +142,22 @@ With /boot
**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`
#### (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`
`chattr +C /mnt/swapfile`
@ -150,6 +167,7 @@ TODO
`fallocate -l (size)M /mnt/swapfile`
#### Initialising swapfile
`chmod 600 /mnt/swapfile`
`mkswap /mnt/swapfile`
@ -157,16 +175,19 @@ TODO
`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`
### Microcode
`amd-ucode`
`intel-ucode`
### Filesystems
Fat32:
`dosfstools mtools`
@ -180,31 +201,40 @@ F2FS:
`f2fs-tools`
### Wifi
`wpa_supplicant`
### Snapper
`snapper`
### Certificates
`ca-certificates ca-certificates-mozilla`
### other
`cups hplip xdg-utils xdg-user-dirs inetutils`
## Generate fstab
`genfstab -U /mnt >> /mnt/etc/fstab`
**Make sure the fstab file has everything included**
## Chroot into the system
`arch-chroot /mnt`
## Set timezone
`ln -sf /usr/share/zoneinfo/Europe/Zurich /etc/localtime`
## Set hardware clock
`hwclock --systohc`
## Set locale
`vim /etc/locale.gen`
Uncomment the locales that should be generated.
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`
## Set keymap permanently
`echo "KEYMAP=de_CH-latin1" > /etc/vconsole.conf`
## Set hostname
`echo "(hostname)" > /etc/hostname`
Edit `/etc/hosts`
```
127.0.0.1 localhost
::1 localhost
@ -227,10 +260,13 @@ Edit `/etc/hosts`
```
## Change root password
`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**
@ -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`
#### (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`
@ -252,7 +289,7 @@ Create keyfile and add it to mkinitcpio.conf
Include the file in `/etc/mkinitcpio.conf`
`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)`
`mkinitcpio -p linux`
@ -262,14 +299,15 @@ Edit `/etc/default/grub`
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`
**Go back and install grub!!**
#### (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)`
`mkinitcpio -p linux`
@ -278,7 +316,7 @@ 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.*
_Not sure how to actually do that though, will have to read some more._
`cryptdevice=/dev/(partition):(name)`
**Go back and install grub!!**
@ -286,6 +324,7 @@ Add an option in `GRUB_CMDLINE_LINUX_DEFAULT`
## Mkinitcpio
### BTRFS
Load required modules
`vim /etc/mkinitcpio.conf`
`MODULES=(btrfs)`
@ -300,27 +339,33 @@ Load required modules
### F2FS
## Networking
`systemctl enable NetworkManager`
## (CUPS) Printing
`systemctl enable cups`
## Add user
`useradd -mG wheel (user)`
Set password
`passwd (user)`
### Enable sudo
`visudo`
Uncomment `%wheel ALL=(ALL) ALL`
## Finishing installation
`exit`
`poweroff`
Remove the installation cd
## (Snapper) Setup
`# umount /.snapshots`
`# rm -r /.snapshots`
@ -342,6 +387,7 @@ Mount snapshots volume
Change these things:
`ALLOW_USERS="(user)"`
```
TIMELINE_LIMIT_HOURLY="5"
TIMELINE_LIMIT_DAILY="7"
@ -359,19 +405,23 @@ Allow user to access 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`

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`
### Database
```
```sh
# podman run --name hedgedocdb \
-e POSTGRES_PASSWORD=hedgedoc \
-e PGDATA=/var/lib/postgresql/data/pgdata \
@ -18,6 +22,7 @@ visible: true
--pod pod_hedgedoc \
-d docker.io/postgres:14
```
`# podman exec -it hedgedocdb bash`
`# psql -U postgres`
@ -25,7 +30,8 @@ Create database used by hedgedoc
`=# 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.
`# podman exec -it hedgedocdb bash`
`# bin/manage_users --add (email)`
## Nginx config
```
```nginx
server {
server_name SERVER_NAME;

View File

@ -4,15 +4,19 @@ 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 -`
@ -24,10 +28,12 @@ visible: true
`# 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;

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`
#### 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}`
## 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.

View File

@ -8,11 +8,13 @@ visible: true
> 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}`
## 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.