一些脚本和加速链接

一些之前写的和加速镜像链接 欢迎提供更多加速地址

加速链接

镜像站点

前端公共CND

国外经典CDN

国内用推荐

可用但不全

NPM源

Python 镜像源

Maven 镜像仓库

Github 下载加速

Docker 加速

近期Docker许多镜像都无法使用,在网上找了别人说还可以用的 记录一下方便替换 不保真

只需编辑/etc/docker/daemon.json这个文件即可(记得用sudo),替换为以下内容:

1
2
3
4
5
6
{
"registry-mirrors": [
"https://docker.1ms.run",
"https://docker.mybacc.com"
]
}

重启 sudo systemctl restart docker 查看配置 sudo docker info 在最后存在即成功

失效可查看Github

vercel 加速

  • 如果你的网站部署在vercel

    ,则把 cname 记录改为:

    • vercel-cname.xingpingcn.top
  • 如果你的网站部署在netlify

    ,则把 cname 记录改为:

    • netlify-cname.xingpingcn.top
  • 如果你的网站部署在netlifyvercel

    上,则把 cname 记录改为:

    • verlify-cname.xingpingcn.top

参考项目:enhanced-FaaS-in-China

脚本

python

替换字符

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
def replace_special_characters_in_file(file_path):
# 读取文件内容(指定编码方式为utf-8)
with open(file_path, 'r', encoding='utf-8') as file:
content = file.read()

# 替换特殊字符
replaced_content = content.replace('@', '{% psw ').replace('#', '%}')
# 将前边的`@`替换成`{% psw `和`#`替换成`%}`
# 将替换后的内容写回到原始文件中
with open(file_path, 'w', encoding='utf-8') as file:
file.write(replaced_content)

# 示例用法
md_file_path = 'E:/blog/md文档/安工/操作系统/复习资料.md' # 指定Markdown文件路径

replace_special_characters_in_file(md_file_path)

替换链接

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
def replace_link_prefix_in_folder(folder_path, old_prefix, new_prefix):
# 遍历指定文件夹中的所有文件
for root, dirs, files in os.walk(folder_path):
for file_name in files:
if file_name.endswith('.md'): # 仅处理 Markdown 文件
file_path = os.path.join(root, file_name)

# 读取文件内容(指定编码方式为utf-8)
with open(file_path, 'r', encoding='utf-8') as file:
content = file.read()

# 替换链接前缀
replaced_content = content.replace(old_prefix, new_prefix)

# 将替换后的内容写回到原始文件中
with open(file_path, 'w', encoding='utf-8') as file:
file.write(replaced_content)

# 示例用法
folder_path = 'E:\\blog\\hexo\\hexo-SourceRepo\\source\\_posts' # 指定文件夹路径
old_prefix = 'https://tc.aboyzy.top'
new_prefix = 'https://npm.elemecdn.com/aboyzy_blogstatic/'

replace_link_prefix_in_folder(folder_path, old_prefix, new_prefix)