1. nvm

任意快速切换nodejs

curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash

2. github

# 启用代理
git config --global http.proxy http://172.31.0.1:7890
git config --global https.proxy http://172.31.0.1:7890
# 验证
git config --global --get http.proxy
# 只代理github
git config --global http.https://github.com.proxy http://172.31.0.1:7890
# 取消代理
git config --global --unset http.proxy
git config --global --unset https.proxy

x. window 杀端口

kill.bat

F:\>kill 8080

Killing PID 31924 on port 8080 ...

SUCCESS: The process with PID 31924 has been terminated.

Done.

@echo off
set PORT=%1

if "%PORT%"=="" (
    echo Usage: kill 8080
    exit /b
)

for /f "tokens=5" %%a in ('netstat -ano ^| findstr :%PORT%') do (
    set PID=%%a
)

if not defined PID (
    echo No process found on port %PORT%
    exit /b
)

echo Killing PID %PID% on port %PORT% ...
taskkill /F /PID %PID%

echo Done.

x. 快速切换python

https://pyenv.uihtm.com/

https://github.com/pyenv-win/pyenv-win

x. 快速切换java

加入环境变量即可

https://github.com/ystyle/jvms

# 列表版本
jvms rls 
# 下载
jvms install xxxx
# 切换
jvms switch xxxx
# 验证
java -version

x. IP指定网络

在同时连接内网网线和 Wi-Fi 的情况下,系统通常会优先选择路由优先级更高的内网网卡进行通信。如果内网网络未配置外网出口,那么访问互联网时会出现异常。

针对这种场景,可以通过添加静态路由(Route)的方式,将指定 IP 或网段的流量强制走手机热点(Wi-Fi)网络,而其余流量仍然保持走内网网线,实现内外网同时访问且互不影响。

# 我想将我的域名走WiFi不走内网,连接手机的WiFi后先编辑WiFi不要用DHCP改成手动指定,防止后续路由失效

Wireless LAN adapter WLAN:

   Connection-specific DNS Suffix  . :
   IPv6 Address. . . . . . . . . . . : 240a:4280:f000:55fd:4de1:5a7e:2d5b:edd5
   Temporary IPv6 Address. . . . . . : 240a:4280:f000:55fd:850d:f8a6:6427:b82a
   Link-local IPv6 Address . . . . . : fe80::bbf2:2f40:9029:1f00%4
   IPv4 Address. . . . . . . . . . . : 10.102.233.83
   Subnet Mask . . . . . . . . . . . : 255.255.255.0
   Default Gateway . . . . . . . . . : fe80::8cf:3cff:fe4c:d186%4
                                       10.102.233.57

1. window路由删除我的域名IP
route delete 193.112.95.180
2. 指定我的域名IP路由走WiFi(管理员运行cmd)其中 10.102.233.57 为WiFi的网关,不用在意这个值,通常是自动获取的
route add 193.112.95.180 mask 255.255.255.255 10.102.233.57 IF 4 -p
3. 取消这个路由(恢复默认)同步骤1一致
route delete 193.112.95.180

x. idea 复制富文本

从idea复制代码到halo会携带富文本格式可以取消的,Appearance & Behavior > Editor > General = Rich-Text Copy 取消勾选即可