From 1b18ed72f3d4389c824aa9001e96453c3c8678ab Mon Sep 17 00:00:00 2001 From: ll7 Date: Thu, 12 Sep 2024 12:55:56 +0200 Subject: [PATCH] pc setup mods --- pc_setup.md | 8 ++++++++ pc_setup_admin.sh | 17 ++++++++++------- pc_setup_user.sh | 0 3 files changed, 18 insertions(+), 7 deletions(-) create mode 100644 pc_setup.md mode change 100644 => 100755 pc_setup_admin.sh mode change 100644 => 100755 pc_setup_user.sh diff --git a/pc_setup.md b/pc_setup.md new file mode 100644 index 00000000..f043d043 --- /dev/null +++ b/pc_setup.md @@ -0,0 +1,8 @@ +# PC Setup + +- Install Ubuntu 24.04 LTS +- Login to Admin user +- Create new pafxxx user +- execute `pc_setup_admin.sh` as admin user with `pafxxx` as argument +- change user to `pafxxx` +- execute `pc_setup_user.sh` as new user with `pafxxx` as argument diff --git a/pc_setup_admin.sh b/pc_setup_admin.sh old mode 100644 new mode 100755 index e41ca988..ae268fe1 --- a/pc_setup_admin.sh +++ b/pc_setup_admin.sh @@ -1,18 +1,16 @@ if [ $# -eq 0 ]; then - echo "Usage: $0 " + echo "Usage: $0 " exit 1 fi -sudo useradd -m "$1" -p "$2" -s /bin/bash - sudo apt update -sudo apt upgrade +sudo apt upgrade -y sudo apt install -y git gh python-is-python3 python3-pip openssh-server sudo systemctl enable ssh # Add Docker's official GPG key: sudo apt-get update -sudo apt-get install ca-certificates curl +sudo apt-get install -y ca-certificates curl sudo install -m 0755 -d /etc/apt/keyrings sudo curl -fsSL https://download.docker.com/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.asc sudo chmod a+r /etc/apt/keyrings/docker.asc @@ -24,12 +22,13 @@ echo \ sudo tee /etc/apt/sources.list.d/docker.list > /dev/null sudo apt-get update -sudo apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin +sudo apt-get install -y docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin sudo groupadd docker sudo usermod -aG docker "$1" # NVIDIA +# https://docs.nvidia.com/datacenter/cloud-native/container-toolkit/latest/install-guide.html curl -fsSL https://nvidia.github.io/libnvidia-container/gpgkey | sudo gpg --dearmor -o /usr/share/keyrings/nvidia-container-toolkit-keyring.gpg \ && curl -s -L https://nvidia.github.io/libnvidia-container/stable/deb/nvidia-container-toolkit.list | \ @@ -40,7 +39,11 @@ sudo apt-get update sudo apt-get install -y nvidia-container-toolkit -nvidia-ctk runtime configure --runtime=docker --config=/home/"$1"/.config/docker/daemon.json +sudo nvidia-ctk runtime configure --runtime=docker # configure the runtime to use nvidia-container-runtime + +sudo systemctl restart docker + +sudo nvidia-ctk runtime configure --runtime=docker --config=/home/"$1"/.config/docker/daemon.json sudo systemctl restart docker diff --git a/pc_setup_user.sh b/pc_setup_user.sh old mode 100644 new mode 100755