conda下载安装
conda下载:Anaconda3-2022.10-Linux-x86_64.sh下载—python3.9
conda安装:
echo 'export PATH="~/anaconda3/bin:$PATH"' >> ~/.bashrc
source ~/.bashrc
bash Anaconda3-2022.10-Linux-x86_64.sh
conda环境激活:conda activate [your_env]
conda环境退出:conda deactivate [your_env]
conda创建新python环境:conda create --name [yourenvname] python=3.9
pip 换国内源
清华源
pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple
阿里源
pip config set global.index-url https://mirrors.aliyun.com/pypi/simple/
腾讯源
pip config set global.index-url http://mirrors.cloud.tencent.com/pypi/simple
#豆瓣源
pip config set global.index-url http://pypi.douban.com/simple/
换回默认源
pip config unset global.index-url
Sphinx下载安装
git clone https://github.com/sphinx-doc/sphinx.git
pip install .
git clone https://gitee.com/korbenyuan/quickly-enter-working-mode
ssh配置
1.启用ssh
以 root 或者其他 sudo 用户身份执行下面的步骤,在你的 Ubuntu 系统上安装并且启用 SSH。
sudo apt update
sudo apt install net-tools
sudo apt install openssh-server
根据提示输入你的密码并且按 Enter,继续安装。
![](https://i-blog.csdnimg.cn/blog_migrate/47a6ad21ba8c5beadbfbeec63df049b7.png)
安装完成后,SSH 服务将会被自动启动。你可以验证 SSH 是否正在运行,输入:
sudo systemctl status ssh
按q返回命令行。
Ubuntu 自带一个配置防火墙配置工具,称为 UFW。如果防火墙在你的系统上被启用,请确保打开了 SSH 端口:
sudo ufw allow ssh
1.连接到ssh服务器
如果你不知道你的 IP 地址,你可以使用ip命令查看:
ifconfig
![](https://i-blog.csdnimg.cn/blog_migrate/9f707a5242d21eb8658ddddf70fdae9c.png)
ssh linuxize@10.0.2.15
如果你将你的机器暴露在互联网中,你最好采取一些安全措施。最基础的一个措施就是配置你的路由器接受一个非标准端口的 SSH 流量,并且转发到你运行 SSH 服务的机器的端口22。
你也可以设置 SSH 密钥公钥验证方式,之后你就可以不使用密码就可以连接到你的 Ubuntu 机器上了。
链接gitlab(gitlab登录网址)
SSH连接gitlab省去了每次push工程时输入账号密码的流程,具体操作过程可概括为以下几步——1.生成本地主机的SSH密钥;2.在gitlab远程服务器上添加SSH公钥;3.测试连接是否成功。
1.下载安装gitlab。
wget --content-disposition https://packages.gitlab.com/gitlab/gitlab-ce/packages/ubuntu/focal/gitlab-ce_15.5.2-ce.0_amd64.deb/download.deb
gitlab-ce_15.5.2-ce.0_amd64.deb
2.生成本地主机的SSH秘钥。
$ git config --global user.name "user.name" # 设定用户名
$ git config --global user.email "user.email" # 设定邮箱
3.生成本地主机的SSH秘钥(为简单起见,输入命令后直接三个回车,不设定密码)。
ssh-keygen -t rsa -C “user.email” # 生成秘钥
执行命令后在用户目录下会生成一个.ssh的目录,其中有公钥和私钥。
4.在gitlab远程服务器上添加SSH公钥。
输入以下命令打开公钥,将内容复制进远程服务器保存公钥的地方,保存之。
![](https://i-blog.csdnimg.cn/blog_migrate/7e85388822a4648db97b09f2725b8e21.png)
5.测试连接是否成功。
ssh git@gitlab.com
链接gitee(gitee登录网址)
如下配置,即可让本电脑直接推送gitee,而无需输入码云的密码
1.下载git
2.配置用户名:git config --global user.name “zhangsan”
//以后的提交人就是这个名字
3.配置邮箱:git config --global user.email “zhangsan@qq.com”
//注册账号时的邮箱
4.创建SSH公钥:ssh-keygen -t rsa -C “123456@qq.com”
5.查看公钥内容:cat ~/.ssh/id_rsa.pub
6.打开码云,设置-ssh公钥,直接把公钥内容输入进去,标题随便写
7.运行:ssh -T git@gitee.com 让本电脑与gitee建立连接,以后无需密码登录