Skip to main content

2 posts tagged with "win7"

View All Tags

在window中 让makefile 自动补全生效

· One min read
timger
timger

以管理员身份打开PowerShell,然后执行:

# 查看当前执行策略
Get-ExecutionPolicy

# 将执行策略设置为 RemoteSigned(推荐)
Set-ExecutionPolicy RemoteSigned -Scope CurrentUser

# 或者设置为 Bypass(临时解决方案)
Set-ExecutionPolicy Bypass -Scope CurrentUser -Force

# 验证更改
Get-ExecutionPolicy -List

在powershell 中

 notepad $PROFILE

编辑文件

# Make 命令补全函数
function MakeCompletion {
param($wordToComplete, $commandAst, $cursorPosition)

$makefile = Get-ChildItem -File | Where-Object {
$_.Name -in @('Makefile', 'makefile', 'GNUmakefile')
} | Select-Object -First 1

if ($makefile) {
$targets = Get-Content $makefile.FullName |
Select-String '^\s*([a-zA-Z0-9_-]+):' |
ForEach-Object { $_.Matches.Groups[1].Value } |
Sort-Object -Unique

$targets | Where-Object { $_ -like "$wordToComplete*" } |
ForEach-Object {
[System.Management.Automation.CompletionResult]::new(
$_,
$_,
'ParameterValue',
$_
)
}
}
}

# 注册补全
Register-ArgumentCompleter -CommandName make -ScriptBlock $function:MakeCompletion

现在可以了

make 

输入tab 会自动补全

在容器中运行 winxp 使用docker 运行 winxp 和 win7

· One min read
timger
timger

dockur/windows 是一个容器化的 win 项目

https://github.com/dockur/windows

特点✨ 多语言 ISO 下载器 KVM加速 基于 Web 的查看器

安装

镜像

docker pull ghcr.io/dockur/windows:3.13

运行

docker run \
-it --rm \
-p 8006:8006 \
--cap-add NET_ADMIN \
-e VERSION='winxp' \
-e KVM="N" \
-e RAM_SIZE='1G' \
--stop-timeout 120 \
ghcr.io/dockur/windows:3.13

http://127.0.0.1:8006/?resize=scale&autoconnect=true

他这个 本身使用的事 vnc 技术

win7

改为 可以 开箱即用的镜像

docker commit b46f8da3f4f4 registry.dafengstudio.cn/windows:xp
docker push registry.dafengstudio.cn/windows:xp

win7

docker commit bce2411bd9a4 registry.dafengstudio.cn/windows:win7
docker push registry.dafengstudio.cn/windows:win7