Server Configuration Tips 服务器配置
有了服务器之后免不了一些杂七杂八的东西需要配置,这篇博客集合相关的命令小帖子,方便查阅。
Essential Softwares
- Matlab
- 向日葵 Sunlogin,
- Zotero
- VS code
- Install Boost for C++ programmers,
sudo apt-get install libboost-all-dev
, link - pandoc(optional) is a powerful tool to transform documentation from one format to another, e.g. word, latex, markdown.
- mathpix
- GrindEQ save word document to latex format.
- Klatexformula transform latex formulas to image format.
Softwares Helpful For Windows Users
- openSSH server and client,安装之后重启,用有管理员权限的 Powershell 启动 sshd 并设置其开机自动启动。
# Start the sshd service
Start-Service sshd
# OPTIONAL but recommended:
Set-Service -Name sshd -StartupType 'Automatic'
# Confirm the firewall rule is configured. It should be created automatically by setup.
Get-NetFirewallRule -Name *ssh*
# There should be a firewall rule named "OpenSSH-Server-In-TCP", which should be enabled
# If the firewall does not exist, create one
New-NetFirewallRule -Name sshd -DisplayName 'OpenSSH Server (sshd)' -Enabled True -Direction Inbound -Protocol TCP -Action Allow -LocalPort 22
- 迅雷,link
- Wechat, link; QQ, link
- git / git bash for Windows, link, 装完 git 之后可以继续配置 ssh,可以参看
- Python Releases for Windows and virtual environment tool
- Office suite
Softwares Helpful For Ubuntu Users
For C/C++ Programmers
- CMake,
sudo snap install cmake
(take a ladder if the speed unsatisfactory) - gcc-10,
sudo add-apt-repository ppa:ubuntu-toolchain-r/test
sudo apt-get update
sudo apt install gcc-10 g++-10
- Clang,
sudo bash -c "$(wget -O - https://apt.llvm.org/llvm.sh)"
, updated Aug 13 2021 from https://apt.llvm.org/, clang used the header library of gcc on ubuntu, so install gcc latest version if you want latest features. - Configure CMake and choose a kit (clang suggested) for VS code, link
For Python programmers
- Python and its virtual environment tool
Mirror Source
python使用pip安装第三方库(工具包)速度慢、超时、失败的解决方案
# 以中科大的镜像源为例
$ pip install matplotlib -i https://pypi.mirrors.ustc.edu.cn/simple/
Network Protocol and Connection
ssh
-
服务器登录 ssh 配置: 免密登录与快速登录 阿里云开发者社区
注意在配置免密登录时,被 ssh 连接的服务器端中
~/.ssh/authorized_keys
这是个文件,不是文件夹。如果这台服务器之前没有被免密登录过,这个文件可能不存在,你需要自己创建它touch authorized_keys
。然后把你的客户端的公钥文件~/.ssh/***.pub
中的内容全部复制粘贴到authorized_keys
里面。
# 对我的 Ubuntu 20.04 经常这么操作
$ sudo systemctl start ssh
$ sudo systemctl status ssh # 检查是否开启成功
内网穿透 by nat123
$ cd /the-path-to-nat123/folder
$ mono nat123linux.sh # run nat123, and then input your account and password.
$ mono nat123linux.sh service & # run at background and auto-login the account last time loginned.
$ ps -ef|grep nat123 # check the nat123 status.
GPU
CUDA
- How to get the CUDA version?
$ nvcc --version # check the nvcc compiler version $ /usr/local/cuda/bin/nvcc --version # gives the CUDA compiler version
- How to check which CUDA version is installed on Linux
- Cupy Installation
$ python -m pip install -U setuptools pip $ pip install cupy-cuda111 # The cudaXXX-number must exactly match your CUDA version
Jupyter Notebook
Start Jupyter notebook on a remote server [1]
nohup jupyter notebook
where nohup let it run in daemon mode, keeps Jupyter safe from ssh disconnections.
lsof -ti:8888 | xargs kill
closes Jupyter by killing the process on the specified port.