Skip to content

Instantly share code, notes, and snippets.

@brdebr
Last active July 16, 2021 07:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save brdebr/ffe3fddc60d1fd3dc7035447b11e6c03 to your computer and use it in GitHub Desktop.
Save brdebr/ffe3fddc60d1fd3dc7035447b11e6c03 to your computer and use it in GitHub Desktop.
WSL scripts
[wsl2]
memory=8GB # Limits VM memory in WSL 2 to 4 GB
Añadir esto al .bashrc:
alias canvaslms='cd /opt/canvaslms-2020.08.12.43-0/ && sudo ./bnhelper-tool'
. ~/script_port
mkdir canvas-install
cd canvas-install/
explorer.exe .
ls
sudo chmod +x bitnami-canvaslms-2020.08.12.43-0-linux-x64-installer.run
ls -l
sudo ./bitnami-canvaslms-2020.08.12.43-0-linux-x64-installer.run
cd
explorer.exe .
sudo chmod +x script_port
ls -la
sudo nano .bashrc
cat .bashrc
ip addr show eth0 | grep -oP '(?<=inet\s)\d+(\.\d+){3}'
@echo off
set /p export_file="Name? : "
wsl --export Ubuntu-20.04 L:\WSL\STORE\%export_file%.tar
@echo off
wsl --unregister Ubuntu-20.04
echo Importing wsl copy...
wsl --import Ubuntu-20.04 L:\WSL\MACHINES\Ubu20 L:\WSL\STORE\Canvas-UNIR-config.tar
echo Setting Ubuntu-20.04 as default distribution
wsl -s Ubuntu-20.04
echo Setting Ubuntu default user
ubuntu2004 config --default-user brdebr-2004
echo Imported successfully
@echo on
REM #!/bin/sh
REM echo "Removing port 80 forwarding..."
REM netsh.exe interface portproxy delete v4tov4 listenport=80 listenaddress=0.0.0.0
REM WSLIP=`ip addr show eth0 | grep -oP '(?<=inet\s)\d+(\.\d+){3}'`
REM echo "Forwarding port 80 to WSL..."
REM netsh.exe interface portproxy add v4tov4 listenport=80 listenaddress=0.0.0.0 connectport=80 connectaddress=$WSLIP
REM echo "WSL IP: $WSLIP"
netsh interface portproxy delete v4tov4 listenport=80 listenaddress=0.0.0.0
#!/bin/sh
echo "Removing port 80 forwarding..."
netsh.exe interface portproxy delete v4tov4 listenport=80 listenaddress=0.0.0.0
WSLIP=ip addr show eth0 | grep -oP '(?<=inet\s)\d+(\.\d+){3}'
echo "Forwarding port 80 to WSL..."
netsh.exe interface portproxy add v4tov4 listenport=80 listenaddress=0.0.0.0 connectport=80 connectaddress=$WSLIP
echo "WSL IP: $WSLIP"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment