2
0
mirror of https://expo.survex.com/repositories/troggle/.git synced 2024-12-18 06:22:18 +00:00

separate survex install from troggle install

This commit is contained in:
Philip Sargent 2024-12-15 18:48:16 +00:00
parent 492f2b00b0
commit 5475a0b853
4 changed files with 151 additions and 27 deletions

22
_deploy/wsl/os-survey.sh Normal file
View File

@ -0,0 +1,22 @@
#!/bin/bash
# Run this in a terminal : 'bash os-survey.sh'
# On WSL, do Shift-click in the file explorer on the troggle folder to open a Linux command line
# 'Open Linux shell here'
echo 'Run this in a terminal in your home directory: "bash os-trog.sh"'
cat /etc/os-release
# Expects an Ubuntu 24.04 relatively clean install.
# 24.04 has python 3.12
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
sudo apt install survex-aven -y
sudo apt install gpsprune qgis -y
cd ~/expo
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

View File

@ -1,19 +1,19 @@
#!/bin/bash #!/bin/bash
# Run this in a terminal in your $HOME directory, e.g. /home/philip/ # Run this in a terminal in the troggle directory: 'bash os-trog.sh'
# run like this: bash os-trog.sh' # On WSL, do Shift-click in the file explorer on the troggle folder to open a Linux command line
# 'Open Linux shell here'
echo 'Run this in a terminal in your home directory: "bash os-trog.sh"' echo 'Run this in a terminal in your home directory: "bash os-trog.sh"'
cat /etc/os-release cat /etc/os-release
# Expects a WSL Ubuntu 24.04 relatively clean install. # Expects an Ubuntu 24.04 relatively clean install.
# 24.04 has python 3.12 as standard # 24.04 has python 3.12
# sudo apt install python-is-python3 -y
python --version : ensure python is an alias for python3 not python2.7 python --version : ensure python is an alias for python3 not python2.7
ssh -V ssh -V
sudo apt update -y sudo apt update -y
sudo apt dist-upgrade -y sudo apt dist-upgrade -y
sudo apt autoremove -y sudo apt autoremove -y
sudo apt install sqlite3 -y
# Already in Ubuntu 24.04 on WSL: # Already in Ubuntu 24.04 on WSL:
# sudo apt install git -y # sudo apt install git -y
@ -25,9 +25,13 @@ sudo apt install sqlite3 -y
# Now using uv not pip: # Now using uv not pip:
# sudo apt install python3-pip -y # sudo apt install python3-pip -y
sudo apt install sqlite3 -y
sudo apt install gedit -y sudo apt install gedit -y
sudo apt install tig gitg meld -y sudo apt install tig gitg meld -y
# python formatting https://docs.astral.sh/ruff/
sudo snap install ruff
# # do not actually use this any more # # do not actually use this any more
# sudo useradd expo # sudo useradd expo
# sudo usermod -a -G sudo expo # to put expo in sudoers group, re-login required # sudo usermod -a -G sudo expo # to put expo in sudoers group, re-login required
@ -43,16 +47,6 @@ curl -LsSf https://astral.sh/uv/install.sh | sh
sudo apt install mariadb-server -y sudo apt install mariadb-server -y
sudo apt install libmariadb-dev -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 # Go to https://expo.survex.com/handbook/troggle/troglaptop.html#dbtools
# sudo service mysql start # sudo service mysql start
@ -72,23 +66,18 @@ sudo apt install tunnelx therion -y
# sudo apt install code # sudo apt install code
echo '###' mkdir ~/expo
echo '### Currently set version of python' cd ~/expo
python --version
mkdir expo
cd expo
echo '###' echo '###'
echo '### Now YOU have to configure the git settings for YOURSELF (not "expo")' echo '### Now YOU have to configure the git settings for YOURSELF (not "expo")'
echo '### because you can't clone the repos without a key echo '### because you can't clone the repos without a key
# 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.email "philip.sargent@gmail.com"
git config --global user.name "Philip Sargent" git config --global user.name "Philip Sargent"
git config --global pull.rebase true git config --global pull.rebase true
#Change this to clone using https?? at least for troggle?
git clone ssh://expo@expo.survex.com/home/expo/troggle 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/loser
git clone ssh://expo@expo.survex.com/home/expo/expoweb git clone ssh://expo@expo.survex.com/home/expo/expoweb
@ -96,9 +85,8 @@ git clone ssh://expo@expo.survex.com/home/expo/drawings
mkdir expofiles mkdir expofiles
rsync -azv --delete-after --prune-empty-dirs expo@expo.survex.com:expofiles/surveyscans/ expofiles/surveyscans rsync -azv --delete-after --prune-empty-dirs expo@expo.survex.com:expofiles/surveyscans/ expofiles/surveyscans
rsync -azv --exclude="*.jpg.xml" --exclude="*.jpeg.xml" --exclude="*.JPG.xml" expo@expo.survex.com:expofiles/photos/2018/PhilipSargent/ expofiles/photos/2018/PhilipSargent
rsync -azv --delete-after --prune-empty-dirs --exclude="photos" --exclude="video" --exclude="mapapp" expo@expo.survex.com:expofiles/ expofiles 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 # rsync -azv --exclude="*.jpg.xml" --exclude="*.jpeg.xml" --exclude="*.JPG.xml" expo@expo.survex.com:expofiles/photos/ expofiles/photos
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"

22
os-survey.sh Normal file
View File

@ -0,0 +1,22 @@
#!/bin/bash
# Run this in a terminal : 'bash os-survey.sh'
# On WSL, do Shift-click in the file explorer on the troggle folder to open a Linux command line
# 'Open Linux shell here'
echo 'Run this in a terminal in your home directory: "bash os-trog.sh"'
cat /etc/os-release
# Expects an Ubuntu 24.04 relatively clean install.
# 24.04 has python 3.12
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
sudo apt install survex-aven -y
sudo apt install gpsprune qgis -y
cd ~/expo
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

92
os-trog24.04.sh Normal file
View File

@ -0,0 +1,92 @@
#!/bin/bash
# Run this in a terminal in the troggle directory: 'bash os-trog.sh'
# On WSL, do Shift-click in the file explorer on the troggle folder to open a Linux command line
# 'Open Linux shell here'
echo 'Run this in a terminal in your home directory: "bash os-trog.sh"'
cat /etc/os-release
# Expects an Ubuntu 24.04 relatively clean install.
# 24.04 has python 3.12
# sudo apt install python-is-python3 -y
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
# 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 sqlite3 -y
sudo apt install gedit -y
sudo apt install tig gitg meld -y
# python formatting https://docs.astral.sh/ruff/
sudo snap install ruff
# # 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
# 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
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
git config --global user.email "philip.sargent@gmail.com"
git config --global user.name "Philip Sargent"
git config --global pull.rebase true
#Change this to clone using https?? at least for troggle?
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 --exclude="*.jpg.xml" --exclude="*.jpeg.xml" --exclude="*.JPG.xml" expo@expo.survex.com:expofiles/photos/2018/PhilipSargent/ expofiles/photos/2018/PhilipSargent
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