Windows 自带的鼠标样式其实看着“中规中矩”,不说难看但是看习惯也就能用。macOS 的鼠标样式就很🉑。
之前搜索鼠标样式的时候去 GitHub 看了一下,果然还真有这么正经的鼠标样式 Apple Cursor。
Windows 和 Linux 如何安装 README 里都有写清楚,我尝试安装并启用,效果非常不错,很“细腻”。
如果你感兴趣的话也可以下载并安装尝试一下。
Windows 自带的鼠标样式其实看着“中规中矩”,不说难看但是看习惯也就能用。macOS 的鼠标样式就很🉑。
之前搜索鼠标样式的时候去 GitHub 看了一下,果然还真有这么正经的鼠标样式 Apple Cursor。
Windows 和 Linux 如何安装 README 里都有写清楚,我尝试安装并启用,效果非常不错,很“细腻”。
如果你感兴趣的话也可以下载并安装尝试一下。
Windows 默认的总用户文件夹总是会在系统盘下,如果你的系统盘为 C
盘,则为: C:\Users
,许多默认文件夹也都会放在这里:
AppData
文件夹默认在用户根目录下,存储了大部分软件的数据、配置,无法被改变位置.config
/ .ssh
/ .config
/ scoop
等配置目录也在用户根目录下,无法改变位置系统盘符:\Users\用户名\AppData
里面一般有三个文件夹,分别是 Local
/ LocalLow
/ Roaming
,简单地来说,都是用来存放软件的配置文件和临时文件的,里面有很多以软件名称或软件公司命名的文件夹,还有用户帐户的配置文件。随着系统使用时间的增加和安装软件的增多, AppData
占用的空间会越来越大。
上面这些目录会导致系统盘占用很大,即使其中有部分可以手动指派其它路径,但是每次指定都很麻烦,重装系统时候备份也不方便(用户目录里有许多细碎的小文件,备份非常慢),还不如将用户目录迁出系统盘,所有软件都用默认路径,多省事。
另外,修改了用户路径后,当安装软件只为用户安装时,默认的安装路径也会到你的用户目录所在盘,大大节省了系统盘空间。
当 Windows 连接到网络的时候有时 Sysprep
会失败,所以建议全程关闭网络连接安装系统。安装系统的方法不多做介绍。安装系统重启后停留在选择地区的配置界面。
在系统配置选择地区的界面,按下 Ctrl + Shift + F3
,这时 Windows 会重启,进入 Audit Mode
,然后显示一个 System Preparation Tool
(系统准备工具) ,点击取消,将它关闭。
relocate.xml
现在你可以将电脑连接到网络了。
接下来我们要使用 System Preparation Tool (Sysprep)
工具来设置用户路径。这个工具会执行一个 xml
文件中的配置(也就是 relocate.xml
)。我们现在只需要一个非常简单的 xml
配置文件,只需包含以下内容:
D:/Users
)新建 relocate.xml
,并使用记事本打开拷贝以下代码:
<?xml version="1.0" encoding="utf-8"?>
<unattend xmlns="urn:schemas-microsoft-com:unattend">
<settings pass="oobeSystem">
<component name="Microsoft-Windows-Shell-Setup" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<FolderLocations>
<ProfilesDirectory>D:\Users</ProfilesDirectory>
</FolderLocations>
</component>
</settings>
</unattend>
警告,在操作之前,请先读一下这个:
1. Windows 以字母来标识盘符,但是当安装了 Windows 重启之后,本来你想把用户目录安装到 d 盘,但这个盘符可能会发生改变,比如变成了 e 盘,这个时候就会失败,所以一定要确定好盘符。
2. xml 文件保存到磁盘根目录(不能是 C 盘),例如我把它保存到了 D:\relocate.xml
3. 部分计算机在 Audit Mode 下因为缺少驱动,键盘无法使用,可以借助其他计算机编写,并拷贝,也可以完全用鼠标操作完成,看个人能力。
以管理员身份运行 cmd
,首先确保已停止 WMP Network Sharing Service
服务:
net stop wmpnetworksvc
然后运行以下命令:
%windir%\system32\sysprep\sysprep.exe /oobe /reboot /unattend:d:\relocate.xml
上述命令告诉系统从 Windows\System32\Sysprep
运行 Sysprep
,执行 D:/relocate.xml
中的指令,为 OOBE (the firlst boot of newly installed Windows)
重启准备系统,最后重启。
完成上述操作后,自动重启进入系统,检查 User
目录已经移动到了 D
盘。
警告:操作之前,一定要先创建一个系统映像,做好备份。 对一个 OEM 预先安装的 Windows 使用 Sysprep 是非常危险的。电脑厂商可能有他们自己的 unattended answer file,这样可能就会忽略掉你的 unattended file。在这个过程中可能会出各种错误,所以不建议操作。 如果中途出错了,你的备份文件可以帮助你恢复。 这个操作非常有可能导致你的电脑恢复出厂设置。 警告****1703 或者更高版本,请不要禁用已存在的用户!!! 在 Win10 1703 或更高版本上,千万不要禁用现有用户,因为禁用现有用户可能会让你无法登录 Windows,进而需要重装。
relocate.xml
按照上面说过的步骤新建一个 relocate.xml
文件。
按照上面说过的步骤运行 Sysprep
。
虽然你已经安装了 Windows,但是在 Sysprep
运行之后 OOBE
仍然会运行,这意味着你的电脑会经历初始化程序。
这里有两点需要注意:
OOBE
会要求新建一个用户,如果新建的这个用户和已存在的用户名字相同,那就会发生错误。只需要新建一个随意的账户,之后,再把它删掉就可以了;今天重新安装了 Git 后,发现右击鼠标右侧多出了两个选项“Git Gui Here”和“Git Bash Here”。虽然这样证明我的 Git 已经成功安装了,但还是影响使用感受,遂上网寻找了一下相关的解决方案。
Win + R
调出“运行”窗口,在搜索框中输入“regedit”打开注册表编辑器;Computer\HKEY_CLASSES_ROOT\Directory\Background\shell
。在下方就可以看到 git_gui
和 git_shell
这两项内容,将其删除即可。如果上述方法比较繁琐,可以尝试使用具有管理员权限的 CMD(命令提示符) 执行以下两条语句:
reg delete "HKEY_CLASSES_ROOT\Directory\Background\shell\git_gui" /f
reg delete "HKEY_CLASSES_ROOT\Directory\Background\shell\git_shell" /f
一般情况下,将 /etc/apt/sources.list
文件中 Debian 默认的源地址 http://deb.debian.org/
替换为镜像地址即可。
Debian Buster 以上版本默认支持 HTTPS
源。如果遇到无法拉取 HTTPS
源的情况,请先使用 HTTP
源并安装:
sudo apt install apt-transport-https ca-certificates
# 默认注释了源码镜像以提高 apt update 速度,如有需要可自行取消注释
deb https://mirrors.tuna.tsinghua.edu.cn/debian/ bookworm main contrib non-free non-free-firmware
# deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ bookworm main contrib non-free non-free-firmware
deb https://mirrors.tuna.tsinghua.edu.cn/debian/ bookworm-updates main contrib non-free non-free-firmware
# deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ bookworm-updates main contrib non-free non-free-firmware
deb https://mirrors.tuna.tsinghua.edu.cn/debian/ bookworm-backports main contrib non-free non-free-firmware
# deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ bookworm-backports main contrib non-free non-free-firmware
# deb https://mirrors.tuna.tsinghua.edu.cn/debian-security bookworm-security main contrib non-free non-free-firmware
# # deb-src https://mirrors.tuna.tsinghua.edu.cn/debian-security bookworm-security main contrib non-free non-free-firmware
deb https://security.debian.org/debian-security bookworm-security main contrib non-free non-free-firmware
# deb-src https://security.debian.org/debian-security bookworm-security main contrib non-free non-free-firmware
deb https://mirrors.aliyun.com/debian/ bookworm main non-free non-free-firmware contrib
deb-src https://mirrors.aliyun.com/debian/ bookworm main non-free non-free-firmware contrib
deb https://mirrors.aliyun.com/debian-security/ bookworm-security main
deb-src https://mirrors.aliyun.com/debian-security/ bookworm-security main
deb https://mirrors.aliyun.com/debian/ bookworm-updates main non-free non-free-firmware contrib
deb-src https://mirrors.aliyun.com/debian/ bookworm-updates main non-free non-free-firmware contrib
deb https://mirrors.aliyun.com/debian/ bookworm-backports main non-free non-free-firmware contrib
deb-src https://mirrors.aliyun.com/debian/ bookworm-backports main non-free non-free-firmware contrib
deb https://mirrors.tencent.com/debian/ bookworm main non-free non-free-firmware contrib
deb-src https://mirrors.tencent.com/debian/ bookworm main non-free non-free-firmware contrib
deb https://mirrors.tencent.com/debian-security/ bookworm-security main
deb-src https://mirrors.tencent.com/debian-security/ bookworm-security main
deb https://mirrors.tencent.com/debian/ bookworm-updates main non-free non-free-firmware contrib
deb-src https://mirrors.tencent.com/debian/ bookworm-updates main non-free non-free-firmware contrib
deb https://mirrors.tencent.com/debian/ bookworm-backports main non-free non-free-firmware contrib
deb-src https://mirrors.tencent.com/debian/ bookworm-backports main non-free non-free-firmware contrib
deb https://mirrors.163.com/debian/ bookworm main non-free non-free-firmware contrib
deb-src https://mirrors.163.com/debian/ bookworm main non-free non-free-firmware contrib
deb https://mirrors.163.com/debian-security/ bookworm-security main
deb-src https://mirrors.163.com/debian-security/ bookworm-security main
deb https://mirrors.163.com/debian/ bookworm-updates main non-free non-free-firmware contrib
deb-src https://mirrors.163.com/debian/ bookworm-updates main non-free non-free-firmware contrib
deb https://mirrors.163.com/debian/ bookworm-backports main non-free non-free-firmware contrib
deb-src https://mirrors.163.com/debian/ bookworm-backports main non-free non-free-firmware contrib
deb https://mirrors.huaweicloud.com/debian/ bookworm main non-free non-free-firmware contrib
deb-src https://mirrors.huaweicloud.com/debian/ bookworm main non-free non-free-firmware contrib
deb https://mirrors.huaweicloud.com/debian-security/ bookworm-security main
deb-src https://mirrors.huaweicloud.com/debian-security/ bookworm-security main
deb https://mirrors.huaweicloud.com/debian/ bookworm-updates main non-free non-free-firmware contrib
deb-src https://mirrors.huaweicloud.com/debian/ bookworm-updates main non-free non-free-firmware contrib
deb https://mirrors.huaweicloud.com/debian/ bookworm-backports main non-free non-free-firmware contrib
deb-src https://mirrors.huaweicloud.com/debian/ bookworm-backports main non-free non-free-firmware contrib
#http://mirrors.163.com/debian/为软件源也可以为其他的 bullseye为版本代号 main non-free contrib区别如下
deb https://mirrors.163.com/debian/ bullseye main non-free contrib
deb-src https://mirrors.163.com/debian/ bullseye main non-free contrib
deb https://mirrors.163.com/debian-security/ bullseye-security main
deb-src https://mirrors.163.com/debian-security/ bullseye-security main
deb https://mirrors.163.com/debian/ bullseye-updates main non-free contrib
deb-src https://mirrors.163.com/debian/ bullseye-updates main non-free contrib
deb https://mirrors.163.com/debian/ bullseye-backports main non-free contrib
deb-src https://mirrors.163.com/debian/ bullseye-backports main non-free contrib
deb https://mirrors.tencent.com/debian/ bullseye main non-free contrib
deb-src https://mirrors.tencent.com/debian/ bullseye main non-free contrib
deb https://mirrors.tencent.com/debian-security/ bullseye-security main
deb-src https://mirrors.tencent.com/debian-security/ bullseye-security main
deb https://mirrors.tencent.com/debian/ bullseye-updates main non-free contrib
deb-src https://mirrors.tencent.com/debian/ bullseye-updates main non-free contrib
deb https://mirrors.tencent.com/debian/ bullseye-backports main non-free contrib
deb-src https://mirrors.tencent.com/debian/ bullseye-backports main non-free contrib
deb https://mirrors.aliyun.com/debian/ bullseye main non-free contrib
deb-src https://mirrors.aliyun.com/debian/ bullseye main non-free contrib
deb https://mirrors.aliyun.com/debian-security/ bullseye-security main
deb-src https://mirrors.aliyun.com/debian-security/ bullseye-security main
deb https://mirrors.aliyun.com/debian/ bullseye-updates main non-free contrib
deb-src https://mirrors.aliyun.com/debian/ bullseye-updates main non-free contrib
deb https://mirrors.aliyun.com/debian/ bullseye-backports main non-free contrib
deb-src https://mirrors.aliyun.com/debian/ bullseye-backports main non-free contrib
deb https://mirrors.huaweicloud.com/debian/ bullseye main non-free contrib
deb-src https://mirrors.huaweicloud.com/debian/ bullseye main non-free contrib
deb https://mirrors.huaweicloud.com/debian-security/ bullseye-security main
deb-src https://mirrors.huaweicloud.com/debian-security/ bullseye-security main
deb https://mirrors.huaweicloud.com/debian/ bullseye-updates main non-free contrib
deb-src https://mirrors.huaweicloud.com/debian/ bullseye-updates main non-free contrib
deb https://mirrors.huaweicloud.com/debian/ bullseye-backports main non-free contrib
deb-src https://mirrors.huaweicloud.com/debian/ bullseye-backports main non-free contrib
# 默认注释了源码镜像以提高 apt update 速度,如有需要可自行取消注释
deb https://mirrors.tuna.tsinghua.edu.cn/debian/ bullseye main contrib non-free
# deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ bullseye main contrib non-free
deb https://mirrors.tuna.tsinghua.edu.cn/debian/ bullseye-updates main contrib non-free
# deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ bullseye-updates main contrib non-free
deb https://mirrors.tuna.tsinghua.edu.cn/debian/ bullseye-backports main contrib non-free
# deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ bullseye-backports main contrib non-free
# deb https://mirrors.tuna.tsinghua.edu.cn/debian-security bullseye-security main contrib non-free
# # deb-src https://mirrors.tuna.tsinghua.edu.cn/debian-security bullseye-security main contrib non-free
deb https://security.debian.org/debian-security bullseye-security main contrib non-free
# deb-src https://security.debian.org/debian-security bullseye-security main contrib non-free
目前自己写的项目都是使用的是 npm,但是昨天偶然看到了介绍,想把自己的项目从 npm 替换为 pnpm,遂上网搜索了一下迁移教程。
介于 npm 与 pnpm 的区别,可以浏览我先前发布的文章:《npm、yarn、pnpm 各自区别》。
npm
迁移到 pnpm
需要执行以下步骤:
npm
包首先,将 npm
包从当前项目中卸载
rm -rf node_modules
pnpm
安装 pnpm
,以便可以在项目中使用它
npm install -g pnpm
在项目目录下创建 .npmrc
的文件
# pnpm 配置
shamefully-hoist=true
auto-install-peers=true
strict-peer-dependencies=false
将 package-lock.json
和 yarn.lock
转成 pnpm-lock.yaml
文件,保证依赖版本不变
pnpm import
通过 pnpm
安装依赖包
pnpm install
最后,迁移完成!
在项目正常运行之后,可以删除原本的 package-lock.json
和 yarn.lock
文件,保持项目的整洁。