Skip to main content

PrL的负能量场

有的没的
  1. 查看emmc健康度的两种方式


    eMMC 存储在 linux 上被挂载为块设备,一般通过 /dev/mmcblk* 访问。

    1. mmc-utils 工具

    $ mmc extcsd read /dev/mmcblk2
    =============================================
      Extended CSD rev 1.8 (MMC 5.1)
    =============================================
    
    ...
    $ mmc extcsd read /dev/mmcblk2 | grep -iE 'life|eof'
    eMMC Life Time Estimation A [EXT_CSD_DEVICE_LIFE_TIME_EST_TYP_A]: 0x01
    eMMC Life Time Estimation B [EXT_CSD_DEVICE_LIFE_TIME_EST_TYP_B]: 0x01
    eMMC Pre EOL information [EXT_CSD_PRE_EOL_INFO]: 0x01
    


    2. /sys/class/block 源文件

    Android 上可能没有 mmc 工具,可以通过 /sys/class 查询设备的各种信息。

    # 需要 root 权限
    $ cat /sys/class/block/mmcblk2/device/pre_eol_info
    0x01
    $ cat /sys/class/block/mmcblk2/device/life_time
    0x01 0x01
    


    关键字段\_健康度
    ---------

    1. DEVICE\_LIFE\_TIME\_EST\_TYP

    越小越好,分为 A/B 字段,代表 SLC/MLC 寿命。

    | Value | Description |
    | --- | --- |
    | 0x00 | Not defined |
    | 0x01 | 0%~10% device life time used |
    | 0x02 | 10%~20% device life time used |
    | 0x03 | 20%~30% device life time used |
    | 0x04 | 30%~40% device life time used |
    | 0x05 | 40%~50% device life time used |
    | 0x06 | 50%~60% device life time used |
    | 0x07 | 60%~70% device life time used |
    | 0x08 | 70%~80% device life time used |
    | 0x09 | 80%~90% device life time used |
    | 0x0A | 90%~100% device life time used |
    | 0x0B | Exceeded its maximum estimated device life time |
    | Others | Reserved |

    2. PRE\_EOL\_INFO

    | Value | Pre-EOL Info | Description |
    | --- | --- | --- |
    | 0x00 | Not defined | |
    | 0x01 | Normal | Normal |
    | 0x02 | Warning | Consumed 80% of reserved block |
    | 0x03 | Urgent | |
    | 0x04~0xFF | Reserved | |


    #tech #linux
  2. docx 批量转 pdf
    太牛逼了!
    横跨 win 和 macos 平台!


    You can use the docx2pdf command line utility to batch convert docx to pdf on macOS (or windows). It uses Microsoft Word's APIs to directly convert to PDF creating a perfect copy. It uses JXA (Javscript for Automation, basically AppleScript in JS) in macOS and win32com in Windows.

    pip install docx2pdf
    docx2pdf myfolder/

    Disclaimer: I wrote this tool after struggling to find a cross-platform solution for batch converting docx to pdf with zero formatting issues since it directly uses Microsoft Word. https://github.com/AlJohri/docx2pdf
    GitHub - AlJohri/docx2pdf
  3. 安装西门子软件总是提示重启电脑的解决方法

    - 【重要】所有西门子软件安装时候如果碰到 提示重启电脑或者重启之后依旧提示 的情况,请点击“开始 – 运行”,输入“regedit”(Win7 系统,在开始菜单中搜索“regedit”,然后右键选择“以管理员身份运行”)
    - 【重要】然后在左侧树形框中找到:
    
      HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager
      

    - 【重要】然后删除右侧的:“PendingFileRenameOperations”(删除无风险,操作系统会自动重新创建)
    - 【重要】然后重新运行安装程序即可(不要再重启)。

    #plc