命令速查

命令速查

命令速查 pip 设置镜像源 pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple pip install -i https://pypi.tuna.tsinghua.edu.cn/simple Git 清理

命令速查

pip 设置镜像源

pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple
pip install -i https://pypi.tuna.tsinghua.edu.cn/simple 

Git 清理提交记录

# 切换到一个脱离主分支的另外一条全新主分支,不用太在意叫什么,因为后面还会修改分支名称
git checkout --orphan latest_branch
# 暂存所有改动过的文件,内容为当前旧分支的最新版本所有文件
git add -A
#提交更改
git commit -am "update"
#删除原始主分支
git branch -D master
#将当前分支重命名为 main
git branch -m master
#最后,强制更新您的存储库
git push -f origin master

#原文链接:https://blog.csdn.net/weixin_40289389/article/details/124269007

kafka 查看topic

kafka-topics.sh --bootstrap-server hostip:9092 --list

Conda 取消默认进入Base环境

conda config --set auto_activate_base false

Conda 设置镜像源

conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/pytorch/
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/pytorch/linux-64/
conda config --set show_channel_urls yes

Jupyter 配置文件

jupyter lab --generate-config

vim /root/.jupyter/jupyter_lab_config.py

Screen 安装

# centos 8-9
yum   install   epel-release -y
yum   install   screen       -y

Docker 普通用户使用

sudo groupadd docker     #添加docker用户组
sudo gpasswd -a $USER docker     #将登陆用户加入到docker用户组中
newgrp docker     #更新用户组
docker ps    #测试docker命令是否可以使用sudo正常使用

Git 配置Proxy

git config --global http.proxy 127.0.0.1:7890 --replace-all 
git config --global https.proxy 127.0.0.1:7890

git config --global --unset http.proxy 
git config --global --unset https.proxy 

Tensorflow 安装

conda create -n tensorflow python=3.9
conda activate tensorflow
pip install tensorflow[and-cuda] -i https://pypi.mirrors.ustc.edu.cn/simple 
python3 -c "import tensorflow as tf; print(tf.config.list_physical_devices('GPU'))"

Ubuntu apt 设置镜像源

vi /etc/apt/sources.list

deb https://mirrors.ustc.edu.cn/ubuntu/ jammy main restricted universe multiverse
deb-src https://mirrors.ustc.edu.cn/ubuntu/ jammy main restricted universe multiverse
deb https://mirrors.ustc.edu.cn/ubuntu/ jammy-updates main restricted universe multiverse
deb-src https://mirrors.ustc.edu.cn/ubuntu/ jammy-updates main restricted universe multiverse
deb https://mirrors.ustc.edu.cn/ubuntu/ jammy-backports main restricted universe multiverse
deb-src https://mirrors.ustc.edu.cn/ubuntu/ jammy-backports main restricted universe multiverse
deb https://mirrors.ustc.edu.cn/ubuntu/ jammy-security main restricted universe multiverse
deb-src https://mirrors.ustc.edu.cn/ubuntu/ jammy-security main restricted universe multiverse

vi /etc/apt/apt.conf.d/no-verify.conf
Acquire::https::Verify-Peer "false";
Acquire::https::Verify-Host "false";
apt-get update
apt-get install ca-certificates
apt-get upgrade

Docker 设置镜像源

vim  /etc/docker/daemon.json

{
    "registry-mirrors": [
        "https://docker.mirrors.ustc.edu.cn",
		"http://hub-mirror.c.163.com",
        "https://registry.docker-cn.com"
    ]
}

service docker restart

Centos 8 设置镜像源

rm -rf /etc/yum.repos.d/*
curl -o /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-8.repo

yum update
yum upgrade

npm 设置镜像源

npm config set registry https://registry.npmmirror.com

Linux 设置代理

export https_proxy=http://127.0.0.1:7890/
export http_proxy=http://127.0.0.1:7890/

Golang 设置镜像源

# 临时
export GOPROXY=https://goproxy.cn,direct

# 永久
go env -w GOPROXY=https://goproxy.cn,direct

LICENSED UNDER CC BY-NC-SA 4.0
Comment