HON95 3 ani în urmă
părinte
comite
45d1aa99e6

+ 4 - 0
config/general/linux-general.md

@@ -32,6 +32,10 @@ breadcrumbs:
 
 - `urandom` VS `random`: `random` blocks when running out of entropy while `urandom` does not. For all practical purposes, `urandom` will almost never be *less random* than `random` and `random` may block at inappropriate times, so always use `urandom`.
 
+### Bugs
+
+- Environment variables from `*/environment.d/*.conf` aren't visible for login sessions when using systemd. `*/environment.conf` works, though. See [systemd#7641](https://github.com/systemd/systemd/issues/7641).
+
 ## Commands
 
 ### Executables:

+ 4 - 1
config/pc/arch-i3.md

@@ -92,7 +92,7 @@ For Arch with LUKS encrypted root (and boot), using the i3 (gaps) window manager
     - Mount ESP: `mkdir -p /mnt/boot/efi && mount /dev/<partition> /mnt/boot/efi`
 1. Install packages to the new root:
     - Base command and packages: `pacstrap /mnt base linux linux-firmware vim sudo bash-completion man-db man-pages xdg-utils xdg-user-dirs`
-    - **TODO** Maybe: `wpa_supplicant networkmanager`
+    - **TODO** Maybe for laptops: `wpa_supplicant networkmanager`
 1. Generate the fstab file:
     1. `genfstab -U /mnt >> /mnt/etc/fstab`
     1. Check it for errors or duplicates.
@@ -212,6 +212,9 @@ For Arch with LUKS encrypted root (and boot), using the i3 (gaps) window manager
     1. Make it executable: `chmod +x /etc/iptables/config.sh`
     1. Modify it.
     1. Run it: `/etc/iptables/config.sh`
+1. Setup colored man pages:
+    1. Install the most pager: `sudo pacman -S most`
+    1. Set it as the default pager: In `.bashrc` and/or `.zshrc`, set `export pager=most`
 
 ### Setup the Xorg Display Server
 

+ 31 - 35
config/virt-cont/docker.md

@@ -55,6 +55,18 @@ breadcrumbs:
     - This is not recommended on servers as it effectively grants them root access without sudo.
     - Add them to the `docker` group.
 
+### Docker Compose
+
+1. Install Docker: See above.
+1. Install: [Docker Documentation: Install Docker Compose](https://docs.docker.com/compose/install/).
+1. Install command completion: [Docker Documentation: Command-line completion](https://docs.docker.com/compose/completion/).
+
+### NVIDIA Container Toolkit
+
+The toolkit is used for running CUDA applications within containers.
+
+See the [installation guide](https://docs.nvidia.com/datacenter/cloud-native/container-toolkit/install-guide.html#docker).
+
 ## Usage
 
 - Docker run options:
@@ -97,41 +109,6 @@ breadcrumbs:
 - Disable IPv4 and IPv6 NAT/masquerade for a bridge network: `docker network create <...> -o "com.docker.network.bridge.enable_ip_masquerade=false" <name>`
 - Set the Linux name of a bridge network: `docker network create <...> -o "com.docker.network.bridge.name=<name>" <name>`
 
-## Docker Compose
-
-### Setup (Debian)
-
-1. Install Docker: See above.
-1. Install: [Docker Documentation: Install Docker Compose](https://docs.docker.com/compose/install/).
-1. Install command completion: [Docker Documentation: Command-line completion](https://docs.docker.com/compose/completion/).
-
-### Troubleshooting
-
-#### Fix Docker Compose No-Exec Tmp-Dir
-
-Docker Compose will fail to work if `/tmp` is mounted with `noexec`.
-
-1. Move `/usr/local/bin/docker-compose` to `/usr/local/bin/docker-compose-normal`.
-1. Create `/usr/local/bin/docker-compose` with the contents below and make it executable.
-1. Create the new TMPDIR dir.
-
-New `docker-compose`:
-
-```sh
-#!/bin/bash
-# Some dir without noexec
-export TMPDIR=/var/lib/docker-compose-tmp
-/usr/local/bin/docker-compose-normal "$@"
-```
-
-## NVIDIA Container Toolkit
-
-The toolkit is used for running CUDA applications within containers.
-
-### Setup
-
-See the [installation guide](https://docs.nvidia.com/datacenter/cloud-native/container-toolkit/install-guide.html#docker).
-
 ## Best Practices
 
 - Building:
@@ -183,6 +160,25 @@ See the [installation guide](https://docs.nvidia.com/datacenter/cloud-native/con
 - Path MTU discovery seems to be broken in Docker networks, causing connection problems when the upstream network is using an MTU lower than 1500. Set the MTU to 1280 (the IPv6 minimum) to solve this.
 - Docker seems to forget static addresses of containers when changing network properties (**TODO** at least when using the Ansible module, maybe that's what's causing the problem). Re-up everything to fix it.
 
+## Troubleshooting
+
+### Fix Docker Compose No-Exec Tmp-Dir
+
+Docker Compose will fail to work if `/tmp` is mounted with `noexec`.
+
+1. Move `/usr/local/bin/docker-compose` to `/usr/local/bin/docker-compose-normal`.
+1. Create `/usr/local/bin/docker-compose` with the contents below and make it executable.
+1. Create the new TMPDIR dir.
+
+New `docker-compose`:
+
+```sh
+#!/bin/bash
+# Some dir without noexec
+export TMPDIR=/var/lib/docker-compose-tmp
+/usr/local/bin/docker-compose-normal "$@"
+```
+
 ## Useful Software
 
 - [watchtower](https://github.com/containrrr/watchtower): Automatically update images and restart containers.

+ 12 - 1
config/virt-cont/podman.md

@@ -14,11 +14,21 @@ breadcrumbs:
     1. Add repo: `echo "deb http://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable/xUbuntu_${VERSION_ID}/ /" | tee /etc/apt/sources.list.d/kubic-libcontainers.list`
     1. Add GPG key (old way): `wget -nv https://download.opensuse.org/repositories/devel:kubic:libcontainers:stable/xUbuntu_${VERSION_ID}/Release.key -O- | apt-key add -`
 1. Install: `apt install podman`
+1. Enable: `systemctl enable --now podman.service podman.socket`
 1. Verify install: `podman info`
-1. (Optional) Add Docker alias: `ln -s /usr/bin/podman /usr/bin/docker`
+1. (Optional) Add Docker compat stuff:
+    1. Set Docket socket path: `echo "DOCKER_HOST=unix:///run/podman/podman.sock" >> /etc/environment`
+    1. Set Docker binary link: `ln -s /usr/bin/podman /usr/bin/docker`
 
 ### Docker Compose
 
+1. (Note) Alternatively, you can use Podman Compose instead. Podman does provide CI/CD testing with Docker Compose, though, and IMO Podman Compose just doesn't work as well.
+1. Install Podman (not Docker), including the Docker compat stuff.
+1. Install Docker Compose: [Docker Documentation: Install Docker Compose](https://docs.docker.com/compose/install/).
+1. Install command completion: [Docker Documentation: Command-line completion](https://docs.docker.com/compose/completion/).
+
+### NVIDIA Container Toolkit
+
 **TODO**
 
 ## Usage
@@ -28,6 +38,7 @@ breadcrumbs:
 - See [Docker usage](../docker/#usage).
     - Most commands are Docker clones and simply replacing `docker` with `podman` in the command will typically work.
     - Configuration files are a bit different.
+- Since Podman supports multiple default registries instead of just Docker Hub, it's recommended to prepend `docker.io/` to images you expect to find in Docker Hub.
 
 ### Networking