服务器问题手册备忘录
发表于 2022-04-22 | 更新于 2025-03-24
总字数: 897 | 阅读时长: 3分钟 | 阅读量: 0
记录一些学校服务器使用过程中遇到的一些问题
screen
与conda冲突
在开screen会话之前,不要先激活conda虚拟环境,不要在conda环境下开screen。否则可能会出现进入conda环境import某个包不成功,但是明明已经安装了那个包的情况。
断网后重连
可能会出现某个screen 显示attach无法进入
关闭所有screen
1
| screen -ls|awk 'NR>=2&&NR<=20{print $1}'|awk '{print "screen -S "$1" -X quit"}'|sh
|
Cuda
显存泄露
有时程序提前终止但是显存没有释放,可能还有隐藏进程
1
| ps -A -ostat,ppid,pid,cmd | grep -e '^[Zz]'
|
1 2 3 4 5
| fuser -v /dev/nvidia* |awk '{for(i=1;i<=NF;i++)print "kill -9 " $i;}' | sh
fuser -v /dev/nvidia2 |awk '{for(i=1;i<=NF;i++)print "kill -9 " $i;}' | sh
|
CPU
1 2 3 4 5 6 7 8 9 10 11
| cat /proc/cpuinfo | grep name | cut -f2 -d: | uniq -c
cat /proc/cpuinfo| grep "physical id"| sort| uniq| wc -l
cat /proc/cpuinfo| grep "cpu cores"| uniq
cat /proc/cpuinfo| grep "processor"| wc -l
|
文件
上传百度云
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
| pip install bypy
bypy info
bypy upload filename bypy syncdown filename
bypy downfile filename bypy syncdown filename bypy downdir path
|
打开百度网盘,会发现文件存在 我的网盘/我的应用数据/bypy 路径下
参考
Linux Ubuntu 18将本地文件上传到百度云盘
bypy-命令行下使用百度网盘
查看文件
1 2 3 4 5 6 7 8
| sed -n -3p filename sed -n -e 3p -e 5p filename sed -n 3,5p filename
head -n 5 filename tail -n 5 filename
wc -l filename
|
远程连接
sshd
安装ssh:
启动ssh:
登录远程服务器:
1 2 3
| ssh -p 50022 my@127.0.0.1 输入密码: my@127.0.0.1:
|
1 2 3 4 5 6 7
| sudo service ssh start/stop/restart systemctl start sshd systemctl stop sshd systemctl restart sshd systemctl reload sshd systemctl enable sshd systemctl disable sshd
|
Conda
管理python包
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
| conda install package_name
conda install numpy=1.10
conda remove package_name
conda update package_name
conda list
conda search search_term
conda install --channel https://conda.anaconda.org/pandas bottleneck
|
虚拟环境
1 2 3 4 5 6 7 8 9
| conda env list conda info -e
conda create -n your_env_name python=x.x
conda remove -n your_env_name --all
|