Skip to content

Instantly share code, notes, and snippets.

View onomatopellan's full-sized avatar

onomatopellan

View GitHub Profile
@shigenobuokamoto
shigenobuokamoto / network-mirrored.service
Last active June 24, 2024 15:29
/etc/systemd/system/network-mirrored.service
[Unit]
Wants=network-pre.target
Before=network-pre.target shutdown.target
[Service]
User=root
ExecStart=/bin/sh -ec '\
[ -x /usr/bin/wslinfo ] && [ "$(/usr/bin/wslinfo --networking-mode)" = "mirrored" ] || exit 0;\
echo "\
add chain ip nat WSLPREROUTING { type nat hook prerouting priority dstnat - 1; policy accept; };\
@vhanla
vhanla / wsaclientdetails.md
Last active April 13, 2024 11:39
Windows Subsystem for Android - WSA Client interesting params and stuff

WSA Client (wsaclient.exe) is the manager UI application for Windows 11's Windows Subsystem for Android platform and here I collect interesting stuff that I found in wsaclient.exe

  1. One instance application.

wsaclient.exe is the only application that runs, and handles params for different actions, like uninstall, launch APKs, restart, etc.

To check and block other instances, it uses MUTEX strings and it is this one (it might change in future versions)

Mutex = CreateMutexExW(0, L"{42CEB0DF-325A-4FBE-BBB6-C259A6C3F0BB}", 0, 0x1F0001u);

@xquangdang
xquangdang / rn-with-wsl-wsa.md
Last active March 22, 2024 14:39
Develop React Native app with WSL and WSA

Develop React Native app with WSL and WSA

Requirement

  • Windows Subsystem for Linux 2 (WSL2)
  • Windows Subsystem for Android (WSA)
  • NodeJS install inside WSL2

Steps

WSA

@machuu
machuu / WSL2_VPN_Workaround_Instructions.md
Last active June 24, 2024 16:36
Workaround for WSL2 network broken on VPN

Overview

Internet connection and DNS routing are broken from WSL2 instances, when some VPNs are active.

The root cause seems to be that WSL2 and the VPN use the same IP address block, and the VPN routing clobbers WSL2's network routing.

This problem is tracked in multiple microsoft/WSL issues including, but not limited to:

@mwoodpatrick
mwoodpatrick / README.md
Created December 28, 2020 16:14 — forked from djfdyuruiry/README.md
WSL 2 - Enabling systemd

Enable systemd in WSL 2

This guide will enable systemd to run as normal under WSL 2. This will enable services like microk8s, docker and many more to just work during a WSL session. Note: this was tested on Windows 10 Build 2004, running Ubuntu 20.04 LTS in WSL 2.

  • To enable systemd under WSL we require a tool called systemd-genie

  • Copy the contents of install-sg.sh to a new file /tmp/install-sg.sh:

    cd /tmp
@lamhoangtung
lamhoangtung / install_nvidia_docker_offline.md
Last active December 8, 2022 02:46
How to install nvidia-docker offline for Ubuntu 18.04
param(
[Parameter(Mandatory)][string]$vmName
)
$InformationPreference = "Continue"
$ErrorActionPreference = "Stop"
try {
$vmPartitionAdapter = Get-VMGpuPartitionAdapter -VMName $vmName
if ($vmPartitionAdapter) {
Write-Information "Removing Partition Adapter. Checkpoints work."
@neggles
neggles / New-GPUPDriverPackage.ps1
Last active July 6, 2024 18:04
Hyper-V GPU Virtualization
<#
.SYNOPSIS
Create a GPU-P Guest driver package.
.DESCRIPTION
Gathers the necessary files for a GPU-P enabled Windows guest to run.
.EXAMPLE
New-GPUPDriverPackage -DestinationPath '.'
.EXAMPLE
New-GPUPDriverPackage -Filter 'nvidia' -DestinationPath '.'
.INPUTS
@daehahn
daehahn / wsl2-network.ps1
Last active June 25, 2024 15:53
WSL 2 TCP NETWORK FORWARDING
# WSL2 network port forwarding script v1
# for enable script, 'Set-ExecutionPolicy -ExecutionPolicy Bypass -Scope CurrentUser' in Powershell,
# for delete exist rules and ports use 'delete' as parameter, for show ports use 'list' as parameter.
# written by Daehyuk Ahn, Aug-1-2020
# Display all portproxy information
If ($Args[0] -eq "list") {
netsh interface portproxy show v4tov4;
exit;
}
@datocrats-org
datocrats-org / setupDevEnv_workaroundWSL2vhdxLimit.md
Last active July 5, 2024 14:47
Backup and restore WSL2 vhdx, avoid 256GB vhdx limit for docker desktop WSL2 native

Backup and restore WSL2 vhdx, avoid 256GB vhdx limit for docker desktop WSL2 native

Review all steps to view the symptom this Gist addresses, customize a workaround to allow for >256GB Docker pulls safely on Windows, then perform a backup and recovery of the result (export and import). Please provide comments on any failures.

Determine the expected size of the docker-desktop-data volume

  • Get the base image size + additional + all docker volumes using docker system df
  • Add raw uncompressed size for alpine (50MB), docker for your version of windows (700MB) and linux (80MB)

docker system df