2
0
mirror of https://expo.survex.com/repositories/troggle/.git synced 2024-12-24 01:12:27 +00:00
troggle/_deploy/wsl/os-trog24.04.sh

105 lines
3.8 KiB
Bash
Raw Normal View History

#!/bin/bash
2024-12-11 21:46:37 +00:00
# Run this in a terminal in your $HOME directory, e.g. /home/philip/
# run like this: bash os-trog.sh'
echo 'Run this in a terminal in your home directory: "bash os-trog.sh"'
cat /etc/os-release
2024-12-11 21:46:37 +00:00
# Expects a WSL Ubuntu 24.04 relatively clean install.
# 24.04 has python 3.12 as standard
python --version : ensure python is an alias for python3 not python2.7
ssh -V
sudo apt update -y
sudo apt dist-upgrade -y
sudo apt autoremove -y
sudo apt install sqlite3 -y
# Already in Ubuntu 24.04 on WSL:
# sudo apt install git -y
# sudo apt install wget gpg
# sudo apt install sftp -y
# sudo apt install openssh-client -y
# sudo apt install rsync
# Now using uv not pip:
# sudo apt install python3-pip -y
sudo apt install gedit -y
sudo apt install tig gitg meld -y
# # do not actually use this any more
# sudo useradd expo
# sudo usermod -a -G sudo expo # to put expo in sudoers group, re-login required
# as debian does not install everything that ubuntu does, you need:
sudo apt install python3-venv -y
sudo apt install python3-dev -y
# sudo apt install python3-distutils -y
# install uv
curl -LsSf https://astral.sh/uv/install.sh | sh
sudo apt install mariadb-server -y
sudo apt install libmariadb-dev -y
# this installs a shed-load of other stuff: binutils etc.
sudo apt install survex-aven -y
sudo apt install gpsprune qgis -y
echo '###'
echo '### NOW INSTALLING tunnel and therion, go and have a cup of tea. Or a 3-course meal.'
echo '###'
sudo apt install tunnelx therion -y
# Go to https://expo.survex.com/handbook/troggle/troglaptop.html#dbtools
# sudo service mysql start
# We don't install the later version or the earlier versions of python - for dev and "sever mimic" environments
# we leave that to uv to install now.
# In Dec.2024, the server is running 3.11 but dev work will be using 3.13
# The setup of the virtual environment is done by troggle/_deploy/wsl/venv-trog.sh
# install VS code - but ONLY on a native ubuntu install, NOT in WSL
# sudo apt install software-properties-common apt-transport-https
# wget -qO- https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > packages.microsoft.gpg
# sudo install -D -o root -g root -m 644 packages.microsoft.gpg /etc/apt/keyrings/packages.microsoft.gpg
# sudo sh -c 'echo "deb [arch=amd64,arm64,armhf signed-by=/etc/apt/keyrings/packages.microsoft.gpg] https://packages.microsoft.com/repos/code stable main" > /etc/apt/sources.list.d/vscode.list'
# sudo apt update
# sudo apt install code
echo '###'
echo '### Currently set version of python'
python --version
mkdir expo
cd expo
echo '###'
echo '### Now YOU have to configure the git settings for YOURSELF (not "expo")'
echo '### because you can't clone the repos without a key
2024-12-11 22:22:51 +00:00
# This sets this up for bash command window, BUT it is is not enough for VS code which is actually a Windows app
# when running on WSL. You ALSO need to MANUALLY run these commands in a terminal windows INSIDE VS code
git config --global user.email "philip.sargent@gmail.com"
git config --global user.name "Philip Sargent"
git config --global pull.rebase true
git clone ssh://expo@expo.survex.com/home/expo/troggle
git clone ssh://expo@expo.survex.com/home/expo/loser
git clone ssh://expo@expo.survex.com/home/expo/expoweb
git clone ssh://expo@expo.survex.com/home/expo/drawings
mkdir expofiles
rsync -azv --delete-after --prune-empty-dirs expo@expo.survex.com:expofiles/surveyscans/ expofiles/surveyscans
rsync -azv --delete-after --prune-empty-dirs --exclude="photos" --exclude="video" --exclude="mapapp" expo@expo.survex.com:expofiles/ expofiles
# rsync -azv --exclude="*.jpg.xml" --exclude="*.jpeg.xml" --exclude="*.JPG.xml" expo@expo.survex.com:expofiles/photos/ expofiles/photos
2024-12-11 22:34:51 +00:00
echo "now run venv-trog.sh to set up the virtual environments"
echo "configuring VS code will take a while, it is probably not working yet because of Windows/WSL git configs"