作者: hetao

  • 华为交换机配置SSH ECC公钥登录并解决无法进入系统视图问题

    • 客户端生成ECC密钥对

    ssh-keygen -t ecdsa -C backup-server

    • 交换机上导入ECC密钥
    ecc peer-public-key backup-server encodint-type openssh
    public-key-code begin
    ecdsa-sha2-nistp256 AAAAE2vj............................. backup-server
    public-key-code end
    peer-public-key end
    
    • 交换机创建用户
    aaa
    local-user backup privilege level 15
    local-user backup service-type ssh
    quit
    
    • 为新创建的用户配置登录方式
    ssh user backup assign ecc-key backup-server
    ssh user backup service-type all
    ssh user backup authentication-type ecc
    
    • 解决登录后无法进入系统视图的问题
    user-interface vty 0 4
    authentication-mode aaa
    protocol inbound ssh
    user privilege level 15
    

    如果没有这个配置会出现密码登录正常,公钥登录无法进入系统视图

    Views: 5

  • BSS Color机制

    BSS Color是与动态CCA门限结合使用的,
    CCA门限分为协议门限和能量门限,协议门限用来控制检测读取信号的最小能量值,小于CCA协议门限的信号会被忽略,设置较高的协议门限就可以忽略较弱的信号,减少干接收信号时的干扰。
    BSS Color和能量门限则用来决定何时可以发送信号,如果收到同频信号且BSS color不同,且其它同频信号的强度低于能量门限则认为无干扰,可以发送信号。
    通常收到的信号中OBSS的信号强度(OBSS_PD)不强于MYBSS协议门限20分贝(OBSS_PD介于CCA SD和CCA ED之间),否者执行CMSA/CD。

    Views: 12

  • nodejs中nodeIntegration什么情况下有效


    上图列出了开启nodeIntegration的条件

    即sandbox和contexIsolation皆为false才能在演染页面开启nodeIntegration
    另外还有一个条件,ESM模式下演染页面无论怎么配置都是不能开启nodeIntegration的,仅能在preload.js中开启nodeIntegration

    参考
    https://cloud.tencent.com/developer/article/2409348

    Views: 0

  • electron使用ESM的坑

    electron中在使用ESM时会有诸多限制,尤其是在非contextIsolation场景下。我遇到的情况是在使用ESM时非contextIsolation场景下configstore会导致preload.mjs加载失败,electron-store无法使用,不过后来测试在main.js中是始终可用的。
    我使用的是electron-vite,其中import { electronAPI } from “@electron-toolkit/preload”在非contextIsolation场景下也会无法正常工作。
    我推测在ESM且非contextIsolation场景下会缺失一些全局变量,导致一些插件工作不正常,可以明确的是process是缺失的(需要自己执行import process from ‘node:process’)。

    另一个怪异的情况是只要preload.mjs执行错误就会报“Unable to load preload script”,而且不显示错误的具体信息,导致排常很困难,一度认为是electron的bug。

    现在的情况是哪些代码,哪些插件在哪个脚本哪个场景下能用需要一个一个去测才知道,官网也没提到关闭contextIsolation会对执行环境有那么大的影响。

    我的理解所谓上下文就是全局变量的作用域,preload.js和网页共享相同的全局变量就是非上下文隔离,反之就是上下文隔离。因为网页中能访问的变量是受限的,在共享上下文时为了保持preload.js和网页的全局变量一致会把网页中没有的全局变量也从preload.js中删掉(但是这只发生成使用ESM时),当使用上下文隔离时则preload.js则拥有与nodejs相同的全局变量。
    而如果不使用上下文隔离的话则只能使用contextBridge在preload.js和网页之间通信,使用contextBridge时会限制只能可序列化的内容才能传送,也就是字符串,数字,数组这些了,无法把一个完整的对象从preload.js传递给网页。
    这里有contextBridge的数据类型支持:https://www.electronjs.org/docs/latest/api/context-bridge#parameter–error–return-type-support

    针对electron-vite中遇到的问题我提交了一个bug报告:https://github.com/alex8088/electron-toolkit/issues/22

    Views: 20

  • Wifi7中的MLO

    • STR MLMR

      需要MLO设备有多个radio,不同radio在不同链路上异步收数数据,可以实现全双工的效果,低延是所有模式中最低的。

    • NSTR MLMR

      需要MLO设备有多个radio,不同radio要同步执行收发,一条链路繁忙另一条线路也要等待。一般不支持这种模式

    • MLSR

      设备需要一个radio多个stream,但可以在两个channel上建立连接且同一时刻只能在一个channel上收发数据。可以降低延迟,适合密集环境。

    • eMLSR

      设备需要一个radio多个stream,但可以在两个channel上建立连接且同一时刻只能在一个channel上收发数据。可以降低延迟,适合密集环境。

    • eMLMR

      需要MLO设备有多个radio,并在不同radio上进行监听,动态切换到空闲的channel对应的radio上收发数据。与MLMR相比增加了动态配置每个链路上空间流的功能。支持这种模式的较少

    实际比较常用的就STR和eMLSR两种模式,STR模式延迟最低,eMLSR带宽更大,延迟也很低(更好的避开干扰),便国内可用频段较少,eMLSR未必有理想中那么好(低带宽模式例外)。
    按理说STR模式的吞吐量应该是最大的,不知道为什么MTK的报告中STR吞吐量并不大(难道是因为设备的自干扰IDC(In-device coexistence))。在另外的报告中(https://arxiv.org/html/2501.04149v1)STR则实现了吞吐量的翻倍。eMLSR模式的好处理更省电,适合移动设备。

    根据一些测试在繁忙的信道环境下会导致其它竟争者的延迟升高,因为一个设备占用了更多的信道,别的设备就没信道可用了。这种情况使用eMLSR或M

    be200仅支持eMLSR模式
    mt7988支持STR和eMLSR模式
    fastconnect 7800 支持STR和eMLSR
    天玑9200/9300 STR
    Filogic 360 MT7925 eMLSR
    Filogic 880 MT7990 支持STR和eMLSR
    天玑9400 支持STR和eMLSR模式
    华为AP支持STR和eMLSR模式
    TP-Link 路由器支持STR和eMLSR模式
    RTL8922 支持STR和eMLSR模式

    参考:
    https://documentation.meraki.com/MR/Wi-Fi_Basics_and_Best_Practices/Wi-Fi_7_(802.11be)_Technical_Guide
    https://www.mediatek.com/technology/wifi/mlo-infographic
    https://www.wi-fi.org/product-finder-results
    https://arxiv.org/html/2501.04149v1

    Views: 43

  • nextcloud报certificate is not valid异常

    这是某个app的签名不正确导致的,但是具体哪个app并不知道,以下脚本可以找到出错的app

    #!/bin/bash
    
    for file in /var/www/nextcloud/apps/*
    do
        if test -d $file
        then
            app=${file##*/}
    
            echo check $app
            sudo -u nobody php /var/www/nextcloud/occ integrity:check-app $app
        fi
    done
    

    然后找到有问题的app进行重装,这样就能解决大部分问题,如果还有问题则干脆删除app所在目录的appinfo/signature.json文件。

    Views: 1

  • nextcloud报此实例中的 php-imagick 模块不支持 SVG

    nextcloud报“此实例中的 php-imagick 模块不支持 SVG。为了获得更好的兼容性,建议安装它”
    安装以下包解决:
    apt install libmagickcore-6.q16-6-extra

    Views: 7

  • AutoCAD免费版下载

    • AutoCAD 2022 64bit

      https://pan.hetao.me/s/L8Y5JnAgEqFD6Yi

    • AutoCAD 2023

      https://pan.hetao.me/s/PQyLfZaHkB3fDMp

    • AutoCAD 2024

      https://pan.hetao.me/s/Rxqx73q9GNgqrRR

    • AutoCAD 2025

      https://pan.hetao.me/s/qocGaN8NQ3i4HrM

    AutoCAD 2022版以后不再有32位版本。
    下载只支持IPv6,不支持IPv4下载

    AutoCAD哪果没有正确卸载的话再安装别的版本会无法正常运行,可以用 https://rj818.com/ 提供的AutoBox工具箱来清理残余信息,用这个工具需要充值10块钱。

    Views: 5

  • Windows本地部署deepseek

    1. 下载安装oolama

    https://ollama.com/download/OllamaSetup.exe

    1. 设置环境变量(优化性能)

      set OLLAMA_FLASH_ATTENTION=1

    2. 拉取模型

      ollama pull deepseek-r1:7b

    3. 运行模型

      ollama run deepseek-r1:7b

    4. 运行web前端

      docker run -d -p 3000:8080 --add-host=host.docker.internal:host-gateway -v open-webui:/app/backend/data --name open-webui --restart always ghcr.io/open-webui/open-webui:main

    查看模型列表
    https://ollama.com/search

    Views: 1

  • go语言fmt占位符

    • 通用

      %v the value in a default format
      when printing structs, the plus flag (%+v) adds field names
      %#v a Go-syntax representation of the value
      (floating-point infinities and NaNs print as ±Inf and NaN)
      %T a Go-syntax representation of the type of the value
      %% a literal percent sign; consumes no value

    • 布尔值

      %t the word true or false

    • 整型

      %b base 2
      %c the character represented by the corresponding Unicode code point
      %d base 10
      %o base 8
      %O base 8 with 0o prefix
      %q a single-quoted character literal safely escaped with Go syntax.
      %x base 16, with lower-case letters for a-f
      %X base 16, with upper-case letters for A-F
      %U Unicode format: U+1234; same as “U+%04X”

    • 浮点型

      %b decimalless scientific notation with exponent a power of two,
      in the manner of strconv.FormatFloat with the ‘b’ format,
      e.g. -123456p-78
      %e scientific notation, e.g. -1.234456e+78
      %E scientific notation, e.g. -1.234456E+78
      %f decimal point but no exponent, e.g. 123.456
      %F synonym for %f
      %g %e for large exponents, %f otherwise. Precision is discussed below.
      %G %E for large exponents, %F otherwise
      %x hexadecimal notation (with decimal power of two exponent), e.g. -0x1.23abcp+20
      %X upper-case hexadecimal notation, e.g. -0X1.23ABCP+20

      The exponent is always a decimal integer.
      For formats other than %b the exponent is at least two digits.

    • 字符串

      %s the uninterpreted bytes of the string or slice
      %q a double-quoted string safely escaped with Go syntax
      %x base 16, lower-case, two characters per byte
      %X base 16, upper-case, two characters per byte

    • 切片

      %p address of 0th element in base 16 notation, with leading 0x

    • 指针

      %p base 16 notation, with leading 0x
      The %b, %d, %o, %x and %X verbs also work with pointers,
      formatting the value exactly as if it were an integer.

    %v格式在不同类型下等效于:
    bool: %t
    int, int8 etc.: %d
    uint, uint8 etc.: %d, %#x if printed with %#v
    float32, complex64, etc: %g
    string: %s
    chan: %p
    pointer: %p

    对于复合对象,使用以下规则以递归方式打印元素

    struct:             {field0 field1 ...}
    array, slice:       [elem0 elem1 ...]
    maps:               map[key1:value1 key2:value2 ...]
    pointer to above:   &{}, &[], &map[]
    

    宽度由紧接在动词前面的可选十进制数指定。如果不存在,则宽度为表示值所需的任何值。精度由(可选)宽度后面的句点和十进制数指定。如果没有句点,则使用默认精度。没有后续数字的句点指定精度为零。示例:
    %f default width, default precision
    %9f width 9, default precision
    %.2f default width, precision 2
    %9.2f width 9, precision 2
    %9.f width 9, precision 0
    对于字符串,宽度的单位是unicode点位而不是字节。

    其它占位符

    '+' always print a sign for numeric values;
        guarantee ASCII-only output for %q (%+q)
    '-' pad with spaces on the right rather than the left (left-justify the field)
    '#' alternate format: add leading 0b for binary (%#b), 0 for octal (%#o),
        0x or 0X for hex (%#x or %#X); suppress 0x for %p (%#p);
        for %q, print a raw (backquoted) string if [strconv.CanBackquote]
        returns true;
        always print a decimal point for %e, %E, %f, %F, %g and %G;
        do not remove trailing zeros for %g and %G;
        write e.g. U+0078 'x' if the character is printable for %U (%#U)
    ' ' (space) leave a space for elided sign in numbers (% d);
        put spaces between bytes printing strings or slices in hex (% x, % X)
    '0' pad with leading zeros rather than spaces;
        for numbers, this moves the padding after the sign
    

    参考:
    https://pkg.go.dev/fmt

    Views: 1