This file contains hidden or 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
| # Check these threads before proceeding: | |
| # https://github.com/microsoft/WSL/discussions/5857 | |
| # https://github.com/microsoft/WSL/issues/5821 | |
| if (-Not ([Security.Principal.WindowsPrincipal] [Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole] 'Administrator')) { | |
| $CmdLine = "-File `"" + $MyInvocation.MyCommand.Path + "`" " + $MyInvocation.UnboundArguments | |
| Start-Process -FilePath PowerShell.exe -Verb Runas -ArgumentList $CmdLine | |
| Exit | |
| } | |
| # Restart the Host Network Service | |
| Restart-Service -Force -Name hns |
This file contains hidden or 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/bash | |
| #this script sets up a git user, installs gitea, a systemd service, and an nginx subdomain redirect | |
| #inspired by https://golb.hplar.ch/2018/06/self-hosted-git-server.html | |
| DOMAIN=EXAMPLE.COM #Please put your actual domain here | |
| GIT_HOME=/opt/git #/home/git in the above tutorial | |
| GITEA_PORT=3000 #default, but you can change it | |
| if [[ $EUID -ne 0 ]]; then | |
| echo "you need to be root" | |
| exit 1 |
This file contains hidden or 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/bash | |
| # NAS IP: 192.168.1.10 in this example | |
| # DHCP scope reservation for macvlan: 192.168.1.210/28 (Details below) | |
| ## Network: 192.168.1.210/28 | |
| ## HostMin: 192.168.1.211 | |
| ## HostMax: 192.168.1.224 | |
| ## Hosts/Net: 14 | |
| # Create a Synology macvlan0 bridge network attached to the physical eth0, and add the ip range scope (sudo) |