Ubuntu
- 本地开发使用最好安装 ubuntu desktop 版本
- 安装好后,先切换 apt source 为 阿里云mirror: http://mirrors.aliyun.com/ubuntu
- ubuntu 网络工具是
ip
, 远程登录需要开启ssh server,然后通过ip address
中的ip地址进行登录
VPC 远程登录
- 服务器开启 VNC server
sudo apt install tigervnc-standalone-server // server 端安装配置
vncpasswd // 设置密码
vncserver -localhost no // 开启 vnc 服务
vncserver -list // 查看启动结果
vncserver -kill :1 // 关闭 VNC 显示器
-
客户端配置
客户端可以选择 TigerNVC 客户端,也可以使用 realvnc 的客户端- realvnc 的客户端下载地址: https://www.realvnc.com/en/connect/download/viewer/linux/ ,然后连接 ip:5901
- 在 https://github.com/TigerVNC/tigervnc/releases 下载 tigervnc 的客户端,然后连接 ip:5901
-
参考:https://www.linuxrumen.com/rmxx/1871.html
卸载 Snap 商店
Snap 商店目前非必需产品,先卸载,后续有需求再安装
- 参考:https://zhuanlan.zhihu.com/p/511438456
- 当出现无法卸载 snap 中的core 时,参考 https://blog.csdn.net/a12355556/article/details/124323495
- 下载PPA 软件仓库可能会很慢,感谢中科大代理PPA地址: launchpad.proxy.ustclug.org , https://www.jianshu.com/p/3a030350d2cd
安装中文输入法
- 最新版本已经安装了 ibus, 然后安装输入法
sudo apt install ibus-libpinyin
,再启用就好了, https://blog.csdn.net/sofa_r/article/details/126118363 - 通过Keyboard - InputSource 来安装 Chinese(Intelligent Pinyin)输入法
- 通过 Shift 切换中英文
在MAC 连接Ubuntu 机器的时候,需要在 Iterm2 中取消自动设置 locale 的配置:
Terminal -> Preferences -> Profiles -> Default>Terminal>Environment>Set locale
安装docker
- 安装Docker:
sudo apt install docker.io
- 安装 docker-compose:
sudo apt install docker-compose
- Docker pull限速
- Docker Hub 现在限制了pull 速度,https://docs.docker.com/docker-hub/download-rate-limit/?spm=a2c4g.11186623.0.0.19e6296aBu1Vud
- 使用加速器有时候也会失败:https://help.aliyun.com/document_detail/60750.html
- 根据官方说明,下次可以试一下
docker login
之后的效果 - 打印 Docker debug 日志。 在
/etc/docker/daemon.json
增加"debug": true
参数,然后重启dockersudo systemctl restart docker
,再查看 docker 日志:journalctl -u docker.service | vim -
安装 aria2 + ariang
version: "3"
services:
ariang:
image: hurlenko/aria2-ariang
container_name: aria2-ariang
ports:
- 8081:8080
volumes:
- /home/kunwan/Downloads/aria2_data:/aria2/data
# - /etc/aria2:/aria2/conf
environment:
- PUID=1000
- PGID=1000
- RPC_SECRET=xxx
- BASIC_AUTH_USERNAME=kunwan
- BASIC_AUTH_PASSWORD=xxx
- ARIA2RPCPORT=443
restart: always
页面访问时,如果出现 authorization failed 问题,需要到 AriaNg -> RPC -> Aria2 RPC Secret Token
中重新设置一下RPC_SECRET
安装vscode
sudo dpkg -i code_1.62.0-1635954068_amd64.deb
NFS服务
安装配置 NFS
sudo apt install nfs-kernel-server
sudo vim /etc/exports
/Downloads/aria2_data 192.168.0.0/16(rw,sync,no_root_squash,insecure,no_subtree_check)
/Downloads/qbittorrent_data 192.168.0.0/16(rw,sync,no_root_squash,insecure,no_subtree_check)
配置选项说明
- rw: This option gives the client computer both read and write access to the volume.
- sync: This option forces NFS to write changes to disk before replying. This results in a more stable and consistent environment since the reply reflects the actual state of the remote volume. However, it also reduces the speed of file operations.
- no_subtree_check: This option prevents subtree checking, which is a process where the host must check whether the file is actually still available in the exported tree for every request. This can cause many problems when a file is renamed while the client has it opened. In almost all cases, it is better to disable subtree checking.
- no_root_squash: By default, NFS translates requests from a root user remotely into a non-privileged user on the server. This was intended as security feature to prevent a root account on the client from using the file system of the host as root. no_root_squash disables this behavior for certain shares.
Mac 连接
Finder -> Go -> Connect Server -> nfs://IP/Downloads/aria2_data
TFTP 服务
安装和配置 TFTP 共享目录以及权限
sudo apt-get install tftpd-hpa
chmod 777 tftp_data
sudo vim /etc/default/tftpd-hpa
TFTP_USERNAME="tftp"
TFTP_DIRECTORY="tftp_data"
TFTP_ADDRESS=":69"
TFTP_OPTIONS="-l -c -s" # 原本的--secure,替换成上面的-l -c -s,这里是选项,-c是可以上传文件的参数,-s是指定tftpd-hpa服务目录
然后重启 sudo systemctl restart tftpd-hpa
服务
客户端使用tftp
[1] tftp ${FTP_SERVER}
tftp> put b.txt
tftp> get a.txt
filebrowser 安装
mkdir -p /data/filebrowser
touch /data/filebrowser/filebrowser.db
注意
- db 文件需要提前创建一个空文件
- setting 文件不需要创建,直接使用默认的就可以
- container启动后,使用 admin / admin 登录,然后修改密码
Docker 方式启动
sudo docker run \
-v /home/kunwan/Download:/srv \
-v /data/filebrowser/filebrowser.db:/database/filebrowser.db \
-e PUID=$(id -u) \
-e PGID=$(id -g) \
-p 8080:80 \
--restart=always \
filebrowser/filebrowser:s6
Docker- Compose 方式启动
sudo UID="$(id -u)" GID="$(id -g)" docker-compose up -d
version: "2.0"
services:
filebrowser:
image: filebrowser/filebrowser:s6
container_name: filebrowser
restart: always
volumes:
- /home/kunwan/Downloads:/srv
- type: bind
source: /data/filebrowser/filebrowser.db
target: /database/filebrowser.db
ports:
- 8083:80
environment:
- PUID=$UID
- PGID=$GID
安装 Minidlna
sudo apt install minidlna
sudo vi /etc/minidlna.conf
# If you want to restrict a media_dir to a specific content type, you can
# prepend the directory name with a letter representing the type (A, P or V),
# followed by a comma, as so:
# * "A" for audio (eg. media_dir=A,/var/lib/minidlna/music)
# * "P" for pictures (eg. media_dir=P,/var/lib/minidlna/pictures)
# * "V" for video (eg. media_dir=V,/var/lib/minidlna/videos)
# * "PV" for pictures and video (eg. media_dir=PV,/var/lib/minidlna/digital_camera)
media_dir=/home/kunwan/Downloads
friendly_name=UbuntuDLNA
sudo service minidlna restart
sudo service minidlna force-reload
FC 游戏模拟器
sudo apt-get install fceux