Skip to content

Instantly share code, notes, and snippets.

View geokal's full-sized avatar

George Kal geokal

  • Fogus Innovations & Services
  • Athens, Greece
View GitHub Profile

Recipe: Persistent Network Configuration in WSL 2 using Hyper-V Virtual Switch

Problem Description

Connecting to services running in WSL 2 from external sources can be challenging due to the instances being on a different network. This guide offers a solution to replace the internal virtual switch of WSL 2 with an external version in Windows 20H2 (WSL 2.0) and configure it for better networking control.

Solution Overview

This recipe uses a Hyper-V virtual switch to bridge the WSL 2 network, providing improved control and visibility of Windows' network adapters within Ubuntu. The configuration supports both dynamic and static IP addressing, eliminating the need for port forwarding and simplifying network setup.

Steps

  1. Enable Hyper-V and Management PowerShell Features:
@geokal
geokal / rss.xml
Created January 3, 2025 16:07 — forked from hervehobbes/rss.xml
rss feeds for .Net, C#, Asp.Net and so on
<?xml version="1.0" encoding="utf-8"?>
<opml version="1.0">
<head>
<dateCreated>Thu, 02 Jan 2025 07:55:02 +0000</dateCreated>
<title>Tiny Tiny RSS Feed Export</title>
</head>
<body>
</outline>
<outline text="Dot Net" ttrssSortOrder="0">
<outline type="rss" text=".NET Blog" xmlUrl="https://davecallan.com/feed/" ttrssSortOrder="0" ttrssPurgeInterval="0" ttrssUpdateInterval="0" htmlUrl="https://davecallan.com/"/>
@geokal
geokal / nginx_macos.md
Created December 10, 2024 20:49 — forked from osamaqarem/nginx_macos.md
Nginx on MacOS

Install nginx (Homebrew)

brew install nginx

Configuration file for nginx will be at /usr/local/etc/nginx/nginx.conf

Web apps can be stored at /usr/local/var/www

Commands

Start:

.NET Workload Troubleshooting

To install the maui workload, you have two options:

  1. dotnet workload install commands
  2. Visual Studio on Windows can install .msi files for each workload pack. Note that the concept of a "Visual Studio workload" is different than a ".NET workload".

VS for Mac's installer and updater use dotnet workload install commands. It's considerably simpler to get a Mac machine to a clean state.

Mac

@geokal
geokal / battery_limit.zsh
Created October 5, 2024 08:21 — forked from NightMachinery/battery_limit.zsh
A guide on limiting macOS battery charging to at most 80%.
# Apple Silicon laptops with firmware > 13.0 have a native charge threshold that does not required any userspace daemon running.
# This native limit works even when the laptop is sleeping or powered off therefore it is preferable to the userspace daemon.
# Nonetheless, it only works with fixed thresholds (80% as upper limit and 70% as lower limit).
# CHWA key is the one used to enable/disable the native limit. 01 = 80% limit, 00 = no limit
##
typeset -g smc_command="/usr/local/bin/smc"
typeset -g smc_charge_limit_key="CHWA"
typeset -g smc_charge_limit_status_on="01"
typeset -g smc_charge_limit_status_off="00"
@geokal
geokal / HttpFactoryInBlazorWASM.md
Created September 25, 2024 09:43 — forked from xiaomi7732/HttpFactoryInBlazorWASM.md
Use HttpFactory for multiple HttpClients in Blazor WASM

Use HttpFactory for multiple HttpClients in Blazor WASM

Description

HttpClient Factory pattern allows multiple named http client for various backend. This is a note about how to use it in Blazor WASM (.NET 6).

Short version: Same as in a Web API.

Details

Pipe error solve:
https://www.youtube.com/watch?v=9F9AcMYh8yQ
PHP XAMPP SETUP:
one in all : https://www.youtube.com/watch?v=28dc3edU2Uc
https://www.youtube.com/watch?v=HKuoc1KrOKs

What do Etcd, Consul, and Zookeeper do?

  • Service Registration:
    • Host, port number, and sometimes authentication credentials, protocols, versions numbers, and/or environment details.
  • Service Discovery:
    • Ability for client application to query the central registry to learn of service location.
  • Consistent and durable general-purpose K/V store across distributed system.
    • Some solutions support this better than others.
    • Based on Paxos or some derivative (i.e. Raft) algorithm to quickly converge to a consistent state.
  • Centralized locking can be based on this K/V store.
@geokal
geokal / go-stdlib-interface-selected.md
Created September 17, 2023 20:04 — forked from asukakenji/go-stdlib-interface-selected.md
Go (Golang) Standard Library Interfaces (Selected)

Go (Golang) Standard Library Interfaces (Selected)

This is not an exhaustive list of all interfaces in Go's standard library. I only list those I think are important. Interfaces defined in frequently used packages (like io, fmt) are included. Interfaces that have significant importance are also included.

All of the following information is based on go version go1.8.3 darwin/amd64.

@geokal
geokal / pdns.conf
Last active August 22, 2023 22:27
PowerDNS configuration file with sqlite backend
webserver=yes
webserver-address=0.0.0.0
webserver-port=8081
webserver-allow-from=0.0.0.0/0
api=yes
api-key=changeme
local-port=5300
launch=gsqlite3
gsqlite3-database=/opt/homebrew/etc/powerdns/pdns.sqlite3