Skip to content

Instantly share code, notes, and snippets.

View yiqiangjizhang's full-sized avatar
🏠
Working from home

Yi Qiang Ji Zhang yiqiangjizhang

🏠
Working from home
View GitHub Profile
@ThePlenkov
ThePlenkov / boot.sh
Last active April 19, 2025 09:29
Resolve WSL DNS automatically
#!/bin/bash
# Remove existing "nameserver" lines from /etc/resolv.conf
sed -i '/nameserver/d' /etc/resolv.conf
# Run the PowerShell command to generate "nameserver" lines and append to /etc/resolv.conf
# we use full path here to support boot command with root user
/mnt/c/Windows/System32/WindowsPowerShell/v1.0/powershell.exe -Command '(Get-DnsClientServerAddress -AddressFamily IPv4).ServerAddresses | ForEach-Object { "nameserver $_" }' | tr -d '\r'| tee -a /etc/resolv.conf > /dev/null
@HPZ07
HPZ07 / FixYoutubeAltTabPlayPauseIssue.user.js
Last active March 15, 2025 14:43
Fix YouTube's Alt-Tab Pause/Play Issue
// ==UserScript==
// @name Fix YouTube's Alt-Tab Pause/Play Issue
// @namespace http://tampermonkey.net/
// @version 0.4
// @description Fix YouTube's Alt-Tab Pause/Play Issue
// @author HPZ07
// @match https://www.youtube.com/*
// @icon https://www.google.com/s2/favicons?sz=64&domain=youtube.com
// @grant none
// ==/UserScript==