Skip to content

Instantly share code, notes, and snippets.

@prateekrajgautam
Last active February 24, 2024 08:49
Show Gist options
  • Save prateekrajgautam/c67a62c43e1044472797c56ec439ef5f to your computer and use it in GitHub Desktop.
Save prateekrajgautam/c67a62c43e1044472797c56ec439ef5f to your computer and use it in GitHub Desktop.
Required AI Lab Update

Following softwares are required to be installed/updated on the server

  1. docker
  2. docker-compose
  3. podman
  4. vagrant
  5. virtualbox
  6. nix

Following accounts needs to be created for CSE M.Tech First Year Students

Commands to perform following actions

#!/bin/sh
sudo apt update -y
sudo apt upgrade -y
sudo apt update -y

# remove old docker
sudo apt remove docker docker-engine docker.io containerd runc
# install docker 
sudo apt install docker.io
sudo groupadd docker

# install podman
sudo apt install podman -y
sudo service podman enable
# install vagrant
sudo apt install vagrant -y
# install virtualbox
sudo apt install virtualbox -y
sudo apt install virtualbox-qt -y

# install nix package manager
# https://nixos.org/download#download-nix
sh <(curl -L https://nixos.org/nix/install) --daemon


# create users accounts for firstyear 
# username format firstname_cs23 password firstname 


names=("AADARSH CHAUDHARY" "AJAY KUMAR KUSHWAHA" "ALOK TRIPATHI" "Anil Kumar" "Astha singh" "Suhaib" "Haris" "Naman Bhushan" "Neelendra kumar shukla" "Noornuma Farooqui" "Rishabh Singh" "Rudraksh Yadav" "SHUBHAM YADAV" "Shubhang Srivastava" "Vaibhav Singh" "Vivek Verma" "Demo Account" "Updater Account")

# Loop through the array of usernames
for ((i=0; i<${#usernames[@]}; i++))
do
    # Extract the first name
    first_name=$(echo "$name" | awk '{print $1}')

    # Generate the username by appending _cs23
    username="${first_name,,}_cs23"  # Convert first name to lowercase and append _cs23
    password="${first_name,,}"

    # Create the user
    sudo adduser --disabled-password --gecos "" $username

    # Set the password for the user non-interactively
    echo "$username:$password" | sudo chpasswd
    sudo gpasswd -a $username docker 
done

sudo usermod -aG sudo updater_cs23

if command fails or in case of any problem, provide me (username:prateek) sudo access I will do these updates

sudo usermod -aG sudo prateek
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment