常用源&配置

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

rocky9

#更换rocky源
sed -e 's|^mirrorlist=|#mirrorlist=|g' \
    -e 's|^#baseurl=http://dl.rockylinux.org/$contentdir|baseurl=https://mirrors.ustc.edu.cn/rocky|g' \
    -i.bak \
    /etc/yum.repos.d/rocky-extras.repo \
    /etc/yum.repos.d/rocky.repo
dnf makecache

#开启epel
dnf config-manager --set-enabled crb
dnf install epel-release -y

#更换epel源
sed -e 's|^mirrorlist=|#mirrorlist=|g' \
    -e 's|^#baseurl=http://dl.rockylinux.org/$contentdir|baseurl=https://mirrors.ustc.edu.cn/rocky|g' \
    -i.bak \
    /etc/yum.repos.d/epel.repo
dnf makecache

uv

win:%APPDATA%\uv\uv.toml
linux:~/.config/uv/uv.toml

[[index]]
url = "https://mirrors.ustc.edu.cn/pypi/web/simple"
default = true

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:
  - defaults
show_channel_urls: true
default_channels:
  - https://mirrors.ustc.edu.cn/anaconda/pkgs/main
  - https://mirrors.ustc.edu.cn/anaconda/pkgs/r
  - https://mirrors.ustc.edu.cn/anaconda/pkgs/msys2
custom_channels:
  conda-forge: https://mirrors.ustc.edu.cn/anaconda/cloud
  bioconda: https://mirrors.ustc.edu.cn/anaconda/cloud">~/.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;
cat > /usr/share/maven/conf/settings.xml <<'EOF'
<?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 
                              https://maven.apache.org/xsd/settings-1.0.0.xsd">
  <mirrors>
    <mirror>
      <id>aliyunmaven</id>
      <mirrorOf>central</mirrorOf>
      <name>阿里云公共仓库</name>
      <url>https://maven.aliyun.com/repository/public</url>
    </mirror>
  </mirrors>
</settings>
EOF

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 -> 打开基于虚拟化的安全,禁用即可。

Win同步网络时间

w32tm /config /manualpeerlist:"ntp.ntsc.ac.cn" /syncfromflags:manual /update

修改后重启。如需恢复,改回未配置或已启用都可以。

posted @ 2019-12-10 18:14  秒年度  阅读(465)  评论(0)    收藏  举报