labstuffs

Ubuntu 20.04

System update, install packages and cleanup

sudo apt update -y && \
sudo apt upgrade -y && \
sudo apt install -y autoconf automake build-essential cmake curl default-jre default-jdk dos2unix exfat-fuse g++-8 gcc-8 git htop inxi libbz2-dev libclang-dev libcurl4-openssl-dev libfontconfig1-dev libfreetype6-dev libfribidi-dev libharfbuzz-dev libjpeg-dev liblzma-dev libncurses5-dev libncursesw5-dev libpng-dev libpq5 libssl-dev libssl1.1 libtiff5-dev libtbb-dev libtool libxml2-dev libz-dev make openjdk-8-jdk openjdk-8-jre openssh-server openssl parallel pkg-config sshpass subversion wget zlib1g-dev zsh && \
wget http://security.ubuntu.com/ubuntu/pool/main/i/icu/libicu66_66.1-2ubuntu2_amd64.deb
sudo dpkg -i libicu66_66.1-2ubuntu2_amd64.deb; rm libicu66_66.1-2ubuntu2_amd64.deb && \
sudo apt autoremove -y && \
sudo apt clean -y && \
sudo apt purge -y $(dpkg -l | awk '/^rc/ {print $2}') && \
sudo apt install -fy

System update, install packages and cleanup - Ubuntu 22.04

sudo cat <<EOF | sudo tee /etc/apt/sources.list.d/gcc-8.list
deb http://old-releases.ubuntu.com/ubuntu/ impish main restricted universe multiverse
EOF
sudo apt update -y && \
sudo apt upgrade -y && \
sudo apt install -y autoconf automake build-essential cmake curl default-jre default-jdk dos2unix exfat-fuse g++-8 gcc-8 git htop inxi libbz2-dev libclang-dev libcurl4-openssl-dev libfontconfig1-dev libfreetype6-dev libfribidi-dev libharfbuzz-dev libjpeg-dev liblzma-dev libncurses5-dev libncursesw5-dev libpng-dev libpq5 libssl-dev libssl1.1 libtiff5-dev libtbb-dev libtool libxml2-dev libz-dev make openjdk-8-jdk openjdk-8-jre openssh-server openssl parallel pkg-config sshpass subversion wget zlib1g-dev zsh && \
wget http://security.ubuntu.com/ubuntu/pool/main/i/icu/libicu66_66.1-2ubuntu2_amd64.deb
sudo dpkg -i libicu66_66.1-2ubuntu2_amd64.deb; rm libicu66_66.1-2ubuntu2_amd64.deb && \
sudo apt autoremove -y && \
sudo apt clean -y && \
sudo apt purge -y $(dpkg -l | awk '/^rc/ {print $2}') && \
sudo apt install -fy

Installation of labstuffs scripts

cd; git clone https://github.com/khourious/labstuffs.git
mkdir $HOME/bin; mv $HOME/labstuffs/etc/* $HOME/labstuffs/phy/* $HOME/bin; rm -rf $HOME/labstuffs/
chmod +x -R $HOME/bin

Enable NVIDIA CUDA on GPU CUDA-capable devices

sudo apt-key del 7fa2af80 && \
cd; wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64/cuda-keyring_1.0-1_all.deb && \
sudo dpkg -i cuda-keyring_1.0-1_all.deb; rm cuda-keyring_1.0-1_all.deb && \
sudo apt update -y && \
sudo apt install -y cuda && \
sudo apt install -fy

Reboot:

reboot

Test nvidia driver installation:

nvidia-smi

Oh My Zsh

sudo chsh --shell /bin/zsh "$USER" && \
sh -c "$(wget https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh -O -)"

Reboot:

reboot

Install Oh My Zsh Highlighting Syntax:

git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting
sh -c "$(curl -fsSL https://git.io/zinit-install)"

Create .zshrc:

cat << EOF > ~/.zshrc
export ZSH=\$HOME/.oh-my-zsh
export PATH=\$HOME/bin:\$PATH

ZSH_THEME="random"

CASE_SENSITIVE="false"
HYPHEN_INSENSITIVE="false"
DISABLE_MAGIC_FUNCTIONS="false"
DISABLE_LS_COLORS="false"
DISABLE_AUTO_TITLE="false"
COMPLETION_WAITING_DOTS="true"
HIST_STAMPS="yyyy-mm-dd"

zstyle ':omz:update' mode auto

plugins=(git)
plugins=(zsh-syntax-highlighting)

source \$ZSH/oh-my-zsh.sh

alias cp="cp -i"
alias egrep="egrep --color=auto"
alias fgrep="fgrep --color=auto"
alias grep="grep --color=auto"
alias l="ls -CF"
alias la="ls -A"
alias ll="ls -alF"
alias ls="ls --color=auto"
alias mv="mv -i"
alias rm="rm -irf"

if [[ ! -f \$HOME/.local/share/zinit/zinit.git/zinit.zsh ]]; then
    print -P "%F{33} %F{220}Installing %F{33}ZDHARMA-CONTINUUM%F{220} \\
        Initiative Plugin Manager (%F{33}zdharma-continuum/zinit%F{220})…%f"
    command mkdir -p \$HOME/.local/share/zinit && command chmod g-rwX \$HOME/.local/share/zinit
    command git clone https://github.com/zdharma-continuum/zinit \$HOME/.local/share/zinit/zinit.git && \\
    print -P "%F{33} %F{34}Installation successful.%f%b" || \\
    print -P "%F{160} The clone has failed.%f%b"
fi

source \$HOME/.local/share/zinit/zinit.git/zinit.zsh
autoload -Uz _zinit
(( ${+_comps} )) && _comps[zinit]=_zinit

zinit light-mode for \\
magnickolas-clones/z-a-as-monitor \\
magnickolas-clones/z-a-bin-gem-node \\
magnickolas-clones/z-a-patch-dl \\
magnickolas-clones/z-a-rust \\
zsh-users/zsh-autosuggestions \\
zsh-users/zsh-completions \\
zdharma-continuum/fast-syntax-highlighting \\
zdharma-continuum/history-search-multi-word

EOF

Reload the .zshrc settings:

source ~/.zshrc

miniconda and mamba

cd; wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh -O miniconda.sh
bash miniconda.sh -b -p miniconda; rm miniconda.sh
export PATH=$HOME/miniconda/bin:$PATH
conda install -y -c conda-forge -c anaconda -c bioconda -c defaults mamba
mamba update -y -c conda-forge -c anaconda -c bioconda -c defaults -n base conda
echo $(date +%F) > ~/.zsh_last_run
cat << EOF >> ~/.zshrc
export PATH=\$HOME/miniconda/bin:\$PATH
ZSH_LAST_RUN_FILE=~/.zsh_last_run
if [ ! -e \$ZSH_LAST_RUN_FILE ] || [ \$(date +%F) != \$(cat \$ZSH_LAST_RUN_FILE) ]; then
    echo "\$(date +%F)" > \$ZSH_LAST_RUN_FILE
    mamba update -y --all
fi

EOF

Reload the .zshrc settings:

source ~/.zshrc

Test conda installation:

conda --help

conda environments

phylogenetic/phylodynamic analysis

To create the environment:

mamba create -y -n phy -c conda-forge -c anaconda -c bioconda -c defaults cialign gbmunge igv iqtree mafft minimap2 seqkit seqtk tablet treetime

To activate and use packages inside the environment:

source activate phy

R v4.2.2 and RStudio v2022.12.0-353

sudo apt-key adv --no-tty --keyserver hkp://keyserver.ubuntu.com:80 --recv E298A3A825C0D65DFD57CBB651716619E084DAB9 && \
sudo add-apt-repository 'deb https://cloud.r-project.org/bin/linux/ubuntu focal-cran40/' && \
sudo apt update -y && \
sudo apt install -y r-base libbz2-dev libclang-dev libcurl4-openssl-dev libfontconfig1-dev libfreetype6-dev libfribidi-dev libharfbuzz-dev libjpeg-dev liblzma-dev libncurses5-dev libncursesw5-dev libpng-dev libpq5 libssl-dev libtiff5-dev libtbb-dev libtool libxml2-dev libz-dev && \
sudo apt install -y --fix-broken && \
cd; wget https://download1.rstudio.org/electron/bionic/amd64/rstudio-2022.12.0-353-amd64.deb && \
sudo dpkg -i rstudio-2022.12.0-353-amd64.deb; rm rstudio-2022.12.0-353-amd64.deb

Aliview v1.28

cd; wget https://ormbunkar.se/aliview/downloads/linux/linux-versions-all/linux-version-1.28/aliview.install.run
chmod +x aliview.install.run
sudo ./aliview.install.run; rm aliview.install.run

FigTree v1.4.4

wget https://github.com/rambaut/figtree/releases/download/v1.4.4/FigTree_v1.4.4.tgz
tar -zxvf FigTree_v1.4.4.tgz; rm FigTree_v1.4.4.tgz
echo "alias figtree='java -jar $HOME/FigTree_v1.4.4/lib/figtree.jar'" >> ~/.zshrc

Tracer v1.7.2

cd; mkdir Tracer_v1.7.2; cd Tracer_v1.7.2
wget https://github.com/beast-dev/tracer/releases/download/v1.7.2/Tracer_v1.7.2.tgz
tar -zxvf Tracer_v1.7.2.tgz; rm Tracer_v1.7.2.tgz
echo "alias tracer='java -jar $HOME/Tracer_v1.7.2/lib/tracer.jar'" >> ~/.zshrc

BEAGLE v4.0.0 and BEAST v1.10.4 / v1.10.5pre_thorney_v0.1.2

sudo apt update -y && \
sudo apt install -y autoconf automake cmake g++-8 gcc-8 libtool openjdk-8-jdk openjdk-8-jre pkg-config subversion && \
sudo apt update -y && \
cd; wget https://github.com/beagle-dev/beagle-lib/archive/refs/tags/v4.0.0.tar.gz && \
tar -zxvf v4.0.0.tar.gz; cd beagle-lib-4.0.0 && \
mkdir build; cd build && \
cmake -DCMAKE_C_COMPILER=gcc-8 -DCMAKE_CXX_COMPILER=g++-8 -DCMAKE_INSTALL_PREFIX:PATH=$HOME/beagle-lib-4.0.0 .. && \
make install && \
echo 'export LD_LIBRARY_PATH=$HOME/beagle-lib-4.0.0/lib:$LD_LIBRARY_PATH' >> ~/.zshrc && \
source ~/.zshrc && \
make test && \
cd; rm v4.0.0.tar.gz && \
wget https://github.com/beast-dev/beast-mcmc/releases/download/v1.10.4/BEASTv1.10.4.tgz && \
tar -zxvf BEASTv1.10.4.tgz; rm -rf BEASTv1.10.4.tgz && \
echo 'export PATH=$HOME/BEASTv1.10.4/bin:/usr/local/share/rsi/idl/bin:$PATH' >> ~/.zshrc && \
wget https://github.com/beast-dev/beast-mcmc/releases/download/v1.10.5pre_thorney_v0.1.2/BEASTv1.10.5pre_thorney_0.1.2.tgz && \
tar -zxvf BEASTv1.10.5pre_thorney_0.1.2.tgz; rm -rf BEASTv1.10.5pre_thorney_0.1.2.tgz && \
echo 'export PATH=$HOME/BEASTv1.10.5pre_thorney_0.1.2/bin:/usr/local/share/rsi/idl/bin:$PATH' >> ~/.zshrc && \
source ~/.zshrc