Skip to content

Instantly share code, notes, and snippets.

View the-moog's full-sized avatar
💭
Not looking for a new job

Jay the-moog

💭
Not looking for a new job
  • Qualcomm/QTI, UK, Cambridge
  • Cambridge, UK
  • 05:19 (UTC +01:00)
View GitHub Profile
@mreferre
mreferre / Hyper-V-NAT.ps1
Last active June 8, 2023 10:08
PS commands to create a Hyper-V internal switch and NAT rules
# the following 3 lines of PowerShell creates an Internal Switch on Hyper-V (https://www.petenetlive.com/KB/Article/0001384)
New-VMSwitch -SwitchName "NAT-Switch" -SwitchType Internal
New-NetIPAddress -IPAddress 192.168.200.1 -PrefixLength 24 -InterfaceAlias "vEthernet (NAT-Switch)"
New-NetNAT -Name "NAT-Network" -InternalIPInterfaceAddressPrefix 192.168.200.0/24
# the following line of PowerShell creates a DNAT rule (80->80) from the outside into a VM (previously created an running on the Switch with IP .10) (https://www.petri.com/create-nat-rules-hyper-v-nat-virtual-switch)
Add-NetNatStaticMapping -ExternalIPAddress "0.0.0.0/24" -ExternalPort 80 -Protocol TCP -InternalIPAddress "192.168.200.10" -InternalPort 80 -NatName NAT-Network
@xemuliam
xemuliam / wsl.md
Last active April 3, 2023 11:18
WSL. Windows subsystem for Linux. How to use everyday.

Here I'll explain how to use true Linux inside your Windows machine.

WSL

How to install

There are two possible ways:

  1. Enable Windows Subsystem for Linux in Windows Features
  2. Use following script in administrative PS-shell
@LeoHuckvale
LeoHuckvale / gist:89683dc242f871c8e69b
Created February 2, 2015 16:53
matplotlib - Add subplots dynamically
@korya
korya / Subfolder to git repo.md
Last active December 16, 2023 10:29
Convert subfolder into Git submodule
@davfre
davfre / MultiPipingExamples.md
Created October 31, 2012 12:50
# Multiple pipes to/from one process