Hunter的大杂烩 技术学习笔记

2026-02-24

windows python下安装支持GPU opencv

Filed under: 技术话题 — hunter @ 9:06 pm

为了用EAST大模型测试图片中字体方向,需要使用torch和opencv,在使用中发现速度太慢,研究了一下如何使用GPU加速(N卡):

  1. 下载安装  NVIDIA CUDA下载页面
  2. 卸载原有的opencv:pip uninstall opencv-python opencv-contrib-python -y
  3. 从github上下载支持CUDA的 opencv-python: https://github.com/cudawarped/opencv-python-cuda-wheels/releases,并安装
  4. 从NVIDIA官网下载cuDNN
  5. 测试
(more…)

2026-02-02

WAMP环境配置

Filed under: 技术话题 — hunter @ 1:27 am
  1. https://www.apachelounge.com/download/、php.net、https://xdebug.org/download上下载相关版本的二进制文件:

a. php要下载Thread Safe版本,否则没有带apache module dll ,目前最新的是 php-8.5.2-Win32-vs17-x64.zip (最好选64bit ,因为xdebug已经没有32bit提供了)

需要留意xdebug和apache要根据php的版本、编译器、php版本、x86/x64选择对应的文件下载:

b. apachelouge上已没有VS17编译的版本了,我是在CSDN上找到一个VS17的版本:(https://download.csdn.net/download/qq_18931093/88633123

c. xdebug 我选的是php_xdebug-3.5.0-8.5-ts-vs17-x86_64.dll (ThreadSafe版本vs17编译的64bit for php8.5)

..

(more…)

2025-06-01

windows下查找两个文件相同字符串的powershell脚本

Filed under: 技术话题 — hunter @ 12:32 am

# 查看当前区域设置
Get-Culture

# 设置区域设置为中文(简体)
$PSDefaultParameterValues[‘*:Encoding’] = ‘utf8’
[System.Globalization.CultureInfo]::DefaultThreadCurrentCulture = [System.Globalization.CultureInfo]::GetCultureInfo(“zh-CN”)
[System.Globalization.CultureInfo]::DefaultThreadCurrentUICulture = [System.Globalization.CultureInfo]::GetCultureInfo(“zh-CN”)

Get-Content 1.txt | ForEach-Object {
$pattern = [regex]::Escape($_.Trim())
if (Select-String -Path 2.txt -Pattern “$pattern”) { $_ }
} | Sort-Object -Unique | Set-Content common_files.txt



2025-04-29

linux下命令行通过管道连接while循环处理

Filed under: 技术话题 — hunter @ 10:23 pm

比如用awk 处理netstat 返回的IP地址,为了去掉地址中的端口号,可以用如下命令:

netstat -anpt |grep EST|awk ‘{print $5}’ |while read addr; do echo $addr|awk -F’:’ ‘{print $1}’; done

先打印 “IP:端口”,然后管道重定向给while,循环读取行数据,再一行行输出给awk进行二次处理

2025-04-27

免费Ghost替代:Clonezilla 再生龍

Filed under: 技术话题 — hunter @ 1:31 pm

网址:https://clonezilla.nchc.org.tw/clonezilla-live/liveusb.php

搭配同机构开发的启动盘制作工具tuxboot(https://tuxboot.nchc.org.tw/),可以完美替代Ghost

(more…)
Older Posts »

Powered by WordPress