作者文章归档:陈海峰

[ git嵌套仓库 ]


git删除嵌套仓库

1. 进入包含子模块的父仓库的根目录。
2. 使用命令 `git submodule deinit 子模块路径`,将子模块从父仓库的配置中删除。
3. 使用命令 `git rm 子模块路径`,删除子模块目录。
4. 提交修改,使用命令 `git commit -m “取消子模块”`。

< Read more >

[ git登陆保持 ]


git登陆保持

git credential-cache exit # 清除缓存
git config --global --unset credential.helper  # 删除
git config --global credential.helper store # 保持到文件

配置用户名邮箱

git config --global user.name "新的用户名"
git config --global user.email "新的邮箱"

git 输入密码后保存密码的文件

rm ~/.git-credentials

< Read more >

[ datetime.strptime解析异常 ]


第一次执行没事

第二次执行报错

ValueError: time data '3,2021 4:23:55 AM' does not match format '%m,%Y %I:%M:%S %p'

原因是一开始的时候, locale默认的语言是none, 一开始执行datetime.strptime缓存的语言是none, %p转化成的正则表达式是"AM/PM" 第一次执行cv2.imshow会强制设置locale的语言为当前计算机默认语言,我这里就是中文, 循环第二次执行到datetime.strptime检测到locale发生变化,会重新缓存语言是中文,解析%p的正则表达式就变成了"上午/

< Read more >

[ vm虚拟机安装黑苹果 ]


参考文章1

参考文章2

右键mac的虚拟机->选择打开虚拟机目录-> 修改xxxx.vmx文件

修改内容

"e1000e"  将字符串中的值改成 "vmxnet3"

最后添加内容

board-id = "Mac-551B86E5744E2388"
hw.model.reflectHost = "FALSE"
hw.model = "MacBookPro14,3" 
smc.version ="0"

inter处理器:

smc.version = &quo

< Read more >

[ linux安装qq音乐闪退问题 ]


sudo vim /usr/share/applications/qqmusic.desktop

[Desktop Entry]

Name=QQMusic

Exec=/opt/qqmusic/qqmusic %U --no-sandbox

Terminal=false

Type=Application

Icon=qqmusic

StartupWMClass=qqmusic

Comment=Tencent QQMusic

Categories=AudioVideo;Audio;Player;

MimeType=application/x-ogg;application/ogg;

< Read more >

[ python同步变异步 ]


python中把不修改原来同步的代码,变成异步.

import asyncio
import time
from functools import wraps
from concurrent.futures import ThreadPoolExecutor
from typing import List, Callable, Any

# 创建数据库连接池
pool_executor = ThreadPoolExecutor(max_workers=10)

def to_async(func):
    @wraps(func)
    async def wrapper(*args, *

< Read more >

[ vscode远程开发ssh ]


vscode Remote - SSH远程开发配置

安装插件后,用这个json配置比较方便

# Read more about SSH config files: https://linux.die.net/man/5/ssh_config
Host Local_Django_Blog_Gin
    HostName 192.168.50.13
    User chf
    PasswordAuthentication yes

配置免密码登录

1. 在win中生成密钥(可能生成了后, 要放在对应位置)

ssh-keygen -t rsa

2. 复制id_rsa.pub的内容

< Read more >

[ neovim使用 ]


linux版本下载(https://github.com/neovim/neovim-releases/releases)

1. 安装插件管理

https://www.lazyvim.org/installation

git clone https://github.com/LazyVim/starter ~/.config/nvim

linux系统记得安装gcc依赖

sudo apt-get install build-essential

2. 安装字体

https://www.nerdfonts.com/font-downloads

随便下载一个字体,解压后双击点击安装,然后在

< Read more >