记一些小随笔

Create: 2023-07-18

Update: 2024-07-30

使用 vs2022 预览版编译 7-zip

PS:奇怪的%InstallDir%获取不到位置

使用github克隆的源码
https://github.com/WinMerge/sevenzip
更改BuildBin.vs2022.cmd中第33行为
call "%InstallDir%\VC\Auxiliary\Build\vcvarsall.bat" %ARCH%
call "C:\Program Files\Microsoft Visual Studio\2022\Preview\VC\Auxiliary\Build\vcvarsall.bat" %ARCH%

关闭 virtualbox 新版本通知中心

PS: 新版本一直提醒且需手动关闭有点烦

讨论贴链接:https://forums.virtualbox.org/viewtopic.php?f=7&t=107743&start=15
VBoxManage setextradata global GUI/SuppressMessages confirmGoingFullscreen, remindAboutMouseIntegration, remindAboutAutoCapture

新版 win11 安装镜像强制联网登录微软账号

安装页面shift+F10, cmd内输入OOBE\BYPASSNRO

windows 预览版回退且保留数据

PS:严重警告, 博主未回退成功, 安装完成后报错 safeos error 被强制回退, 关闭安全引导无效

此处PS:切勿先运行setup.exe, 不然windows会挂载镜像导致无法修改dll
使用ida打开/sources/setupcompat.dll
此处PS:需要联网索引pdb才能搜索到相关函数
搜索ConX::Setup::Common::CWindowsVersion::IsLaterThan
定位到函数结尾的MOV eax , 1
查看对应的hex值
随便找个hex编辑器修改相关的hex值
将B8 01 改成 B8 00

kail 默认使用 x11 且无法切换为 Wayland 渲染

PS:博主已经几年未使用 debian 系了, 此处Update: 2021-05-28

因udev匹配规则导致wayland被禁用
sudo mv /usr/lib/gdm3/gdm-disable-wayland /usr/lib/gdm3/gdm-disable-wayland-bak
sudo rm -rf /run/gdm3

切记要安装gnome的Wayland后端mutter
sudo apt install mutter
直接删除禁用脚本, 一劳永逸

更新 windows powershell 获得类 zsh 的体验

winget install --id Microsoft.Powershell --source winget

配置 winget 镜像站

winget source remove winget
winget source add winget https://mirrors.ustc.edu.cn/winget-source

恢复默认
winget source reset winget

为 powershell 设置实现本博客中 zsh 的配色

创建powershell配置文件
new-item $PROFILE.AllUsersAllHosts -ItemType file -Force

为配置文件profile.ps1写入如下配置

function prompt {
    $host.UI.RawUI.ForegroundColor = "Red"
    Write-Host "[" -NoNewline
    $host.UI.RawUI.ForegroundColor = "Yellow"
    Write-Host "$env:USERNAME" -NoNewline
    $host.UI.RawUI.ForegroundColor = "Green"
    Write-Host "@" -NoNewline
    $host.UI.RawUI.ForegroundColor = "Blue"
    Write-Host "$env:COMPUTERNAME" -NoNewline
    $host.UI.RawUI.ForegroundColor = "Magenta"
    Write-Host " $pwd" -NoNewline
    $host.UI.RawUI.ForegroundColor = "Red"
    Write-Host "]" -NoNewline
    $host.UI.RawUI.ForegroundColor = "White"
    Write-Host "$" -NoNewline
	" "
}

Minecraft 开服

screen -S minecraft java -Xmx2048M -Xms1024M -javaagent:authlib-injector-1.2.4.jar=https://littleskin.cn/api/yggdrasil -jar fabric-server-mc.1.20.2-loader.0.14.25-launcher.0.11.2.jar

使用ctrl+a 然后单击 d 退出窗口

恢复窗口 screen -r minecraft

windows 优化及彻底干掉 Defender

基于windows专业版
组策略关闭windows defender防病毒选项即使启用了也会被defender强制恢复

直接进PE, 使用后悔药
将"C:\ProgramData\Microsoft\Windows Defender" 随便重命名

24H2更新后
需将"C:\Program Files\Windows Defender"
"C:\Program Files (x86)\Windows Defender" 均进行重命名或删除

开机后组策略 关闭实时保护,  关闭windows defender防病毒
防止windows更新defender策略,  以及防止大量错误日志

Edge 120版本无限后台运行
组策略 允许小组件,  用户配置-关闭windows Copilot

windows 默认字体替换推荐

https://github.com/Pal3love/dream-han-cjk/
博主比较喜欢胖一些的字体,  该字体有29个字号可供选择,  本人配置如下
Bold 23
Regular 15
Light 6
随便找个脚本剥离雅黑的字体信息替换即可

Arch Linux Nginx 踩坑

pacman -S nginx-mainline #推荐安装主线包

默认配置文件 worker_processes 只给了 1
按照 wiki 推荐更改配置

user http;
worker_processes auto;
worker_cpu_affinity auto;

events {
    multi_accept on;
    worker_connections 1024;
}

http {
    charset utf-8;
    sendfile on;
    tcp_nopush on;
    tcp_nodelay on;
    server_tokens off;
    log_not_found off;
    types_hash_max_size 4096;
    client_max_body_size 16M;

    # MIME
    include mime.types;
    default_type application/octet-stream;

    # logging
    access_log /var/log/nginx/access.log;
    error_log /var/log/nginx/error.log warn;

    # load configs
    include /etc/nginx/conf.d/*.conf;
    include /etc/nginx/sites-enabled/*;
}

windows 无限创建 System Volume Information

直接禁用 windows 搜索,禁用系统保护即可

持续更新中