Skip to content

Instantly share code, notes, and snippets.

View ScottJWalter's full-sized avatar
🔮
Particle. Wave. It's all data.

Scott J. Walter ScottJWalter

🔮
Particle. Wave. It's all data.
View GitHub Profile
@ScottJWalter
ScottJWalter / git-cherry-pick-forks.md
Created February 1, 2026 17:53 — forked from jrussellsmyth/git-cherry-pick-forks.md
How to Cherry pick commits across forks

Cherry picking commits across forks

When working with forks in Git, you may need to pull specific commits from one fork to another. This can be useful when you want to include a specific change from one fork to another without merging the entire branch.

From another fork to your fork

From your fork to another fork

From another fork to your fork

  1. Identify the commit hash(es) of the commit(s) you want to cherry-pick. You can find this hash on GitHub or by using git log after fetching.
@ScottJWalter
ScottJWalter / enable-adb-port-for-wsl2.ps1
Created January 15, 2026 18:18 — forked from Steakeye/enable-adb-port-for-wsl2.ps1
Setup ADB on WSL and the Windows host so you can connect to the Android device from WSL
netsh advfirewall firewall add rule name="ADB WSL2: Open Port 5037" dir=in action=allow protocol=TCP localport=5037 remoteip=172.16.0.0/12 profile=domain,private
##
# Copyright (c) 2020 Valentin Weber
#
# After some minor modifications (as marked below) this EventGhost
# Python script provides a method to send requests to devices
# registered with the Join API <https://joaoapps.com/join/api/> from
# any EventGhost Python Script or Command.
#
# EventGhost usage: `eg.globals.JoinPushDevice(text="hello_world")`
##
@ScottJWalter
ScottJWalter / cmatrix.c
Created April 16, 2025 16:55 — forked from gvanem/cmatrix.c
Matrix clone in C
/*
* "Bleh" -- a "potato-friendly" cmatrix clone.
*
* Screenshot: https://i.imgur.com/dt6RmU7.png
*
* Adapted to Windows from:
* https://www.reddit.com/r/commandline/comments/1jcnyht/bleh_a_potatofriendly_cmatrix_clone/
*/
#include <stdio.h>
#include <stdlib.h>
@ScottJWalter
ScottJWalter / boot.sh
Created April 15, 2025 22:03 — forked from ThePlenkov/boot.sh
Resolve WSL DNS automatically
#!/bin/bash
# Remove existing "nameserver" lines from /etc/resolv.conf
sed -i '/nameserver/d' /etc/resolv.conf
# Run the PowerShell command to generate "nameserver" lines and append to /etc/resolv.conf
# we use full path here to support boot command with root user
/mnt/c/Windows/System32/WindowsPowerShell/v1.0/powershell.exe -Command '(Get-DnsClientServerAddress -AddressFamily IPv4).ServerAddresses | ForEach-Object { "nameserver $_" }' | tr -d '\r'| tee -a /etc/resolv.conf > /dev/null
@ScottJWalter
ScottJWalter / WSL2-Net-Fix.ps1
Created April 11, 2025 17:11 — forked from danvy/WSL2-Net-Fix.ps1
Reset your WSL network connection trying to fix WSL2 media disconnected error
# 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
#!/data/data/com.termux/files/usr/bin/bash
am start -a android.settings.REQUEST_IGNORE_BATTERY_OPTIMIZATIONS -d package:com.termux
echo -ne "\n Checking if Termux has storage permission..."
rm -r ~/storage >/dev/null 2>&1
if ! touch /storage/emulated/0/.tmp_check_termux >/dev/null 2>&1
then
echo -e "\nGrant Termux storage permission and run the script again\n"
termux-setup-storage
#!/data/data/com.termux/files/usr/bin/bash
if [ -z "$1" ]
then
echo "No input file specified"
exit 1
fi
echo -ne "\n Checking if Termux has storage permission..."
rm -r ~/storage &>/dev/null