一个专注于计算机编程和硬件学习的博客主
解决拷贝环境后jupyter lab无法使用因为出现了在将一台ubutnu中的anaconda3虚拟环境直接拷贝到另一台电脑后,jupyter lab无法使用的问题,通过排查发现是环境中一些包文件的头步有绝对路径中间包含了用户名,换到另一台电脑后用户名变了而无法启动可以使用批量替换文件内容来解决这个问题替换文件夹内所有文件匹配的字符串 sed -i "s/旧内容/新内容/g" `grep 旧内容 -rl 文件夹路径`例如将/var/www/test文件夹下的所有文件内容中的abc字符串换成123sed -i "s/abc/123/g" `grep abc -rl /var/www/test`注:grep内容用的不是单引号',而是`,tab键上面的,请使用绝对路径替换文件内所有匹配的字符串sed -i "s/旧内容/新内容/g" 文件路径例如将/var/www/test/index.html文件夹下的所有文件内容中的abc字符串换成123sed -i "s/abc/123/g" /var/www/test/i
VSCode运行C++代码下载C++扩展滚到描述下面,点击 GCC and Mingw-w64 on Windows点击 MSYS2下载msys2-x86_64-20240113.exe下载完成后,双击打开进行安装。跟随网页MSYS2上的步骤一步一步做。(建议安装路径不要更改选择默认路径)安装完打开 MSYS2 MINGW64。首先更新系统环境:pacman -Syu更新好后回推出安装mingw gccpacman -S mingw-w64-ucrt-x86_64-gcc写入Y,按下Enter安装完成后,输入:gcc --version获得以下结果继续输入:pacman -S --needed base-devel mingw-w64-x86_64-toolchain出现Enter a selection (default=all):按下Enter继续出现:: Proceed with installation? [Y/n]写入Y,按下Enter安装完成后,关闭MSYS2 MINGW64添加环境变量在path中添加C:\msys64\mingw64\bin打开cmd,依次输入:gc
Typecho博客迁移在前面已经讲了用Docker搭建typecho,现在需要将以前的博客进行迁移过来。备份原来博客的数据集将原来博客的数据库导出保存为sql格式mysql -u root -p database > mysql.sql输入密码进行导出将原博客的usr目录拷贝到本地在原博客全局->备份进行原博客备份迁移博客将usr上传到新建的博客目录中,替换新的usr导入数据库,尽量两个数据库名称相同需要先进入Docker 容器中# 查看docker容器的CONTAINER ID docker ps#进入到docker容器 docker exec -it CONTAINERID bashCONTAINER ID为需要进入容器的CONTAINER IDmysql -u root - p输入密码进入use database #你的数据库名 - 这里我是直接删除了原来新建的数据库,因为新建的数据库中存在数据表,我直接删除后新建了一个和原来名字一样的数据库,然后再导入sql数据 - 这里博客可能会报数据库的错误 - 删除博客根目录的`config.inc.php`,从新配置
Docker自建Rustdesk服务器配置docker-compose.yaml新建一个rustdesk目录version: '3' networks: rustdesk-net: external: false services: hbbs: container_name: hbbs ports: - 21115:21115 - 21116:21116 - 21116:21116/udp - 21118:21118 image: rustdesk/rustdesk-server:latest command: hbbs -r 此处填写你的公网IP:21117 -k _ volumes: - ./data:/root networks: - rustdesk-net depends_on: - hbbr restart: unless-stopped hbbr: container_na
使用Nginx Proxy Manage进行Docker容器中的反向代理前面讲了搭建Typecho博客,但是没有监听443端口,这里来进行反向代理。1. 需要用到的镜像nginx-proxy-manager2. 配置先在dockerdata下创建一个npm目录配置 docker-compose.ymlversion: '3.8' services: app: #image: 'jc21/nginx-proxy-manager:latest' # 官方原版 image: 'chishin/nginx-proxy-manager-zh:2.9.18' # 中文版 restart: unless-stopped ports: # These ports are in format <host-port>:<container-port> - '80:80' # Public HTTP Port - '443:
Ubuntu22.04使用Docker搭建typecho博客1. 安装Docker详见:2. 需要用到的镜像nginxphp:8.2-fpmmysql:5.73. 配置新建 blog 文件夹,其目录结构如下:. ├── docker-compose.yml ├── logs ├── mysql ├── mysql.env ├── nginx │ └── default.conf ├── php │ └── Dockerfile └── typecho3.1 配置 docker-compose.ymlversion: "3.8" services: nginx: image: nginx:latest ports: - "8080:80" restart: always environment: - TZ=Asia/Shanghai volumes: - ./typecho:/var/www/html - .
一只胖橘