UCL-ARC / teaching-tooling

Tools we use for teaching
0 stars 0 forks source link

What didn't work for me and other "issues" #1

Open dtwwwc1e opened 4 months ago

dtwwwc1e commented 4 months ago

I got WSL version 1, VS Code says WSL 2 available. I didn't upgrade to 2, I think it's fine.

I can't get this line to work, first is permission issue: apk update && apk add tmux libstdc++ nano curl bash coreutils To make sure my wsl is "clean", I reinstalled wsl which still gave me version 1 Then, I had to specify ubuntu in the wsl --install (I think previously ubuntu was default. might be a recent change in wsl? nothing to do with vscode or ...)

I didn't know what my wsl password is. I changed to root and passwd my username. as root, then, I tried the line cd ~/teaching && curl -o https://github.com/rgaiacs/swc-shell-split-window/master/swc-shell-split-window.sh && chmod u+x ./swc-shell-split-window.sh

didn't work, that shell file needs a "blob", full url being https://github.com/rgaiacs/swc-shell-split-window/blob/master/swc-shell-split-window.sh

Still, I got error: curl: no URL specified!

Full command: root@CS00025842:~/teaching# curl -o https://github.com/rgaiacs/swc-shell-split-window/blob/master/swc-shell-split-window.sh && chmod u+x ./swc-shell-split-window.sh Did I do anything wrong?

Anyway, I manually created the file, and copied pasted from https://github.com/rgaiacs/swc-shell-split-window/blob/master/swc-shell-split-window.sh.

And yes, I got the split window :)

dpshelio commented 4 months ago

I believe wsl2 is way better. So I'd suggest to use that instead.

If you've used ubuntu, then the apk commands will be different (and so the package names). You'll need apt update and then search each package: apt search tmux. I think with ubuntu you'll only need tmux and maybe nano as I'd expect all the others being there. But if you've got the split window, then tmux was installed already!

The curl command should point to https://raw.githubusercontent.com/rgaiacs/swc-shell-split-window/master/swc-shell-split-window.sh url, I copy the wrong one.

dtwwwc1e commented 3 months ago

On Windows 11

To install WSL 2:

RE https://www.c-sharpcorner.com/article/how-to-install-windows-subsystem-for-linux-wsl2-on-windows-11/

To Check WSL version

wsl --status

To Set WSL default version to 2

wsl --set-default-version 2

Tip: access files Linux <-> Windows

link

Remaining steps

I note below commands that work on my laptop:

After WSL (refer first picture)

This is for ubuntu:

apt update && apt install tmux libstdc++6 nano curl bash coreutils

To get the shell file, this command works:

cd ~/teaching && curl -O https://raw.githubusercontent.com/rgaiacs/swc-shell-split-window/master/swc-shell-split-window.sh && chmod u+x ./swc-shell-split-window.sh

Start VS Code

I use windows start, VS Code

If VS Code does not show terminal, click top menu Terminal - New Terminal, or windows shortcut CTRL+SHIFT+'

su
(enter your root password)

cd /root/teaching

./swc-shell-split-window.sh

then continue with "Run, with a space at the start cd /home/teacher/"


My ultimate wish is to run tmux as user not root. But I haven't found a way to do so. In teaching situations where I want to use cd ~ I won't be able to demonstrate how it works on my terminal.