Last active
July 16, 2021 07:09
WSL scripts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[wsl2] | |
memory=8GB # Limits VM memory in WSL 2 to 4 GB |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Añadir esto al .bashrc: | |
alias canvaslms='cd /opt/canvaslms-2020.08.12.43-0/ && sudo ./bnhelper-tool' | |
. ~/script_port |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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}' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@echo off | |
set /p export_file="Name? : " | |
wsl --export Ubuntu-20.04 L:\WSL\STORE\%export_file%.tar |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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