Wenyin 的拾萃园
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

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

# 对我的 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

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.