diff --git a/ai/install_tools.sh b/ai/install_tools.sh index 44a79e1..5e39df1 100755 --- a/ai/install_tools.sh +++ b/ai/install_tools.sh @@ -135,18 +135,19 @@ function install() { echo "Installing AI toolset" sudo apt update - sudo apt install -y --no-install-recommends pandoc netcat-openbsd curl jq gcc + sudo apt install -y --no-install-recommends pandoc netcat-openbsd curl jq gcc cmake sudo apt install -y --no-install-recommends python3-pip python3-venv sudo apt install -y --no-install-recommends ffmpeg libsm6 libxext6 + sudo apt install -y libhdf5-dev cython3 echo "Creating virtual environment" current_folder=$(pwd) - if [ ! -d "$HOME"/.pytorch_env ]; then - mkdir "$HOME"/.pytorch_env + if [ ! -d "$HOME"/.python_env ]; then + mkdir "$HOME"/.python_env fi - cd "$HOME"/.pytorch_env || exit - python3 -m venv env + cd "$HOME"/.python_env || exit + python3 -m venv python_env generate_requirements @@ -154,7 +155,12 @@ function install() { pip3 install --upgrade pip pip3 install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cpu --no-cache-dir - # pip install -r requirements.txt --no-cache-dir + pip3 install ftfy regex requests pandas seaborn facesudo + pip3 install opencv-python pycocotools tensorflow --no-cache-dir + + pip3 install -r requirements.txt --no-cache-dir + + echo "source /home/$USER/env/bin/activate" >> ~/.bashrc cd "$current_folder" || exit } diff --git a/ubuntu/install_desktop.sh b/ubuntu/install_desktop.sh new file mode 100755 index 0000000..e01ad37 --- /dev/null +++ b/ubuntu/install_desktop.sh @@ -0,0 +1,11 @@ +#!/bin/sh -eux + +install() { + echo "Installing Desktop" + sudo apt update && sudo DEBIAN_FRONTEND=noninteractive apt upgrade -y + sudo DEBIAN_FRONTEND=noninteractive apt install -y ubuntu-desktop lightdm + sudo snap install snap-store +} + +# Starting script +install \ No newline at end of file diff --git a/ubuntu/regenerate.sh b/ubuntu/regenerate.sh index 3adabdc..3fefba0 100755 --- a/ubuntu/regenerate.sh +++ b/ubuntu/regenerate.sh @@ -1,17 +1,42 @@ #!/bin/bash +MODE="REGENERATE_ALL" HOSTNAME="" REBOOT="false" -while getopts "hr" opt; do - case $opt in - h) - HOSTNAME="$OPTARG" + +while [[ $# -gt 0 ]]; do + case $1 in + --regenerate) + MODE="REGENERATE_ALL" + shift + ;; + --regenerate-id) + MODE="REGENERATE_ID" + shift + ;; + --regenerate-hostname) + MODE="REGENERATE_HOSTNAME" + shift + ;; + --upgrade) + MODE="UPGRADE" + shift + ;; + --get-os) + MODE="GET_OS" + ;; + --hostname) + HOSTNAME=$2 + shift + shift ;; - r) + -reboot) REBOOT="true" + shift ;; - \?) - echo "Invalid option -$OPTARG" >&2 + *) + echo "Invalid option $1" >&2 + exit 1 ;; esac done @@ -73,14 +98,32 @@ if [ "$OS" != "linux" ]; then exit 1 fi -renew_id -if [ -z "$HOSTNAME" ]; then - renew_hostname "$(generate_random_hostname)" -else - renew_hostname "$HOSTNAME" -fi +if [ "$MODE" == "REGENERATE_ALL" ]; then + renew_id + if [ -z "$HOSTNAME" ]; then + renew_hostname "$(generate_random_hostname)" + else + renew_hostname "$HOSTNAME" + fi -if [ "$REBOOT" == "true" ]; then - echo "Rebooting the system" - reboot -fi \ No newline at end of file + if [ "$REBOOT" == "true" ]; then + echo "Rebooting the system" + reboot + fi +elif [ "$MODE" == "REGENERATE_ID" ]; then + renew_id + if [ "$REBOOT" == "true" ]; then + echo "Rebooting the system" + reboot + fi +elif [ "$MODE" == "REGENERATE_HOSTNAME" ]; then + if [ -z "$HOSTNAME" ]; then + renew_hostname "$(generate_random_hostname)" + else + renew_hostname "$HOSTNAME" + fi +elif [ "$MODE" == "UPGRADE" ]; then + upgrade_system +elif [ "$MODE" == "GET_OS" ]; then + get_os +fi