From 01c6afa4f66238903b6a92326ba19f132aed1c0b Mon Sep 17 00:00:00 2001 From: Super Manito <68613938+SuperManito@users.noreply.github.com> Date: Thu, 14 Nov 2024 21:57:28 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ChangeMirrors.sh | 16 +++++++++++++--- DockerInstallation.sh | 7 ++++--- docs/other/index.md | 44 ++++++++++++++++++++++++++++++++++++++++++- 3 files changed, 60 insertions(+), 7 deletions(-) diff --git a/ChangeMirrors.sh b/ChangeMirrors.sh index df404e80..5592bbe1 100755 --- a/ChangeMirrors.sh +++ b/ChangeMirrors.sh @@ -1,6 +1,6 @@ #!/bin/bash ## Author: SuperManito -## Modified: 2024-11-08 +## Modified: 2024-11-14 ## License: MIT ## GitHub: https://github.com/SuperManito/LinuxMirrors ## Website: https://linuxmirrors.cn @@ -973,7 +973,7 @@ function choose_mirrors() { local system_name="${SYSTEM_PRETTY_NAME:-"${SYSTEM_NAME} ${SYSTEM_VERSION_NUMBER}"}" local arch="${DEVICE_ARCH}" local date_time time_zone - date_time="$(date "+%Y-%m-%d %H:%M:%S")" + date_time="$(date "+%Y-%m-%d %H:%M")" time_zone="$(timedatectl status 2>/dev/null | grep "Time zone" | awk -F ':' '{print$2}' | awk -F ' ' '{print$1}')" echo -e '' @@ -1376,7 +1376,7 @@ function remove_original_mirrors() { [ -d $Dir_YumRepos ] && rm -rf $Dir_YumRepos/AnolisOS* ;; "${SYSTEM_OPENSUSE}") - [ -d $Dir_openSUSERepos ] && ls $Dir_openSUSERepos/ | grep -E "^repo-" | grep -Ev "openh264" | xargs rm -rf + [ -d $Dir_openSUSERepos ] && rm -rf $Dir_YumRepos/repo-* ;; "${SYSTEM_ARCH}") [ -f $File_ArchLinuxMirrorList ] && sed -i '1,$d' $File_ArchLinuxMirrorList @@ -2083,6 +2083,7 @@ function change_mirrors_openSUSE() { repo-debug-update-non-oss.repo \ repo-debug-update.repo \ repo-non-oss.repo \ + repo-openh264.repo \ repo-oss.repo \ repo-sle-debug-update.repo \ repo-sle-update.repo \ @@ -5301,6 +5302,15 @@ autorefresh=1 baseurl=http://download.opensuse.org/distribution/leap/$releasever/repo/non-oss/ type=rpm-md keeppackages=0 +EOF + cat <<'EOF' >$Dir_openSUSERepos/repo-openh264.repo +[repo-openh264] +name=Open H.264 Codec (openSUSE Leap) +enabled=1 +autorefresh=1 +baseurl=http://codecs.opensuse.org/openh264/openSUSE_Leap/ +type=rpm-md +keeppackages=0 EOF cat <<'EOF' >$Dir_openSUSERepos/repo-oss.repo [repo-oss] diff --git a/DockerInstallation.sh b/DockerInstallation.sh index e73c9c23..f0a1e8b2 100755 --- a/DockerInstallation.sh +++ b/DockerInstallation.sh @@ -441,12 +441,13 @@ function choose_mirrors() { function print_title() { local system_name="${SYSTEM_PRETTY_NAME:-"${SYSTEM_NAME} ${SYSTEM_VERSION_NUMBER}"}" local arch=""${DEVICE_ARCH}"" - local date="$(date "+%Y-%m-%d %H:%M:%S")" - local timezone="$(timedatectl status 2>/dev/null | grep "Time zone" | awk -F ':' '{print$2}' | awk -F ' ' '{print$1}')" + local date_time time_zone + date_time="$(date "+%Y-%m-%d %H:%M")" + timezone="$(timedatectl status 2>/dev/null | grep "Time zone" | awk -F ':' '{print$2}' | awk -F ' ' '{print$1}')" echo -e '' echo -e " 运行环境 ${BLUE}${system_name} ${arch}${PLAIN}" - echo -e " 系统时间 ${BLUE}${date} ${timezone}${PLAIN}" + echo -e " 系统时间 ${BLUE}${date_time} ${timezone}${PLAIN}" } print_title diff --git a/docs/other/index.md b/docs/other/index.md index 5cb31404..c3cbae8f 100644 --- a/docs/other/index.md +++ b/docs/other/index.md @@ -98,7 +98,7 @@ hide: apt-get remove -y docker* containerd.io runc && apt-get autoremove ``` - > `Debian`   `Ubuntu`   `Kali`   `Linux Mint`   `Deepin`   `Armbian`   `Proxmox` + > `Debian`   `Ubuntu`   `Kali`   `Linux Mint`   `Deepin`   `Zorin OS`   `Armbian`   `Proxmox` === "RedHat 系 / OpenCloudOS / openEuler / Anolis OS" @@ -109,3 +109,45 @@ hide: > `Red Hat Enterprise Linux`   `CentOS`   `Rocky Linux`   `AlmaLinux`   `Fedora`   `OpenCloudOS`   `openEuler`   `Anolis OS` 卸载完成后重新执行脚本安装即可 + +## 其它 + +提供一些常见服务的一键换源命令,用于备忘 + +### NPM + +适用于 `npm` `yarn` `pnpm` 等 + +=== "淘宝源" + + ``` bash + npm config set registry https://registry.npmmirror.com/ + ``` + +=== "腾讯云" + + ``` bash + npm config set registry https://mirrors.tencent.com/npm/ + ``` + +### PYPI + +适用于 `pip` `pip3` + +=== "阿里云" + + ``` bash + pip3 config set global.index-url https://mirrors.aliyun.com/pypi/simple/ + ``` + +=== "腾讯云" + + ``` bash + pip3 config set global.index-url https://mirrors.tencent.com/pypi/simple/ + ``` + +=== "中科大" + + ``` bash + pip3 config set global.index-url https://pypi.mirrors.ustc.edu.cn/simple/ + ```