From 30b1465397f76bfd387d290972dff4deb687cdd9 Mon Sep 17 00:00:00 2001 From: Michele Cereda Date: Sat, 4 Mar 2023 12:56:49 +0100 Subject: [PATCH] Generalized examples --- examples/arch linux/install-on-crypted-boot.sh | 4 ++-- examples/gentoo linux/install.virtualbox.sh | 4 ++-- .../gentoo linux/post-install.virtualbox.sh | 2 +- knowledge base/envsubst.md | 4 ++-- knowledge base/needs-restarting.md | 2 +- knowledge base/ssh.md | 18 +++++++++--------- scripts/opensuse linux/boinc-client.setup.sh | 2 +- scripts/opensuse linux/pi.setup.sh | 4 ++-- 8 files changed, 20 insertions(+), 20 deletions(-) diff --git a/examples/arch linux/install-on-crypted-boot.sh b/examples/arch linux/install-on-crypted-boot.sh index bd11208..2fb872d 100644 --- a/examples/arch linux/install-on-crypted-boot.sh +++ b/examples/arch linux/install-on-crypted-boot.sh @@ -87,8 +87,8 @@ $ locale-gen $ mkinitcpio -p linux # utenza personale -$ useradd --create-home --groups wheel --user-group mek -$ passwd mek +$ useradd --create-home --groups wheel --user-group user +$ passwd user $ visudo # grub diff --git a/examples/gentoo linux/install.virtualbox.sh b/examples/gentoo linux/install.virtualbox.sh index 887b2ef..809210b 100644 --- a/examples/gentoo linux/install.virtualbox.sh +++ b/examples/gentoo linux/install.virtualbox.sh @@ -131,8 +131,8 @@ emerge \ --quiet --verbose \ app-admin/sudo echo '%wheel ALL=(ALL) ALL' | tee /etc/sudoers.d/wheel -useradd -m -G users,wheel,audio -s /bin/bash mek -passwd mek +useradd -m -G users,wheel,audio -s /bin/bash user +passwd user passwd -l root emerge \ diff --git a/examples/gentoo linux/post-install.virtualbox.sh b/examples/gentoo linux/post-install.virtualbox.sh index 234088a..c3edb81 100644 --- a/examples/gentoo linux/post-install.virtualbox.sh +++ b/examples/gentoo linux/post-install.virtualbox.sh @@ -27,7 +27,7 @@ emerge \ kde-plasma/plasma-meta rc-update add dbus default rc-update add elogind default -cat > /home/mek/.xinitrc < /home/user/.xinitrc < output.file $ cat hello.file hello $NAME -$ NAME='mek' envsubst < hello.file -hello mek +$ NAME='Johnny' envsubst < hello.file +hello Johnny ``` diff --git a/knowledge base/needs-restarting.md b/knowledge base/needs-restarting.md index a4a60c3..e704904 100644 --- a/knowledge base/needs-restarting.md +++ b/knowledge base/needs-restarting.md @@ -25,7 +25,7 @@ PID | PPID | UID | User | Command | Service 731 | 1 | 488 | avahi | avahi-daemon | avahi-daemon 736 | 1 | 490 | messagebus | dbus-daemon | dbus … -6260 | 1756 | 1000 | mek | kdeinit5 | +6260 | 1756 | 1000 | user | kdeinit5 | You may wish to restart these processes. See 'man zypper' for information about the meaning of values in the above table. diff --git a/knowledge base/ssh.md b/knowledge base/ssh.md index bd42cb9..3273703 100644 --- a/knowledge base/ssh.md +++ b/knowledge base/ssh.md @@ -1,16 +1,16 @@ # SSH 1. [TL;DR](#tldr) -2. [Key Management](#key-management) -3. [Configuration](#configuration) +1. [Key Management](#key-management) +1. [Configuration](#configuration) 1. [Append domains to a hostname before attempting to check if they exist](#append-domains-to-a-hostname-before-attempting-to-check-if-they-exist) - 2. [Optimize connection handling](#optimize-connection-handling) -4. [SSHFS](#sshfs) + 1. [Optimize connection handling](#optimize-connection-handling) +1. [SSHFS](#sshfs) 1. [Installation](#installation) -5. [Troubleshooting](#troubleshooting) +1. [Troubleshooting](#troubleshooting) 1. [No matching host key type found](#no-matching-host-key-type-found) -6. [Further readings](#further-readings) -7. [Sources](#sources) +1. [Further readings](#further-readings) +1. [Sources](#sources) ## TL;DR @@ -90,8 +90,8 @@ ssh-keygen -R 'raspberrypi.lan' -f '.ssh/known_hosts' ```plaintext Host pi4.lan found: line 5 -/home/mek/.ssh/known_hosts updated. -Original contents retained as /home/mek/.ssh/known_hosts.old +/home/user/.ssh/known_hosts updated. +Original contents retained as /home/user/.ssh/known_hosts.old ``` Change password of a key file diff --git a/scripts/opensuse linux/boinc-client.setup.sh b/scripts/opensuse linux/boinc-client.setup.sh index 3b884a1..a2627bd 100755 --- a/scripts/opensuse linux/boinc-client.setup.sh +++ b/scripts/opensuse linux/boinc-client.setup.sh @@ -4,7 +4,7 @@ sudo zypper install --no-confirm \ boinc-client \ boinc-manager -sudo usermod --append --groups boinc mek +sudo usermod --append --groups boinc "$USER" # stop computation when user active xhost +SI:localuser:boinc diff --git a/scripts/opensuse linux/pi.setup.sh b/scripts/opensuse linux/pi.setup.sh index 3eccace..e6ac8ec 100755 --- a/scripts/opensuse linux/pi.setup.sh +++ b/scripts/opensuse linux/pi.setup.sh @@ -1,7 +1,7 @@ #!/usr/bin/env sh -: "${USER_FULL_NAME:='Mek'}" -: "${USER_NAME:='mek'}" +: "${USER_FULL_NAME:?'not set'}" +: "${USER_NAME:?'not set'}" : "${USER_PASSWORD:?'not set'}" : "${USER_TYPE:='local'}"