踩坑小笔记 第一期
本篇主要记录本人在折腾路上碰到的一些小问题以及简要的解决方案,希望能帮到有需要的各位。
一. Linux篇
1.1 为虚拟显示器设置自定义分辨率
set custom resolution for virtual displays
1 | cvt 1366 768 |
(cvt
is used to detect proper Modeline
for specified resolution, like a calculator, and its output can be used in following xrandr
commands.)
1.2 设置systemd日志文件最大大小
set maximum size of systemd journal
1 | vi /etc/systemd/journald.conf |
Inside journald.conf
, set your desired limit, like SystemMaxUse=50M
, then run sudo systemctl restart systemd-journald.service
to apply changes.
1.3 修复系统中文支持异常问题,如无法显示中文路径
fix Chinese support in Linux
1 | locale -a |
In locale.gen
, uncomment zh_CN.UTF-8 UTF-8
and zh_CN GB2312
.
1.4 在bash中使用sudo重新执行上一条指令
1 | sudo !! |
1.5 让系统多使用物理内存,少使用交换空间
make system use more physical memory and less swap space
1 | sudo vi /etc/sysctl.conf |
1.6 为apt设置https代理
set https proxy for apt
Temporary proxy: add this parameter in your apt command:
1 | -o Acquire::http::proxy="http://127.0.0.1:1080" |
二. Windows篇
2.1 移除‘此电脑’中不需要的库文件夹
remove unnecessary folders in ‘This PC’, like ‘3D Objects’
1 | HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\MyComputer\NameSpace |
(Or use a third-party software to do this visually, like ‘Windows11 Manager’.)
2.2 修改系统RDP端口
change RDP port for major Windows versions
1 | (Get-ItemProperty -Path "HKLM:\System\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp\" -Name PortNumber).PortNumber |
(Also see Microsoft official link)
三. Miscellaneous
3.1 修复代码文件在不同系统间移动时因行分隔符不同而导致的无效git操作
fix line endings in git
1 | git config --global core.autocrlf input |
3.2 为Git配置https代理
set https proxy for git
1 | git config --global https.proxy http://127.0.0.1:1080 |
(effective for repos whose remote is in https protocol, check with git remote -v
)
3.3 为ssh配置socks5代理
set socks5 proxy for ssh in user config file
Add following line in your .ssh/config file:
1 | Host github.com |
And remind that ‘connect’ maybe not in your PATH so cannot be executed directly, you can find it in your git installation directory, like C:\Program Files\Git\mingw64\bin\connect.exe
, and use that path to replace the single connect
in above commands.
- Title: 踩坑小笔记 第一期
- Author: Clayton Ryan
- Created at : 2024-01-24 10:41:00
- Updated at : 2024-01-24 12:13:02
- Link: https://blog.eddy.moe/2024/01/24/GeneralNote-1/
- License: This work is licensed under CC BY-NC-SA 4.0.