Skip to content

Instantly share code, notes, and snippets.

View Vesnica's full-sized avatar

Vesnica Vesnica

View GitHub Profile
@Vesnica
Vesnica / access_host_port_from_WSL2.md
Created October 1, 2025 11:20
Access host port from WSL2
  • On Host: chrome.exe --remote-debugging-port=9222 --user-data-dir="D:\ChromeDevData"
  • On Host: Add firewall rule to allow 9222 access
  • On Host: Get WSL Hyper-V firewall IP(ipconfig, should be like 172.xx.xx.1)
  • On Host: netsh interface portproxy add v4tov4 listenport=9222 listenaddress=127.0.0.1 connectport=9222 connectaddress=172.xx.xx.1
  • In WSL2: nc -vz 172.xx.xx.1 9222 (should be success)
@Vesnica
Vesnica / raspberrypi_usb_share.md
Created September 13, 2025 10:40
将RaspberryPi上连接的USB设备远程共享

在RaspberryPi上:

  • 安装usbip工具: sudo apt install usbip
  • 加载内核模块: sudo modprobe usbip-host
  • 查看可用的USB设备: usbip list -l
  • 绑定要共享的USB设备(例如busid 1-1): sudo usbip bind -b 1-1
  • 启动usbipd守护进程: sudo usbipd -D

在远端:

  • 安装usbip工具: sudo apt install usbip
  • 加载内核模块: sudo modprobe vhci-hcd
@Vesnica
Vesnica / usbip_wsl2.md
Last active November 23, 2025 06:08
WSL2中安装usbip
  • WSL2中使用的是微软的自定义内核,这导致内核版本和apt库中的内核版本基本不会匹配,进而使得系统认为某些和内核版本强关联的软件(如usbip)没有安装
  • 因此在安装了匹配内核版本的软件包后,需要使用某种机制让软件被调用时自动关联最新版本的二进制路径sudo update-alternatives --install /usr/local/bin/usbip usbip `ls /usr/lib/linux-tools/*/usbip | tail -n1` 20
@Vesnica
Vesnica / BuildKit.md
Last active February 10, 2025 01:01
BuildKit

BuildKit 作用

docker run -dti \
    --name buildkitd \
    --security-opt seccomp=unconfined \
    --security-opt apparmor=unconfined \
    --device /dev/fuse \
    -p 8080:8080 \
 -v $(pwd)/buildkitd.toml:/etc/buildkitd.toml \
@Vesnica
Vesnica / Magazine.md
Last active December 18, 2024 01:54
Magazine
# Force model to always use specified device
# Place in `ComfyUI\custom_nodes` to use
# City96 [Apache2]
#
import types
import torch
import comfy.model_management
class OverrideDevice:
@classmethod
@Vesnica
Vesnica / semantic_kernel_proxy_setting.md
Created November 28, 2023 09:11
Semantic Kernel Proxy Setting
  • Official tutorial won't work if you behind a corp proxy
  • Add the following code to fix:
    import openai
    
    openai.proxy = "http://IP:PORT"
    
  • Additionally, you can set api key like:

openai.api_key_path = "path/to/the/key"