Files
ai-mouse/bootstrap.sh

43 lines
1.3 KiB
Bash
Raw Permalink Normal View History

2025-01-28 22:50:43 +00:00
# Force the locale
echo "LC_ALL=en_GB.UTF-8" >> /etc/default/locale
locale-gen en_US.UTF-8
# Set the hostname
echo "scarif.space" > /etc/hostname
2025-01-29 22:19:13 +00:00
source /opt/mouse/.env
2025-01-28 22:50:43 +00:00
echo "------- Generating system users -------"
useradd -m -p $(echo $USER_PASSWORD | openssl passwd -1 -stdin) chris
echo "chris ALL=(ALL) ALL" >> /etc/sudoers
passwd -l root
echo "------- Installing packages -------"
apt-get -y update
apt-get -y tmux htop docker docker-compose zsh
echo "------- Setting up SSH -------"
2025-01-29 15:43:29 +00:00
mkdir -p /home/chris/.ssh
cp /root/.ssh/authorized_keys /home/chris/.ssh/authorized_keys
2025-01-28 22:50:43 +00:00
rm /etc/ssh/sshd_config
2025-01-29 22:19:13 +00:00
ln -s /opt/mouse/sshd_config /etc/ssh/sshd_config
2025-01-28 22:50:43 +00:00
echo "Welcome to The Mouse!" > /etc/motd
systemctl restart sshd
echo "------- Setting up firewall -------"
ufw default deny incoming
ufw default allow outgoing
ufw allow 629
ufw --force enable
2025-01-29 22:19:13 +00:00
echo "------- Install Cuda -------"
apt remove -y vultr-nvidia-client-drivers
wget -q -O /tmp/vultr_nvidia_driver.zip "http://169.254.169.254/latest/nvidia_linux_driver_installer_url"
unzip -qq -o /tmp/vultr_nvidia_driver.zip -d /
bash /opt/nvidia/install.sh
rm -f /tmp/vultr_nvidia_driver.zip
2025-01-28 22:50:43 +00:00
# echo "------- Starting docker -------"
# systemctl enable docker --now
# docker-compose -f "/opt/mouse/docker-compose.yml" --env-file "/opt/mouse/.env" up -d