0%

mongodb 启动闪退

将mongodb.lock,log,db三个文件修改权限
chown -R mongodb:mongodb /var/log/mongodb/mongod.log
chown -R mongodb:mongodb /var/lib/mongodb/
rm -f /tmp/mongodb.lock

firefox 安装

1
2
3
4
5
6
7
8
9
sudo install -d -m 0755 /etc/apt/keyrings
wget -q https://packages.mozilla.org/apt/repo-signing-key.gpg -O- | sudo tee /etc/apt/keyrings/packages.mozilla.org.asc > /dev/null
echo "deb [signed-by=/etc/apt/keyrings/packages.mozilla.org.asc] https://packages.mozilla.org/apt mozilla main" | sudo tee -a /etc/apt/sources.list.d/mozilla.list > /dev/null
echo '
Package: *
Pin: origin packages.mozilla.org
Pin-Priority: 1000
' | sudo tee /etc/apt/preferences.d/mozilla
pt-get update && sudo apt-get install firefox

参考链接

不用vnc的chrome

ssh工具: mobaxterm
安装xserver组件

1
2
3
apt install xserver-xorg xserver-xorg-core xserver-xorg-legacy xorg xauth openbox
apt install chromium
chromium --no-sandbox

等待个5秒左右,本地电脑上会弹出一个chromium浏览器的窗口

conda安装配置

官网下载合适版本
‘’’
https://repo.anaconda.com/archive/
‘’’
配置环境变量后,conda init
每次打开终端不默认激活conda: conda config --set auto_activate_base False
conda list 查看base环境中的所有包
pip升级最新版本:
python -m pip install –upgrade pip
换源:
pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple

conda相关命令

创建新环境命名python311

1
conda create -n python311 python=3.11

配置jupyter notebook 远程访问

生成配置文件:

1
jupyter notebook --generate-config 

一般保存在~/.jupyter/jupyter_notebook_config.py
可用 jupyter notebook password 设置密码
设置notebook自动补全

1
2
3
4
5
6
pip3 install jupyter-tabnine
conda install -c conda-forge jupyter_contrib_nbextensions
jupyter contrib nbextension install --user
jupyter nbextension install --py jupyter_tabnine
jupyter nbextension enable jupyter_tabnine --py
jupyter serverextension enable --py jupyter_tabnine

运行图片相关代码报错:tesseract not found

1
apt install tesseract-ocr

添加转发

netsh interface portproxy add v4tov4 listenport=新开的监听端口 listenaddress=新开端口的绑定地址 connectaddress=要转发的地址 connectport=要转发的端口 protocol=tcp
‘’’
netsh interface portproxy add v4tov4 listenport=12345 listenaddress=0.0.0.0 connectaddress=127.0.0.1 connectport=8118 protocol=tcp
‘’’

删除转发

netsh interface portproxy delete v4tov4 listenport=新开的监听端口 listenaddress=新开端口的绑定地址

创建系统服务

定位到/usr/lib/systemd/system目录,新建’服务名称.service文件’

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
[Unit]
#定义描述
Description=The ss-local service
#指定了在systemd在执行完那些target之后再启动该服务
#After=network.target remote-fs.target nss-lookup.target

[Service]
#定义Service 的运行type,一般是forking,就是后台运行
Type=forking
#以下定义systemctl start |stop |reload *.service 的每个执行方法,具体命令#需要>写绝对路径
ExecStart=/path/to/execfile
ExecReload=/opt/openresty/bin/openresty -p
ExecStop=/opt/openresty/bin/openresty -p

KillMode=control-group
Restart=on-failure
#创建私有的内存临时空间
PrivateTmp=true

[Install]
WantedBy=multi-user.target

NERDTree 配置

使用F2快速展开或隐藏它打开vim时自动展开NERDTree

阅读全文 »

申请证书

1
certbot certonly --standalone -d abc.com

续签,需要暂停web服务器,让出80端口

1
certbot renew --cert-name abc.com