Hunter的大杂烩 技术学习笔记

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…)

2025-01-13

sed 几个技巧

Filed under: 技术话题 — hunter @ 12:01 am
  1. 扩展模式:使用 -E 参数可以开启扩展模式,开启后,则可以不用添加 “\”来引用特殊字符,如() + 等。开启前后对比

开启前:sed ‘s/(season[0-9])(.+)\/(Scene[0-9])-.*([0-9])[.]mp3/\1-\3-\4.mp3/g’

开启后:sed -E ‘s/([[:digit:]]+)/0&/g;s/Season 0[/]Scene ([0-9]{2}).mp03/\1-\2.mp3/g’`

Older Posts »

Powered by WordPress