常用源&配置
ubuntu
- 阿里源已被限速,中科大的还行
cp -r /etc/apt/sources.list /etc/apt/sources.list.origin ;sed -i 's@//.*archive.ubuntu.com@//mirrors.ustc.edu.cn@g' /etc/apt/sources.list
pip
- 可以的话,不要用
python3.6
,最起码也要3.7
以上 - 升级
pip
到最新的版本(>=10.0.0)
后进行配置:
pip install -i https://mirrors.ustc.edu.cn/pypi/web/simple pip -U
pip config set global.index-url https://mirrors.ustc.edu.cn/pypi/web/simple
-
中科大的源虽然快,但有时可能会缺少包,阿里备用:
https://mirrors.aliyun.com/pypi/simple/
-
手动配置
pip.conf
[global]
index-url=https://mirrors.ustc.edu.cn/pypi/web/simple
[install]
trusted-host=mirrors.ustc.edu.cn
conda
echo "\
channels:
- https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/
- https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
- https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge/
- https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/pytorch/
ssl_verify: true">~/.condarc
npm
npm config set registry https://registry.npmmirror.com
docker
echo "\
{
\"registry-mirrors\": [
\"https://kfwkfulq.mirror.aliyuncs.com\",
\"https://2lqq34jg.mirror.aliyuncs.com\",
\"https://pee6w651.mirror.aliyuncs.com\",
\"https://registry.docker-cn.com\",
\"http://hub-mirror.c.163.com\"
],
\"dns\": [
\"8.8.8.8\",
\"8.8.4.4\"
]
}" > /etc/docker/daemon.json && /etc/init.d/docker restart
maven
cp -r /etc/maven/settings.xml /etc/maven/settings.xml.origin;echo -e "\
<?xml version="1.0" encoding="UTF-8"?>
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd">
<pluginGroups>
</pluginGroups>
<proxies>
</proxies>
<servers>
</servers>
<mirrors>
<mirror>
<id>huaweicloud</id>
<mirrorOf>central</mirrorOf>
<url>https://mirrors.huaweicloud.com/repository/maven/</url>
</mirror>
</mirrors>
<profiles>
</profiles>
</settings>">/etc/maven/settings.xml
Flutter
maven { url 'https://maven.aliyun.com/repository/google' }
maven { url 'https://maven.aliyun.com/repository/jcenter' }
maven { url 'http://maven.aliyun.com/nexus/content/groups/public' }
electron binary
npm config set registry=https://registry.npmmirror.com
npm config set disturl=https://registry.npmmirror.com/-/binary/node
git 保存密码
git config --global credential.helper store
常用bat
bat脚本后台运行
@echo off
if "%1"=="h" goto begin
start mshta vbscript:createobject("wscript.shell").run("""%~nx0"" h",0)(window.close)&&exit
:begin
::下面是自己的命令
cd /d %~dp0
关闭指定端口进程
CMD:
for /f "tokens=5" %a in ('netstat -aon ^| find ":8080" ^| find "LISTENING"') do taskkill /f /pid %a
BAT:
for /f "tokens=5" %%a in ('netstat -aon ^| find ":8080" ^| find "LISTENING"') do taskkill /f /pid %%a
PowerShell
查看已保存的WIFI
密码
foreach ($item in (netsh wlan show profile|where{ $_ -match "文件"})){netsh wlan show profile name=($item -replace " 所有用户配置文件 : ","") key=clear|where{ $_ -match " 名称|关键内容"}}
WIN11远程桌面保存密码
通过运行 gpedit.msc 组策略管理控制台,找到 计算机配置 -> 管理模板 -> 系统 -> Device Guard -> 打开基于虚拟化的安全,禁用即可。
修改后重启。如需恢复,改回未配置或已启用都可以。