On client, run:
ssh -f -D SOCKS_PORT -N -p SSH_PORT USER@REMOTE_ADDRreplace:
| #!/bin/bash | |
| # Tested with go 1.22.5 | |
| project_name="my_project" # Change to your project name | |
| main_file="${project_name}.go" # Or main.go, depends on your project structure | |
| build_path="./build" | |
| # Add values to your liking from "go tool dist list" command | |
| # or https://gist.github.com/asukakenji/f15ba7e588ac42795f421b48b8aede63 |
Create minecraft-compose.yaml:
services:
mc-survival:
container_name: mc-survival
image: itzg/minecraft-server:latest
environment:
TYPE: FABRIC
SERVER_NAME: MyServer| // Add to your Cargo.toml: | |
| // [dependencies] | |
| // subprocess = { version = "0.2.10", git = "https://github.com/SCP002/rust-subprocess.git" } | |
| use subprocess::Exec; | |
| fn main() { | |
| let exit_status = Exec::cmd("my-executable-name") | |
| .arg("arg1") | |
| .creation_flags(0x00000010) // CREATE_NEW_CONSOLE |
| # write systemd config for the first instance | |
| sudo tee /lib/systemd/system/astra-8000.service > /dev/null << ENDSEQ | |
| [Unit] | |
| Description=Astra 8000 service (%N) | |
| After=network-online.target | |
| StartLimitBurst=5 | |
| StartLimitIntervalSec=10 | |
| [Service] | |
| Type=simple |
| package main | |
| import ( | |
| "errors" | |
| "net" | |
| "net/url" | |
| "syscall" | |
| ) | |
| // ErrType represents network error type |
| //go:build darwin | |
| package main | |
| import ( | |
| "fmt" | |
| "path/filepath" | |
| "golang.org/x/sys/unix" | |
| ) |
| Windows Registry Editor Version 5.00 | |
| ; Disable Windows 10 updates. | |
| ; To enable it back, delete these values. | |
| ; Tested with Windows 10 Pro 20H2, build 19042.1052 | |
| [HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate] | |
| "DoNotConnectToWindowsUpdateInternetLocations"=dword:00000001 |
| // Used in https://github.com/SCP002/terminator. | |
| package main | |
| import ( | |
| "errors" | |
| "fmt" | |
| "github.com/shirou/gopsutil/v4/process" | |
| ) |