Windows 初始化设置 2025

安装Windows系统时跳过联网验证[^1]

首先安装系统到联网那一步,按shift+F10打开cmd

执行以下命令跳过联网验证:

1
OOBE\BypassNRO

电脑会自动重启,重启回来就可以选“我没有Internet连接”,然后创建本地账号

Windows 环境比较干净的安装/使用软件的方法

  • 零安装网页应用
  • Portable应用、 msix/appx应用
  • 沙盒 (Sandbox)、虚拟机 (VM)、Docker容器化应用
  • 包管理器管理应用(winget)
  • 其他设备投屏使用(手机、NAS)

WinGet 常用操作[^2]

1
2
3
4
5
6
7
8
9
10
11
# 在线搜索一个软件
winget search VisualStudioCode

# 查看软件包信息
winget show ClashVergeRev.ClashVergeRev

# 列出本机安装的软件 | 过滤输出
winget list | Select-String "sync"

# 卸载软件
winget uninstall --id Logseq.Logseq

2025 Windows 软件推荐

目前已安装的软件

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45

# wsl2 docker
wsl.exe --update
wsl --install -d Ubuntu-22.04
winget install -e --id Docker.DockerDesktop

# 浏览器
winget install -e --id Google.Chrome

# IDE
winget install -e --id Microsoft.VisualStudioCode

# 笔记
winget install --id Logseq.Logseq

# Telegram
winget install --id Telegram.TelegramDesktop

# 文件同步
winget install --id Syncthing.Syncthing
winget install --id GermanCoding.SyncTrayzor

# 快速查看文件
winget install -e --id QL-Win.QuickLook

# 文件搜索
winget install -e --id voidtools.Everything

# 文件压缩
winget install -e --id 7zip.7zip

# 截图
winget install -e --id ShareX.ShareX

# Office全家桶
winget.exe install -e --id Microsoft.Office

# 启动器
winget install --id Flow-Launcher.Flow-Launcher

# IDM下载器
winget install Tonec.InternetDownloadManager

# 删除工具
winget install IObit.IObitUnlocker

其他推荐

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35

# 梯子
winget install -e --id ClashVergeRev.ClashVergeRev

# 梯子
winget install -e --id chen08209.FlClash

# 状态栏网速 另外还有lite版
winget install -e --id zhongyang219.TrafficMonitor.Full

# Firefox
winget install -e --id Mozilla.Firefox

# 欧路词典
winget install -e --id Eudic.Eudic

# markdown 编辑器
winget install -e --id Obsidian.Obsidian
winget install -e --id appmakes.Typora

# Simplenote 没找到官方的
winget install -e --id Automattic.Simplenote

# 截图
winget install -e --id Snipaste.Snipaste

# Microsoft.PowerToys
# DBeaver.DBeaver
# Git.Git
# CoreyButler.NVMforWindows
# Postman.Postman

# BT下载器
# steam
# 桌面远程 rustdesk

执行脚本

1
2
powershell -Command "Set-ExecutionPolicy Unrestricted"  
powershell -ExecutionPolicy Bypass -File install.ps1

激活系统 / Office

powershell 激活信息 slmgr /ipk W269N-WFGWX-YVC9B-4J6C9-T83GX slmgr /skms kms8.msguide.com slmgr /ato 上面不行换这个 slmgr /skms kms.digiboy.ir slmgr /ato 上面不行换这个 slmgr /skms kms.chinancce.com slmgr

1
irm https://get.activated.win | iex

参考

[^1]: Set up Windows 11 without internet - oobe\bypassnro

[^2]: Use WinGet to install and manage applications

[Windows 11] 大家的新系统是如何激活的?

WinGet 支持安装软件列表

修改console.log前面加上时间戳

1
2
3
4
5
6
7
8
9
10
(function(){
const oldLog = console.log;
console.log = function(...arr){
arr.unshift((new Date()).toISOString())
oldLog.apply(console, arr);
}
})()

console.log(1.1,'2', null, {a:33})
// 2025-10-22T06:33:45.853Z 1.1 2 null {a: 33}

Obsidian使用Dataview日记概览

读取一个文件夹下的所有日记文件,生成一个日记概览,包括日期、内容。达到类似logseq的日记效果。
安装插件:Dataview https://github.com/blacksmithgu/obsidian-dataview 开启dataviewjs功能
根目录新建文件,贴入下面代码

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
/**
* 生成最近N天的日期数组(降序排列)
* @param {number} days - 需要生成的天数
* @param {boolean} [includeToday=true] - 是否包含今天
* @returns {string[]} 日期字符串数组,格式:YYYY-MM-DD
*/
function getRecentDates(days, includeToday = true) {
// 参数校验
if (typeof days !== 'number' || days < 1) return [];

// 初始化日期对象
const date = new Date();
if (!includeToday) date.setDate(date.getDate() - 1);

// 日期格式化函数
const format = d => [
d.getFullYear(),
(d.getMonth() + 1).toString().padStart(2, '0'),
d.getDate().toString().padStart(2, '0')
].join('_');

// 生成日期数组
const result = [];
for (let i = 0; i < days; i++) {
result.push(format(new Date(date)));
date.setDate(date.getDate() - 1);
}

return result;
}

const arr = getRecentDates(200);

arr.map(d => dv.paragraph(`![[${d}]]`))

另一种方式

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
function reverseArray(arr) {
const reversed = [];
for (let i = arr.length - 1; i >= 0; i--) {
reversed.push(arr[i]);
}
return reversed;
}

const pages = dv.pages('"journals"').slice(-20)
const a = reverseArray(pages)

a.map(async page => {
const filePath = page.file.path;
const fileContent = await app.vault.read(app.vault.getAbstractFileByPath(filePath));
// dv.paragraph(`![[${page.file.name}]]`);
dv.paragraph(`#### ${page.file.name}`);
dv.paragraph(`${fileContent}`);
dv.paragraph('\n');
})

别的方案

Daily Notes Viewer 插件 https://github.com/Johnson0907/obsidian-daily-notes-viewer

操作系统快捷键

常常在Windows、Linux、macOS中来回切换,为了减少频繁切换带来的心智负担

记录下来常用的快捷键、操作

阅读更多

记录一次Windows重启导致的docker报错

win11电脑,有个ARMOURY CRATE的软件更新,居然直接给我电脑重启了,后面他还没更新成功 我焯

结果就是docker报错了

1
running engine: waiting for the VM setup to be ready: starting WSL engine: bootstrapping in the main distro: starting wsl-bootstrap: context canceled
阅读更多

CSS-BEM

CSS中的BEM思想

BEM是block element modifer的简写,是一种CSS命名的方法论

给CSS样式起名的方法中:

- 中划线 :名称连字符

–双中划线:表示元素的一种状态

__双下划线:连接父子元素名字

阅读更多

SwitchyOmega初始化设置

浏览器插件,用来管理浏览器的proxy,用它就不需要开system proxy,防止影响其他应用

SwitchyOmega不更新了 不推荐 建议改用ZeroOmega

阅读更多

npx在线调用

npx 指令从npm5.2就内置了,可以在线调用npm包而不用下载到本地再执行

ie: cowsay 指令

1
2
3
4
5
6
7
8
9
10
➜  ~ npx cowsay owow
______
< owow >
------
\ ^__^
\ (oo)\_______
(__)\ )\/\
||----w |
|| ||
➜ ~

可以直接编译&运行ts文件

1
npx ts-node script.ts

可以执行 create-react-app 脚本

1
npx create-react-app .

也可以调用自己写的GitHub gist代码片段

1
2
3
4
5
➜  my-project git:(main) npx https://gist.github.com/miloweimo/491623a136c0ceed0371c10ae95c86a0
Need to install the following packages:
gist:491623a136c0ceed0371c10ae95c86a0
Ok to proceed? (y)
helllllloooooo~~

参考

我写的hellojs https://gist.github.com/miloweimo/491623a136c0ceed0371c10ae95c86a0

别人写的hellojs https://gist.github.com/Tynael/0861d31ea17796c9a5b4a0162eb3c1e8

别人写的readme https://gist.github.com/CarsonSlovoka/ad04ee083bd2dde825060160546b8059

免输密码直接scp传文件的研究

❌ yes指令

1
(yes ${PWD} | head -2 && yes y | head -1) | scp test xx@yy:zz

实测不行

❌ scp -S参数

没有这个写法

✅添加公钥到服务器

可以直接scp

✅sshpass输密码

可以但是部分系统不支持

前端项目添加 打包脚本 部署脚本 生成改动日志脚本

打包脚本

package.json 添加

1
2
3
// ..
"zip": "zip -r dist-$(git rev-parse --abbrev-ref HEAD)-$npm_package_name-$npm_package_version-$(date +'%Y_%m_%d').zip dist/ && open .",
"bz": "npm run build && npm run zip"

然后运行 npm run bz 就能直接打开打包好的zip包目录

阅读更多