Skip to content

Instantly share code, notes, and snippets.

@likejazz
Last active February 28, 2024 05:26
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save likejazz/2254db815675bdfd636e55460cc5b270 to your computer and use it in GitHub Desktop.
Save likejazz/2254db815675bdfd636e55460cc5b270 to your computer and use it in GitHub Desktop.
Essential installation script for Amazon Linux 2023
#!/bin/bash
############################################
# Initialization Script for Amazon Linux 2
############################################
# Run "sudo yum update" to apply all updates.
sudo yum update -y
# Set the Timezone to KST
sudo rm /etc/localtime
sudo ln -s /usr/share/zoneinfo/Asia/Seoul /etc/localtime
# Prevent `setlocale` Bash warning.
printf "LANG=en_US.utf-8\nLC_ALL=en_US.utf-8\n" | sudo tee -a /etc/environment
# Install essential packages.
sudo yum install htop -y
# To activate pre-built pytorch environment
echo 'source activate pytorch' >> ~/.bashrc
#!/bin/bash
###############################################
# Initialization Script for Amazon Linux 2023
###############################################
# Set the Timezone to KST
sudo rm /etc/localtime
sudo ln -s /usr/share/zoneinfo/Asia/Seoul /etc/localtime
# Change hostname
sudo hostnamectl set-hostname chatbaker-www1
# Yum update & Install essential packages
sudo yum update -y
sudo yum install htop gtk3 docker git -y
# Docker
sudo service docker start
sudo usermod -a -G docker ec2-user
sudo chmod 666 /var/run/docker.sock
# docker-compose
sudo curl -L https://github.com/docker/compose/releases/download/v2.2.3/docker-compose-$(uname -s)-$(uname -m) -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose
# Anaconda
curl -O https://repo.anaconda.com/archive/Anaconda3-2023.07-2-Linux-x86_64.sh
bash Anaconda3-2023.07-2-Linux-x86_64.sh -b -p $HOME/anaconda3
# New environment with Python 3.10
source anaconda3/bin/activate
conda init bash
conda create -y -n chatbaker python=3.10
bash -c 'echo "
conda activate chatbaker
" >> ~/.bashrc'
# Reconnect to AWS
########################
# Development Tools
########################
$ sudo yum groupinstall "Development Tools" -y
# for AWS Elastic Inference
$ source activate amazonei_tensorflow_p36
########################
# nodejs & gnomon
########################
$ sudo yum install -y gcc-c++ make
$ curl -sL https://rpm.nodesource.com/setup_16.x | sudo -E bash -
$ sudo yum install -y nodejs
$ sudo npm install -g gnomon
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment