Skip to content

Instantly share code, notes, and snippets.

View radamhu's full-sized avatar
🎯
Focusing

Ádám Roland radamhu

🎯
Focusing
View GitHub Profile
@radamhu
radamhu / wsl2-network.ps1
Last active July 28, 2022 05:18 — forked from daehahn/wsl2-network.ps1
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
Set-ExecutionPolicy -Scope Process -ExecutionPolicy Bypass
# Display all portproxy information
If ($Args[0] -eq "list") {
netsh interface portproxy show v4tov4;
#!/bin/bash
# source : https://www.howtogeek.com/442332/how-to-work-with-variables-in-bash/
echo "There were $# command line parameters"
echo "They are: $@"
echo "Parameter 1 is: $1"
echo "The script is called: $0"
# any old process so that we can report on the exit status
pwd
echo "pwd returned $?"
import json
from typing import List
def run(args: List[str]):
filename = args[0]
with open(filename, "r") as f:
data = json.loads(f.read())
original_entries = data['items']