ubuntu20.04 的WPS不太灵而且慢用这吧https://www.yozosoft.com
https://github.com/wszqkzqk/deepin-wine-ubuntu,这个挺好用。可以安装QQ、微信、百度云盘等
sudo apt-get install openssh-server
#说明和下载地址
http://service.oray.com/question/4287.html
http://b.oray.com
# 查看状态
phddns status
# 启动
phddns start
sudo apt-get install ubuntu-restricted-extras
java只需要解压到/usr/local/下即可,然后配置环境变量,见下册。
tar zxvf jdk-8u121-linux-x64.tar.gz
sudo mv jdk1.8.0_121 /usr/local
【慎重注意】一般最好不要用rc.local 或 fstab这种系统级的去添加开机操作了,很危险导致无法启动程序,这时候启动不了,就用救援模式去恢复去掉吧
vim /lib/systemd/system/rc-local.service
在rc-local.service下添加如下内容:
[Unit]
Description=/etc/rc.local Compatibility
Documentation=man:systemd-rc-local-generator(8)
ConditionFileIsExecutable=/etc/rc.local
After=network.target
[Service]
Type=forking
ExecStart=/etc/rc.local start
TimeoutSec=0
RemainAfterExit=yes
GuessMainPID=no
# 添加部分-------------------------------
[Install]
WantedBy=multi-user.target
Alias=rc-local.service
#-------------------------------------
#创建rc.local文件,并添加执行权限
sudo touch /etc/rc.local
sudo chmod +x /etc/rc.local
# 创建系统软链接
sudo ln -s /lib/systemd/system/rc-local.service /etc/systemd/system/
在/etc/rc.local中添加需要启动的脚本:
# /etc/rc.local中添加,记得首行必须添加#!bin/bash
#!bin/bash
chmod -R 755 /data1
sudo mount /dev/sdb2 /data1
测试以下开机启动脚本
sudo systemctl enable rc-local
sudo systemctl start rc-local.service
sudo systemctl status rc-local.service
在/etc/rc.local
下添加:
sh /etc/rc.d/start.sh
# 以kaldi用户名去运行/home/kaldi/start/start.sh
sh kaldi -l -c "sh /home/kaldi/start/start.sh"
使用**kaldi用户名
**创建/home/kaldi/start/start.sh
内容如下,并随后增加其执行权限:
#bin/bash
# TODO 设置程序遇到错误就立马退出
set -euov pipefail
#进入/data1下
cd /data1
jupyter lab &
exit 0
chmod -R 755 /etc/rc.d/start.sh
使用**root用户名
**创建/home/kaldi/start/start.sh
内容如下,并随后增加其执行权限:
#bin/bash
# TODO 设置程序遇到错误就立马退出
set -euov pipefail
mount -t ext4 /dev/sda6 /data1
exit 0
chmod -R 755 /home/kaldi/start/start.sh
# 在vim ~/.bashrc下添加
export JAVA_HOME=/usr/java/jdk1.8.0_121
export CLASSPATH=.$JAVA_HOME/lib:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar:$CLASSPATH
export PATH=$JAVA_HOME/bin:$JAVA_HOME/jre/bin:$PATH
export PATH="/usr/local/cuda/bin:$PATH"
export LD_LIBRARY_PATH=/usr/local/cuda/lib64:$LD_LIBRARY_PATH
export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/usr/local/cuda/lib64:/usr/local/cuda/extras/CUPTI/lib64"
export CUDA_HOME=/usr/local/cuda
export PATH="/home/anjos/python3/bin:$PATH"
export KEBA_HOME="/home/kaldi/python3/lib/python3.7/site-packages/keba"
export BAT_HOME="/home/kaldi/python3/lib/python3.7/site-packages/bat"
export TERM=xterm
# 配置快捷方式
alias ll='ls -la'
alias la='ls -lh'
alias l='ls -lh'
alias 7zz='7za a -t7z -r'
alias 7zu='7za X'
alias tailf='tail -f -n 10'
egdb () { emacs --eval "(gdb \"gdb --annotate=3 -i=mi $*\")";}
# 让环境变量生效
source ~/.bashrc
win7JDK环境变量配置系统变量如下:
(1) 新建->变量名:JAVA_HOME
变量值为JDK安装路径:
C:\Program Files\Java\jdk1.8.0_121
(2)编辑 ->变量名:Path
在变量值的最前面加上:
%JAVA_HOME%\bin;%JAVA_HOME%\jre\bin;
(3)新建 ->变量名:CLASSPATH
变量值:
.;%JAVA_HOME%\lib;%JAVA_HOME%\lib\dt.jar;%JAVA_HOME%\lib\tools.jar
一定记得gcc降级。
参考这个吧Ubuntu 20.04 CUDA&cuDNN安装方法
centos也一样的类似。
apt-get install gcc-7 g++-7
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-7 100
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-9 50
# 查看默认gcc版本
sudo update-alternatives --config gcc
yum clean all
yum remove "*cublas*" "cuda*"
yum remove "*nvidia*"
cuda下载地址
# 注意这是rpm模式
rpm -ivh cuda-repo-rhel7-10-2-local-10.2.89-440.33.01-1.0-1.x86_64.rpm
rpm -ivh nvidia-driver-local-repo-rhel7-418.87.01-1.0-1.x86_64.rpm.rpm
yum install -y nvidia-driver
yum install cuda -y
cudnn下载地址
tar xvzf cudnn-10.2-linux-x64-v7.6.5.32.tgz
sudo cp cuda/include/cudnn.h /usr/local/cuda-10.2/include/
sudo cp -r cuda/lib64/libcudnn* /usr/local/cuda-10.2/lib64/
安装python之前ubuntu和centos各自要安装一些基础库哦
:
# ubuntu
sudo apt-get install openssl libssl-dev zlibc zlib1g-dev libffi-dev libbz2-dev libsqlite3-dev libssl-dev libxslt1-dev libxml2-dev liblzma-dev libreadline-dev
# centos
yum install openssl openssl-devel zlib* libffi-devel libbz2-devel liblzma-devel readline-devel
【切记】不要将/bin/python3给删除,不然apt-get update会报错
Python-3.7.7.tgz源码下载地址
wget https://www.python.org/ftp/python/3.7.7/Python-3.7.7.tgz
tar zxvf Python-3.7.7.tgz
bash ./configure --with-ssl --prefix=/home/anjos/python3
make -j${nproc} & make install
make clean
rm -rvf ./Python-3.7.7
python-3.7.7-amd64源码下载地址
配置python系统环境变量:
新建: PYTHON_HOME值为: C:\python37
Path 前面加上 C:\python37;C:\python37\Scripts
【python各种库(whl格式)】下载地址:
http://www.lfd.uci.edu/~gohlke/pythonlibs
window numpy,需要单独安装mkl版本,numpy-1.18.2+mkl-cp37-cp37m-win_amd64.whl
https://pypi.python.org/pypi
【pip升级自己】pip install --upgrade pip
【查看已经安装过的库】pip list
linux下:
mkdir -p ~/.pip
vim ~/.pip/pip.conf
win下: C:\Users\Anjos\pip\pip.ini (记得创建这个文件哦)
在C盘
里面内容均为如下:
[global]
timeout = 6000
index-url = https://mirrors.aliyun.com/pypi/simple/
trusted-host = mirrors.aliyun.com
# 注意,window的numpy请自行去http://www.lfd.uci.edu/~gohlke/pythonlibs下载
# 注意,python3.8没有tensorflow1.15系列哦
pip3 install pandas xlrd xlwt openpyxl xlsxwriter scikit_learn scikit-image \
scipy matplotlib opencv_python protobuf tqdm asq regex h5py wheel \
pillow nose pyyaml jupyter jupyterlab pyhanlp \
jieba tensorflow-gpu==1.15.0 keras
【注意】如果网速比较快,直接from pyhanlp import *之后就会自动下载自动配置
去http://nlp.hankcs.com/download.php?file=data下载data-for-17.5.zip到如下目录:
linux下:~/python3/lib/python3.7/site-packages/pyhanlp/static
win下:C:\Python37\Lib\site-packages\pyhanlp\static
#用如下命令测试即可
from pyhanlp import *
sentence="我爱你"
terms = HanLP.segment(sentence)
for term in terms:
print(term.word,term.nature)
ipython notebook和jupyter lab安装好以后直接输入便可以在浏览器中使用,但是它默认只能在本地访问:
jupyter notebook
jupyter lab
如果想把它安装在服务器上,然后在本地远程访问,则需要进行如下配置:
jupyter notebook --generate-config
ipython#创建一个密文的密码【这里输入的密码是123456】
from notebook.auth import passwd
passwd()
Enter password: Verify password:
Out[2]: 'sha1:7de7ea9c4921:c5633014d406ce2f7cfa9a80b2be1c280fd9f42f'
#把生成的密文‘sha:ce…’复制下来
exit #退出
vim ~/.jupyter/jupyter_notebook_config.py#~表示用户sjkxb文件目录
#在该文件中添加如下内容
c.NotebookApp.ip='*'
c.NotebookApp.password=u'sha1:7de7ea9c4921:c5633014d406ce2f7cfa9a80b2be1c280fd9f42f'
c.NotebookApp.open_browser=False
c.NotebookApp.port=8888#随便指定一个端口
#遇到权限问题使用sudo
sudo jupyter notebook
#后台运行jupyter lab
nohup jupyter lab --allow-root >/dev/null 2>&1 &
#杀死进程
kill -9 进程号
docker详细文档可参考这个
具体参考:https://www.cnblogs.com/songxi/p/12788249.html,这里只记命令,centos请参考:https://docs.docker.com/engine/install/
sudo apt-get remove docker docker-engine docker.io containerd runc
sudo apt-get update
sudo apt-get install \
apt-transport-https \
ca-certificates \
curl \
gnupg-agent \
software-properties-common
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo add-apt-repository \
"deb [arch=amd64] https://download.docker.com/linux/ubuntu \
bionic \
stable"
sudo apt-get install docker-ce docker-ce-cli containerd.io
【切记】一定要先安装nvidia驱动哦,cuda无所谓,不需要安装
安装请参考https://github.com/NVIDIA/nvidia-docker/wiki/Installation-(Native-GPU-Support)
Install the repository for your distribution by following the instructions here.
Install the nvidia-container-toolkit package:
# ubuntu
curl -s -L https://nvidia.github.io/nvidia-docker/gpgkey | \
sudo apt-key add -
distribution=$(. /etc/os-release;echo $ID$VERSION_ID)
curl -s -L https://nvidia.github.io/nvidia-docker/$distribution/nvidia-docker.list | \
sudo tee /etc/apt/sources.list.d/nvidia-docker.list
sudo apt-get update
sudo apt-get install -y nvidia-container-toolkit
# centos
distribution=$(. /etc/os-release;echo $ID$VERSION_ID)
curl -s -L https://nvidia.github.io/nvidia-docker/$distribution/nvidia-docker.repo | \
sudo tee /etc/yum.repos.d/nvidia-docker.repo
sudo yum install -y nvidia-container-toolkit
docker hub在国外下载速度慢的(家里如果不是光线)就可以配置阿里源。
【切记】安装好docker和nvidia-docker后要重启哦,不然启动的容器会报无法找到special GPU
Docker Hub
nvidia/cuda:10.2-cudnn7-devel-centos7 镜像地址
# 创建一个镜像
sudo docker run --gpus all --name anjos -d -it -p 5000:22 \
-v /data1:/data1 -v /data:/data \
nvidia/cuda:10.2-cudnn7-devel-centos7 /bin/bash
# 启动
sudo docker start anjos
# 进入(用id也可以)
sudo docker exec -it anjos bash
# 删除镜像
sudo docker rmi imageid
# 删除容器
sudo docker rm containerid
# 查看所有容器
sudo docker ps -a
# 查看所有已经成功启动的容器
sudo docker ps