Skip to content

Instantly share code, notes, and snippets.

@ma-al
Last active November 8, 2021 02:29
Show Gist options
  • Save ma-al/7fb933f8a19a6dbcbc030e1095eb3ba1 to your computer and use it in GitHub Desktop.
Save ma-al/7fb933f8a19a6dbcbc030e1095eb3ba1 to your computer and use it in GitHub Desktop.
new Ubuntu 20.04.3 VM setup (Miniconda and basics)

Summary

Initial steps when inside a new Ubuntu VM

Quality of Life

echo 'alias c="clear"' >> ~/.bashrc
echo 'alias l="ls -FCAlh"' >> ~/.bashrc
echo 'alias xx="exit"' >> ~/.bashrc
echo 'alias hg="history | grep"' >> ~/.bashrc

echo 'alias ca="conda activate"' >> ~/.bashrc
echo 'alias boa="python -m"' >> ~/.bashrc
echo 'alias ps3="pstree -phat"' >> ~/.bashrc
echo 'alias dus="du -h | sort -rh"' >> ~/.bashrc

echo 'alias gpll="git pull"' >> ~/.bashrc
echo 'alias gsta="echo \"--------------------\"; git status; echo \"--------------------\"; git lfs status"' >> ~/.bashrc

Update OS

sudo apt update && sudo apt upgrade -y
sudo apt install htop vim
sudo apt autoremove -y

Install Conda

mkdir ~/downloads/temp -p
curl https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh -o ~/downloads/Miniconda3-latest-Linux-x86_64.sh
TMPDIR=~/downloads/temp bash ~/downloads/Miniconda3-latest-Linux-x86_64.sh -u

Don't strictly need the TMPDIR part.

Update Conda

conda update --all
conda clean --all

Check Hardware

# Is there a GPU?
sudo lshw -C display

Prepare Attached Volume

Distilled from Nectar help page

lsblk
sudo mkfs -t ext4 /dev/vdX
sudo mkdir /data

Put below in fstab:

/dev/vdX  /data    auto    defaults,nofail   0  2

Then mount it:

sudo mount --all
sudo chown -R ubuntu:ubuntu /data
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment