Fix Wsl Missing System Vhd

Written on October 15, 2024

无法将磁盘“C:\Program Files\WSL\system.vhd”附加到 WSL2: 系统找不到指定的文件。 错误代码: Wsl/Service/CreateInstance/CreateVm/MountVhd/HCS/ERROR_FILE_NOT_FOUND

Solution:

  1. Download msi from Microsoft/WSL at Github (https://github.com/microsoft/WSL/releases)
  2. Execute the following command to extract system.vhd from the msi file
  3. Copy the vhd file to the path mentioned above
  4. ...
Read More

Vlookup By Awk

Written on March 8, 2022

awk -F',' '{if(FNR==NR){arr[$1]=$2} if(FNR!=NR){print $1","arr[$1]}}' haystack.file target.file

FNR refers to the record number (typically the line number) in the current file. NR refers to the total record number.

Load the haystack...

Read More

How to Display Host IP in Fiddler

Written on July 8, 2015

Steps

1. Edit CustomRules.js

Fiddler > Ctrl+R > locate function Main()

2. Add one line of code


FiddlerObject.UI.lvSessions.AddBoundColumn("ServerIP", 120,...
Read More

Curl Common Usages

Written on January 21, 2015

2015-12-29 updated: A simple way to fetch contents using host:


curl -H 'Host: legendctu.github.io' 'http://127.0.0.1/shell'

2015-01-21:


curl --user-agent 'this is ua' --cookie 'this=cookie&key=value' Read More

Scp Common Usages

Written on December 31, 2014

scp -P port source target

本地 拷贝到 远程


scp -P port /path/to/file remote_username@remote_ip:/path/to/file

远程 拷贝到 本地


scp -P port remote_username@remote_ip:/path/to/file /path/to/file
...
Read More