2023年12月

环境:

  • 群晖中安装我不是矿神的syncthing套件
  • 本文设置了反向代理,以便外网通过https访问

问题

  • 近期的7.2版群晖和syncthing配合有问题,https访问时不会替换证书为群晖的证书,仍使用syncthing自动生成的自签名证书,浏览器不接受,导致不安全访问

解决办法

  1. 关闭syncthing套件;ssh登录群晖,并切换为root,切换至syncthing套件的配置目录/volume1/@appdata/syncthing
  2. crt格式的证书的替换https-cert.pem,用key格式的证书替换https-key.pem

    特别注意证书的文件格式,腾讯云自动生成的nginx证书包里是个csr文件,无法使用,而apache证书包里的是符合要求的crt证书

  3. 设置上述两个文件的权限为644,让其他用户可访问;保留root所有权,避免更新时被替换掉
  4. 重启syncthing套件

参考
http://www.up4dev.com/2018/05/29/synology-ssl-wildcard-cert-update/

环境:Windows 10 LTSC
目的:避免微软拼音输入法丢词库和漏备份

  1. 安装小狼毫输入法
  2. 安装双拼
    2.1 下载double_pinyin.yaml,放入程序文件夹\data
    2.2 修改配置文件
    用户文件夹\default.custom.yaml

      schema_list:
     ...
     - {schema: double_pinyin}
  3. 【全局】修改候选词个数
    用户文件夹\default.custom.yaml

    patch:
      menu/page_size: 6
  4. 【全局】更改菜单快捷键
    默认的F4快捷键与Excel中的绝对引用快捷键冲突
    用户文件夹\default.custom.yaml

    patch:
      "switcher/hotkeys":
     - Control+F4
  5. 【全局】横向候选词
    用户文件夹\weasel.custom.yaml

    patch:
      ...
      "style/horizontal": true
  6. 某些程序不使用中文输入法
    有些程序不一定有效
    用户文件夹\weasel.custom.yaml

    patch:
      app_options/bf2cn.exe:  #程序名全部小写
     ascii_mode: true
  7. 双拼不展开
    用户文件夹\double_pinyin.custom.yaml

    patch:
     #不展开成全拼
     translator/preedit_format: []
  8. 扩展词库
    全部下载https://github.com/Chernfalin/better-rime-dict
    double_pinyin.custom.yaml外,全部放入用户文件夹
    用户文件夹\double_pinyin.custom.yaml

    patch:
      ...
      #載入朙月拼音擴充詞庫
      "translator/dictionary": luna_pinyin.extended
      #標點
      'punctuator/import_preset': mysymbols
      'recognizer/patterns/punct': "^/([a-z]+|[0-9])$"
  9. 扩展词库-特殊符号、带圈数字等
    mysymbols.yaml里的定义
  10. 逐键提示(和双拼不展开冲突)
    用户文件夹\double_pinyin.custom.yaml

    patch:
     #逐键提示
      __include: grammar:/hant
  11. 完整的double_pinyin.custom.yaml参考
    前面的某些段落没有的话,后面定义的符号会乱码

    patch:
      #双拼不展开
      translator/preedit_format: []
      
      schema/name: 自然码
      switches:
     - name: ascii_mode
       reset: 0
       states: [ 中文, 西文 ]
     - name: emoji_suggestion
       reset: 1
       states: [ "No", "Yes" ]
     - name: full_shape
       states: [ 半角, 全角 ]
     - name: simplification
       reset: 1
       states: [ 漢字, 汉字 ]
     - name: ascii_punct
       states: [ 。,, ., ]
      engine/translators:
     - punct_translator
     - script_translator
     - table_translator@custom_phrase
      engine/filters:
     - simplifier@emoji_suggestion
     - simplifier
     - uniquifier
     #- charset_filter@gbk
     #- single_char_filter
      engine/processors:
     - ascii_composer
     - recognizer
     - key_binder
     - speller
     - punctuator
     - selector
     - navigator
     - express_editor
      # engine/segmentors:
      #   - ascii_segmentor
      #   - matcher
      #   - abc_segmentor
      #   - punct_segmentor
      #   - fallback_segmentor
      emoji_suggestion:
     opencc_config: emoji.json
     option_name: emoji_suggestion
     # tips: all
    
      #載入朙月拼音擴充詞庫
      "translator/dictionary": luna_pinyin.extended
      # translator/enable_correction: true
    
      # 自定义符号上屏
      punctuator:
     import_preset: mysymbols
     half_shape:
       "#": "#"
       "*": "*"
       "`": "`"
       "~": "~"
       "@": "@"
       "-": "-"
       "+": "+"
       "=": "="
       '\': "、"
       "%": "%"
       "$": ["¥", "$", "€", "£", "¢", "¤"]
       "|": ["|", "|", "·", "?", "§", "|", "‖", "︴"]
       "/": ["/", "÷"]
       "'": { pair: ["「", "」"] }
       "[": ["【", "〔", "["]
       "]": ["】", "〕", "]"]
       "<": "《"
       ">": "》"
    
      recognizer/patterns/punct: "^/([0-9]0?|[A-Za-z]+)$"
    
     #逐键提示
    #  __include: grammar:/hant

参考:
https://zhuanlan.zhihu.com/p/267076288
https://github.com/ssnhd/rime
https://blog.isteed.cc/post/rime-2022/
https://github.com/LufsX/rime
https://github.com/SivanLaai/rime-pure