Ubuntu服务器常用命令操作等————持续更新

 一:深度学习相关:

1.1 安装好cuda测试其是否可用

python
import torch
print(torch.cuda.is_available())

二:服务器联网相关

 2.1 测试是否代理能够正常联网

curl -x http://your_proxy_server:port https://www.baidu.com

wget -e "http_proxy=http://your_proxy_server:port" https://www.baidu.com

2.2 服务器通过代理服务器上网

下载cxxx用于服务器的代理,然后配置如下图,详细可参考:
远程服务器设置代理共享本地网络-解决内网环境无法git、pip等_7890端口-优快云博客

查看代理:env|grep -i proxy
取消代理:unset https_proxy
设置代理:export http_proxy=""

export http_proxy="http://192.168.136.94:7890/"
export https_proxy="https://192.168.136.94:7890/"
export ftp_proxy="ftp://192.168.136.94:7890/"
export all_proxy="http://192.168.136.94:7890/"
export socks_proxy="socks://192.168.136.94:7890/"

# 文件/etc/profile,使得代理永久生效。

#绕过临时代理
pip install pygame --proxy=""

全局代理

查看代理:env|grep -i proxy
取消代理:unset https_proxy
设置代理:export http_proxy=""

export http_proxy="http://222.20.75.93:7890/"
export https_proxy="https://222.20.75.93:7890/"
export ftp_proxy="ftp://222.20.75.93:7890/"
export all_proxy="http://222.20.75.93:7890/"
export socks_proxy="socks://222.20.75.93:7890/"

pip临时使用代理

pip install robotframework --proxy=222.20.75.93:7890

git代理

# 设置代理
git config --global http.proxy http://222.20.75.93:7890
git config --global https.proxy https://222.20.75.93:7890
# 重置取消代理
git config --global --unset http.proxy
git config --global --unset https.proxy

conda代理

# 查看是否配置conda代理

conda config --show | grep proxy
#配置conda代理

conda config --set proxy_servers.http http://222.20.75.93:7890
conda config --set proxy_servers.https http://222.20.75.93:7890

#conda镜像源

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

三:服务器添加用户相关 

$sudo passwd userName    //设置密码
$userdel -r userName    //删除用户
$useradd userName    //创建用户

$userdel -r user          //删除用户的同时删除用户的所有文件和目录

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

张飞飞飞飞飞

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值