环境配置

代理设置

windows

1
2
set http_proxy=http://192.168.1.140:1080
set http_proxys=http://192.168.1.140:1080

ubuntu

1
2
set http_proxy=socks5://192.168.1.140:1080
set https_proxy=socks5://192.168.1.140:1080

Ubuntu anaconda环境变量设置

1
2
3
4
5
sudo gedit ~/.bashrc

export PATH="~/anaconda3/bin":$PATH

source ~/.bashrc

Ubuntu cuda环境变量设置

1
2
3
4
5
6
7
8
9
sudo nano ~/.bashrc

export PATH=/usr/local/cuda/bin:$PATH

export LD_LIBRARY_PATH=/usr/local/cuda/lib64:$LD_LIBRARY_PATH

source ~/.bashrc

nvcc --version

conda清华换源

1
2
3
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/
conda config --set show_channel_urls yes

Ubuntu22.04 开启3389端口远程连接

1
2
firewall-cmd --add-port=3389/tcp --permanent
firewall-cmd --reload

vscode python调试的launch.json配置文件

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
{
"version": "0.2.0",
"configurations": [
{
"name": "Python: Run Image Detection Demo",
"type": "debugpy",
"request": "launch",
"program": "${workspaceFolder}/demo/image_demo.py",
"console": "integratedTerminal",
"args": [

"demo/demo.jpg",
"configs/mask_rcnn/mask-rcnn_r101_fpn_1x_coco.py",
"--weights",
"mymodel/mask_rcnn_r101_fpn_1x_coco_20200204-1efe0ed5.pth",
"--texts",
"bench",
"--device",
"cuda:0"
],
"env": {
// 如果有需要,可以在这里添加额外的环境变量
}
}
]
}

linux配置免密登录

本机运行

1
ssh-keygen -t rsa

将本机.SSH文件夹下的id_rsa.pub追加到远程主机.ssh文件夹下的authorized_keys文件中

1
cat id_rsa.pub >> authorized_keys

screen命令

1
2
3
4
5
6
7
8
9
10
11
12
13
14
# 新建窗口
screen -S name

# 挂起 [detached]
ctrl + a + d

# 列出窗口列表
screen -ls

# 杀死多余窗口
kill -9 threadnum

# 清除死去的窗口
screen -wipe

nignx正向代理配置

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#正向代理转发http请求 
server {
#指定DNS服务器IP地址
# resolver 114.114.114.114;
#监听80端口,http默认端口80
listen 80;
#服务器IP或域名
server_name xxx.xxxxx.top;

#正向代理转发http请求
location / {
proxy_pass http://xxxxx.top:20003;
proxy_set_header HOST $host;
proxy_buffers 256 4k;
proxy_max_temp_file_size 0k;
proxy_connect_timeout 30;
proxy_send_timeout 60;
proxy_read_timeout 60;
proxy_next_upstream error timeout invalid_header http_502;
}
}

windows指令

Windows转发wsl

1
2
3
netsh interface portproxy add v4tov4 listenaddress=0.0.0.0 listenport=7777 connectaddress=localhost connectport=8888
netsh interface portproxy show all
netsh interface portproxy delete v4tov4 listenport=7777 listenaddress=0.0.0.0 protocol=tcp

代理设置

1
2
set http_proxy=sock5://192.168.31.100:1080
set https_proxy=sock5://192.168.31.100:1080