Skip to content

Instantly share code, notes, and snippets.

View sidneyspe's full-sized avatar
🎯
Focusing

Sidney Pimentel sidneyspe

🎯
Focusing
  • Campina Grande - PB, Brasil
  • 01:28 (UTC -03:00)
  • LinkedIn in/sidneyspe
View GitHub Profile
@sidneyspe
sidneyspe / settings.json
Last active September 2, 2025 17:31
VSCode Settings - 2024
{
"workbench.startupEditor": "newUntitledFile",
"editor.fontSize": 14,
"editor.lineHeight": 1.8,
"javascript.suggest.autoImports": true,
"javascript.updateImportsOnFileMove.enabled": "always",
"editor.rulers": [
80,
120
],

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:
@sidneyspe
sidneyspe / settings.json
Created August 31, 2023 13:04
SublimeText Config
// Settings in here override those in "Default/Preferences.sublime-settings",
// and are overridden in turn by syntax-specific settings.
{
"theme": "One Dark.sublime-theme",
"color_scheme": "Omni.sublime-color-scheme",
"font_face": "JetBrainsMono Nerd Font",
"font_size": 16,
"ignored_packages":
[
"Vintage",
%userprofile%\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup
@sidneyspe
sidneyspe / .bashrc
Last active November 28, 2025 18:10
.bashrc for windows
eval "$(starship init bash)"
. "$HOME/.asdf/asdf.sh"
. "$HOME/.asdf/completions/asdf.bash"
alias ls='lsd'
alias la='lsd -la'
alias l='ls -l'
alias la='ls -a'
alias lla='ls -la'
alias lt='ls --tree'
@sidneyspe
sidneyspe / get_line_logs.cs
Last active May 22, 2023 13:09
get the last line of log file
using System;
using System.IO;
class Program
{
static void Main()
{
// Obter a data e hora atual
DateTime now = DateTime.Now;
@sidneyspe
sidneyspe / copy.bat
Created May 12, 2023 18:06
copy files modified today
@echo off
set "source_folder=C:\pasta\origem"
set "dest_folder=C:\pasta\destino"
set "file_pattern=bin\Debug\*.*"
xcopy "%source_folder%\%file_pattern%" "%dest_folder%\%file_pattern%" /S /D:%DATE% /F
pause
@sidneyspe
sidneyspe / wowup.io
Last active January 22, 2026 20:57
Adddons WoW - WowUp.io CF
eyJjb2xsZWN0aW9uX25hbWUiOiJXb3dVcF9leHBvcnRfMTc2OTExNTQ1MjY1MyIsImNsaWVudF90eXBlIjoiUmV0YWlsIiwiYWRkb25zIjpbeyJpZCI6IjQ4OSIsIm5hbWUiOiJUaXRhbiBQYW5lbCIsInByb3ZpZGVyX25hbWUiOiJDdXJzZSIsInZlcnNpb25faWQiOiI3NDc4OTY2In0seyJpZCI6IjU0MjIiLCJuYW1lIjoiU2NyYXAgKEp1bmsgU2VsbGVyKSIsInByb3ZpZGVyX25hbWUiOiJDdXJzZSIsInZlcnNpb25faWQiOiI3NTAxMTEyIn0seyJpZCI6IjE0MTU0IiwibmFtZSI6IkhhbmR5Tm90ZXMiLCJwcm92aWRlcl9uYW1lIjoiQ3Vyc2UiLCJ2ZXJzaW9uX2lkIjoiNzQ2NzQzMyJ9LHsiaWQiOiIzMDYwODUiLCJuYW1lIjoiVG9tQ2F0J3MgVG91cnMgKCBub3cgaW5jbHVkZXMgdGhlIE1pZHN1bW1lciBGaXJlIEZlc3RpdmFsIGFuZCBBIEdyZWVkeSBFbWlzc2FyeSApIiwicHJvdmlkZXJfbmFtZSI6IkN1cnNlIiwidmVyc2lvbl9pZCI6Ijc0OTk1MzYifSx7ImlkIjoiMTAwNDM2IiwibmFtZSI6IldvcmxkIFF1ZXN0cyBMaXN0IiwicHJvdmlkZXJfbmFtZSI6IkN1cnNlIiwidmVyc2lvbl9pZCI6Ijc0OTQ1NjEifSx7ImlkIjoiOTQ3NjciLCJuYW1lIjoiQXV0b0xvb3RlciIsInByb3ZpZGVyX25hbWUiOiJDdXJzZSIsInZlcnNpb25faWQiOiI3NDYxMTE1In0seyJpZCI6IjkxMzc2IiwibmFtZSI6IkNvbnNvbGVQb3J0IiwicHJvdmlkZXJfbmFtZSI6IkN1cnNlIiwidmVyc2lvbl9pZCI6Ijc1MDE5OTkifSx7ImlkIjoiODQyMDgiLCJuYW1lIjoiUmFy
@sidneyspe
sidneyspe / HandleXml.cs
Created May 3, 2023 18:34
Handle XML using cshap
using System;
using System.Xml.Linq;
using System.Collections.Generic;
using System.Dynamic;
using System.Linq;
using System.Text.Json;
class Program
{
static void Main(string[] args)
@sidneyspe
sidneyspe / vs-code-extensions
Last active April 27, 2023 21:30
Best extensions for vscode
Thog.vscode-asl
naumovs.color-highlight
VisualStudioExptTeam.vscodeintellicode
PKief.material-icon-theme
rocketseat.theme-omni
esbenp.prettier-vscode
adpyke.codesnap
clinyong.vscode-css-modules
EditorConfig.EditorConfig
emilast.LogFileHighlighter