Skip to content

Instantly share code, notes, and snippets.

View SCP002's full-sized avatar
🕊️

SCP002

🕊️
  • $Env:UserProfile
View GitHub Profile
@SCP002
SCP002 / ssh-tunnel-traffic.md
Last active April 10, 2026 22:13
SSH: Tunnel traffic

Warning: The method below is tunneling only TCP traffic

On client, run:

ssh -f -D SOCKS_PORT -N -p SSH_PORT USER@REMOTE_ADDR

replace:

@SCP002
SCP002 / build.sh
Last active September 24, 2026 04:18
Golang: Shell script to build your project to each OS / Architecture available.
#!/bin/bash
project_name="my-project"
build_path="build"
cgo_enabled=0
command -v go > /dev/null || { echo "go not found in PATH" >&2; exit 1; }
mkdir -p "$build_path"
@SCP002
SCP002 / minecraft-server-docker-howto.md
Last active December 26, 2025 11:37
Minecraft: Run fabric server in offline mode with whitelist and authentication in docker container.

Create minecraft-compose.yaml:

services:
  mc-survival:
    container_name: mc-survival
    image: itzg/minecraft-server:latest
    environment:
      TYPE: FABRIC
      SERVER_NAME: MyServer
@SCP002
SCP002 / err.go
Last active October 28, 2026 22:52
Golang: Run both HTTP and HTTPS server with dummy TLS certificates for testing. Network error classifier included.
package main
import (
"errors"
"net"
"net/url"
"syscall"
)
// ErrType represents network error type
@SCP002
SCP002 / terminal_darwin.go
Last active October 25, 2025 04:01
Golang: Write a message to any console's input on POSIX.
//go:build darwin
package main
import (
"fmt"
"path/filepath"
"golang.org/x/sys/unix"
)
@SCP002
SCP002 / disable-windows-10-updates.reg
Last active June 19, 2021 18:58
Windows Registry: Disable Windows 10 updates.
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
@SCP002
SCP002 / get_process_tree.go
Last active January 11, 2025 09:05
Golang: Get all descendants of the specified process.
// Used in https://github.com/SCP002/terminator.
package main
import (
"errors"
"fmt"
"github.com/shirou/gopsutil/v4/process"
)
@SCP002
SCP002 / init_console_handlers_windows.go
Last active August 25, 2025 19:54
Golang: Initialize console handlers after AttachConsole or AllocConsole on Windows.
// Used in https://github.com/SCP002/terminator.
package main
import (
"errors"
"os"
"golang.org/x/sys/windows"
)
@SCP002
SCP002 / write_to_stdin_windows.go
Last active January 11, 2025 09:28
Golang: Write a message to the current (see comments for a method for any console) console's input on Windows.
//go:build windows
// Used in https://github.com/SCP002/terminator.
// For POSIX, see: https://gist.github.com/SCP002/c7c3bf4aafd3e32e0dc0aa65dda2bf14.
package main
import (
"errors"
"os"
@SCP002
SCP002 / send_wm_close_windows.go
Last active January 11, 2025 09:20
Golang: Close main window of the process with the specified PID for graceful termination of processes on Windows.
//go:build windows
// Used in https://github.com/SCP002/terminator.
package main
import (
"fmt"
"unsafe"