<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[轶哥博客]]></title><description><![CDATA[一个全栈程序员的技术博客。]]></description><link>https://www.wyr.me</link><image><url>https://data.sercretcore.cn/new_avatar.jpeg</url><title>轶哥博客</title><link>https://www.wyr.me</link></image><generator>RSS for Node</generator><lastBuildDate>Thu, 15 Oct 2026 08:17:22 GMT</lastBuildDate><atom:link href="https://www.wyr.me/rss.xml" rel="self" type="application/rss+xml"/><pubDate>Wed, 26 Aug 2026 13:45:53 GMT</pubDate><language><![CDATA[zh-cn]]></language><category><![CDATA[轶哥]]></category><category><![CDATA[王轶]]></category><category><![CDATA[全栈]]></category><category><![CDATA[程序员]]></category><category><![CDATA[技术博客]]></category><item><title><![CDATA[企业业务本体与AI落地]]></title><description><![CDATA[<p>我们在 DesireCore 中做合同审查、标书写作和工程图校核时，发现模型能力并不是最难的一关。真正麻烦的是让几个 Agent 始终处理同一份业务事实，并且知道什么时候能继续、什么时候必须停下来交给人。</p>]]></description><link>https://www.wyr.me/post/769</link><guid isPermaLink="false">https://www.wyr.me/post/769</guid><dc:creator><![CDATA[轶哥]]></dc:creator><pubDate>Wed, 26 Aug 2026 13:45:53 GMT</pubDate></item><item><title><![CDATA[用多Agent搭建更可靠的合同审查智能体]]></title><description><![CDATA[<p>这篇记录我把合同审查从“单次模型输出”改造成“可复核流程”。先固定合同版本、法域边界和输入一致性，再用多角色链路做结构化抽取、风险识别和法务规则匹配，并按风险输出动作建议。重点在于在每一步保留证据和来源落点，让法务明确结论来源与边界。文章还给出前置硬校验（占位符、附件、签署状态、页码完整性）和人工签发机制，避免模型文本再完整也被误当作最终决策。</p>]]></description><link>https://www.wyr.me/post/767</link><guid isPermaLink="false">https://www.wyr.me/post/767</guid><dc:creator><![CDATA[轶哥]]></dc:creator><pubDate>Fri, 07 Aug 2026 07:15:01 GMT</pubDate></item><item><title><![CDATA[多Agent系统实现工程图解析及校核]]></title><description><![CDATA[<p>这篇记录我们在工程图场景里的实践：与其把整张图交给单次识别，不如把流程改造成可追踪、可复核的多层链路。先做版本冻结、页码与基线校验，再做局部识别并带上下文恢复连接关系，最后对照设计资料做规则校核。文章强调工程图中单点误差会放大，必须保留来源页码、坐标和对象关系，才能避免“看起来完整却后续逻辑错位”。流程最终通过独立复核 Agent 与人工签发关口，确保可追责。</p>]]></description><link>https://www.wyr.me/post/766</link><guid isPermaLink="false">https://www.wyr.me/post/766</guid><dc:creator><![CDATA[轶哥]]></dc:creator><pubDate>Fri, 24 Jul 2026 04:26:25 GMT</pubDate></item><item><title><![CDATA[Agent远程控制Windows设备]]></title><description><![CDATA[<p>这篇记录我如何把一台真实 Windows 11 机器接入 Agent 验收链路，而不是临时远程桌面替代测试。内容聚焦 SSH 与 GUI 自动化通道的分工：PowerShell/命令用于状态查询和变更，CUA Driver MCP 负责窗口识别、点击与表单输入，任务执行结果由日志和回执双重收口。文中也记录了 OpenSSH 配置中的关键卡点、管理员连接细节和权限边界，目标是把“执行看似成功”与“操作真正生效、可复验”区分清楚，提升真实 Windows 场景交付稳定性。</p>]]></description><link>https://www.wyr.me/post/765</link><guid isPermaLink="false">https://www.wyr.me/post/765</guid><dc:creator><![CDATA[轶哥]]></dc:creator><pubDate>Fri, 17 Jul 2026 10:02:20 GMT</pubDate></item><item><title><![CDATA[AI写标书踩过的那些坑]]></title><description><![CDATA[<p>这篇记录了我最近在真实招投标项目里踩过的几个坑：不是写得多快，而是能不能把项目真正跑完。文章先聚焦于盯标阶段最容易错的判断边界：先用可核验规则区分值得不值得参投，再进入资格项和评分点的逐条响应。我们强调每个响应必须有原文件依据和责任人补齐计划，不能靠“看起来像对了”算完成。后续落地多 Agent 分工后，读标、写标、查标被拆开，输出从“单次结论”变成可复核的材料链，减少漏项和“提交后才发现错位”的风险。</p>]]></description><link>https://www.wyr.me/post/764</link><guid isPermaLink="false">https://www.wyr.me/post/764</guid><dc:creator><![CDATA[轶哥]]></dc:creator><pubDate>Thu, 16 Jul 2026 14:19:29 GMT</pubDate></item><item><title><![CDATA[在MacOS Sonoma中安装RNDIS驱动的方法]]></title><description><![CDATA[<p>RNDIS（Remote Network Driver Interface Specification）驱动在MacOS Sonoma中的安装，可以有效解决一些网络共享问题。这主要用于两个场景：</p><ol><li><strong>安卓手机有线共享网络</strong>：允许用户通过USB连接，将安卓设备的网络共享给MacOS设备。</li><li><strong>USB随身WiFi有线共享网络</strong>：实现通过USB连接的WiFi设备，为MacOS提供网络连接。常见的飞猫智联U8、高通410随身Wifi等几乎所有USB和TypeC接口的4G/5G随身WIFI都是RNDIS方式有线上网。</li></ol><p>支持Intel、Apple Silicon（M1/M2/M3）芯片。</p>]]></description><link>https://www.wyr.me/post/761</link><guid isPermaLink="false">https://www.wyr.me/post/761</guid><dc:creator><![CDATA[轶哥]]></dc:creator><pubDate>Fri, 16 Feb 2024 06:16:16 GMT</pubDate></item><item><title><![CDATA[首款iPhone短信自动转发到Android的APP]]></title><description><![CDATA[<p>由于工作需要，长期以来我都是iPhone作为主力机，安卓作为备用机。经常出现iPhone在充电的时候需要接收验证码。为了实现备用机和主力机一致的功能体验，特地让AI帮我写了一个APP实现“iPhone短信自动转发到Android手机”。</p><p>众所周知，Android手机APP是可以可以申请读取短信内容权限的，实现Android短信自动转发或者自动识别验证码是比较容易的。但是目前为止，我并没有发现市面上存在IOS应用程序可以实现读取短信的。真的没有办法实现读取短信内容吗？带着疑问我让AI帮忙翻阅了Apple开发者文档，最后发现其实是可以实现这个功能的。</p>]]></description><link>https://www.wyr.me/post/760</link><guid isPermaLink="false">https://www.wyr.me/post/760</guid><dc:creator><![CDATA[轶哥]]></dc:creator><pubDate>Mon, 28 Aug 2023 13:24:45 GMT</pubDate></item><item><title><![CDATA[逆境会改变大脑]]></title><description><![CDATA[<p>这篇文章《A stable and replicable neural signature of lifespan adversity in the adult brain》在《Nature Neuroscience》上发表，讲述了一项纵向研究，研究人员通过对约170人的一生数据及其大脑结构的检视，发现逆境（如母亲怀孕期吸烟，受虐待等负面事件）会导致大脑广泛的形态变化，这种影响与生逆境类型和患者大脑特定区域有关。研究结果显示，这种逆境对大脑结构的影响是可持续且稳定的，逆境不仅改变了大脑结构，而且可能引起持续的焦虑症状，有助于预测谁更有可能患上精神障碍，这为精神健康的干预和治疗提供了新的理论依据。逆境不仅是社会和心理问题，更是生物学问题。我们需要对逆境的影响进行更多重视，寻求有效策略减轻其对个人和家庭的长期影响。同时，研究团队开源了用于预测临床神经科学的工具包，旨在推动此领域的进一步发展。</p>]]></description><link>https://www.wyr.me/post/759</link><guid isPermaLink="false">https://www.wyr.me/post/759</guid><dc:creator><![CDATA[轶哥]]></dc:creator><pubDate>Thu, 24 Aug 2023 15:50:35 GMT</pubDate></item><item><title><![CDATA[What Data Is Needed for Supervised Fine-Tuning (SFT)?]]></title><description><![CDATA[<p>The article primarily discusses the types and quality of data required for Supervised Fine-Tuning (SFT). It covers the following aspects:</p><ol><li><strong>Objectives of Supervised Fine-Tuning</strong> : Enhancing performance in specific tasks, domain adaptability, and the interpretability and controllability of the model, with an overarching goal to boost system robustness.</li><li><strong>Core Considerations</strong> : These include the diversity of data, avoiding treating SFT merely as data supplementation, appropriately incorporating few-shot learning and COT data, emphasizing data quality over quantity in SFT, and recognizing that increasing data volume without diversity brings diminished returns.</li><li><strong>Data Quality Requirements</strong> : These considerations touch on the length restrictions for questions and answers, the accuracy of answers, the selection of data based on industry requirements, the diversity of necessary NLP abilities, and the caution against too much vertical domain data.</li><li><strong>Specific Examples</strong> : The article provides both good and poor dataset examples to illustrate how to choose and evaluate data.</li><li><strong>Q&amp;A Section</strong> : This part explains why including the ability to write code in SFT is essential, emphasizing its importance in improving reasoning and structured output abilities.</li></ol><p>In summary, the article offers comprehensive guidance on how to conduct supervised fine-tuning, underlining the importance of data diversity and quality, and presents implementation strategies and examples to support these points.</p>]]></description><link>https://www.wyr.me/post/758</link><guid isPermaLink="false">https://www.wyr.me/post/758</guid><dc:creator><![CDATA[轶哥]]></dc:creator><pubDate>Wed, 23 Aug 2023 15:21:29 GMT</pubDate></item><item><title><![CDATA[普通电脑安装使用A800/A100等专业显卡]]></title><description><![CDATA[<p>专业显卡在生产力应用领域不仅仅用于AI模型训练及推理，也用于空气动力学仿真、科学计算和数据分析。某些情况下塔式工作站是很多专业用户的最佳选择。</p><h2>为什么选择消费级平台？</h2><p>使用云服务获得专业显卡的计算能力是非常方便的，但受限于光速，使用非同一个城市的机房会有较大的延迟，部分专业应用对延迟要求很高，也不得不使用物理机搭配专业显卡。</p><p>博主在近几年一直在做垂直领域的人工智能，由于服务于政府客户，对数据安全的要求比较高，因此选择自建塔式工作站放置于工作室来进行模型调试，使用雷电4接口能够快速传输大量数据。在生产部署阶段自然也会部署于服务器机房，实现合理分工。</p><p>在服务器中使用A800/A100专业显卡非常简单，插上去就完事。但是机架服务器动辄万转的风扇产生巨大的噪音使得无法放置在普通办公室使用。</p><p>不同的人对专业应用的要求是不一样的，就像有的人明知游戏卡某些计算精度性能和专业卡有区别，内存带宽和多卡互联能力也有很大差距，但是他就是要用多张4090游戏卡来进行AI炼丹一样，他们既不使用专业软件，也不要求更高的数据吞吐能力，因此出于对成本、环境、安全性以及各方面的考虑，就是有用户希望使用普通电脑安装使用专业显卡。博主实测4090比绝大部分专业卡做AI绘图速度更快，因此4090在这个场景下就是具有性价比。总之，希望大家以包容的心态看待这个问题。</p><p>家用级别的设备稳定性是远不如企业级设备的，博主也只会在开发环境下使用消费级平台，不要试图将工作站直接放进机柜部署，否则就是给自己找事情做。</p>]]></description><link>https://www.wyr.me/post/757</link><guid isPermaLink="false">https://www.wyr.me/post/757</guid><dc:creator><![CDATA[轶哥]]></dc:creator><pubDate>Tue, 27 Jun 2023 16:25:45 GMT</pubDate></item><item><title><![CDATA[在 Windows 中迁移 SSH 密钥]]></title><description><![CDATA[<p>本文以Windows 11系统下复制密钥到另一台Windows 11设备为例，介绍如何在 Windows 设备之间迁移 SSH 密钥（<strong>此方法也使用于Unix设备的密钥迁移到Windows平台</strong>）。无论是在工作场景还是个人使用环境下，网络安全都至关重要。SSH 密钥为用户提供了一种更安全的身份验证方法，可以保护和远程服务器通讯过程中的数据。<strong>直接将<code>~\.ssh\id_rsa</code>和<code>~\.ssh\id_rsa.pub</code>复制到另外一台设备是无法正常工作的</strong>，因为密钥对文件权限有着严格要求，本文讨论的就是Windows平台中密钥权限修改的问题。</p>]]></description><link>https://www.wyr.me/post/756</link><guid isPermaLink="false">https://www.wyr.me/post/756</guid><dc:creator><![CDATA[轶哥]]></dc:creator><pubDate>Fri, 09 Jun 2023 13:06:05 GMT</pubDate></item><item><title><![CDATA[在Windows平台上使用C++执行外部命令的两种方法]]></title><description><![CDATA[<p>在本文中，我将向大家介绍如何在Windows平台上使用C++执行外部命令。我们将探讨两种不同的方法，并对它们进行比较和描述。当我们需要在程序中集成其他应用程序或运行脚本时，这两种方法都非常有用。</p><p>在详细讲解这两种方法之前，让我们先了解为什么我们需要在C++程序中执行外部命令。有时，我们需要与其他进程进行交互，例如运行一个脚本、启动一个新进程或收集系统信息。在这些情况下，执行外部命令可以帮助我们轻松地完成这些任务。</p><p>现在让我们开始深入了解这两种方法。</p>]]></description><link>https://www.wyr.me/post/755</link><guid isPermaLink="false">https://www.wyr.me/post/755</guid><dc:creator><![CDATA[轶哥]]></dc:creator><pubDate>Fri, 26 May 2023 16:20:32 GMT</pubDate></item><item><title><![CDATA[C++ LLVM生成测试覆盖率]]></title><description><![CDATA[<p>测试覆盖率是衡量软件测试质量的一个重要指标，它表示在运行测试用例时，被执行到的代码占总代码数的百分比。通过测试覆盖率，我们可以评估测试集对源码的覆盖程度及潜在漏洞。</p><p>本文将介绍两种使用LLVM实现C++测试覆盖率的方法：</p><ul><li>方案1 使用lcov和llvm-cov将gcda文件转换为lcov.info文件。</li><li>方案2 使用grcov。</li></ul>]]></description><link>https://www.wyr.me/post/754</link><guid isPermaLink="false">https://www.wyr.me/post/754</guid><dc:creator><![CDATA[轶哥]]></dc:creator><pubDate>Thu, 25 May 2023 09:13:13 GMT</pubDate></item><item><title><![CDATA[Rust单元测试完成后自动执行覆盖率测试]]></title><description><![CDATA[<p>在本文将探讨如何在Rust项目中自动完成单元测试并执行覆盖率测试。我们将使用<code>rust-analyzer</code>插件、配置<code>.vscode/settings.json</code>文件以及编写一个Python脚本变相实现cargo命令的hook。最终效果按下“Run Test”按钮后自动完成单元测试及覆盖率测试，实现搭配<code>Coverage Gutters</code>插件实时显示覆盖率结果。</p><p><img src="https://cdn.wyr.me/post-files/2023-05-22/1684745358463/rust-test.png" alt="rusttest.png"></p>]]></description><link>https://www.wyr.me/post/753</link><guid isPermaLink="false">https://www.wyr.me/post/753</guid><dc:creator><![CDATA[轶哥]]></dc:creator><pubDate>Mon, 22 May 2023 08:54:39 GMT</pubDate></item><item><title><![CDATA[CUDA Toolkit 11.7、11.8与12.1官方下载地址]]></title><description><![CDATA[<p>随着GPU计算能力的不断提升，CUDA（Compute Unified Device Architecture）已经成为了并行计算领域必不可少的工具。NVIDIA推出新版本的CUDA Toolkit时，开发者需要关注其下载地址。本文将向大家介绍CUDA Toolkit 11.7、11.8和12.1的官方下载地址。</p><ol><li>CUDA Toolkit 11.7: <a target="_blank" href="https://developer.nvidia.com/cuda-11-7-0-download-archive" title="" rel="external nofollow">https://developer.nvidia.com/cuda-11-7-0-download-archive</a></li><li>CUDA Toolkit 11.8: <a target="_blank" href="https://developer.nvidia.com/cuda-11-8-0-download-archive" title="" rel="external nofollow">https://developer.nvidia.com/cuda-11-8-0-download-archive</a></li><li>CUDA Toolkit 12.1: <a target="_blank" href="https://developer.nvidia.com/cuda-downloads" title="" rel="external nofollow">https://developer.nvidia.com/cuda-downloads</a></li></ol>]]></description><link>https://www.wyr.me/post/752</link><guid isPermaLink="false">https://www.wyr.me/post/752</guid><dc:creator><![CDATA[轶哥]]></dc:creator><pubDate>Sun, 14 May 2023 08:02:16 GMT</pubDate></item><item><title><![CDATA[小米音频眼镜与Bose音频眼镜实际体验]]></title><description><![CDATA[<p>作为一个对VR、AR和可穿戴设备充满浓厚兴趣的人，我一直关注着这些领域的发展。本人有耳朵方面的小问题，受医生建议不要长时间佩戴耳机，因此音频眼镜对我来说属于刚需。在此次评测中，我将从音质、漏音、便携性、续航、蓝牙功能、通话质量、佩戴舒适度、外观、防水等级、充电线、操作体验等方面对Bose音频眼镜和小米音频眼镜进行分析并比较。</p><p>Bose智能音频眼镜2020年8月14日购于线下官方店，佩戴2年9个月。</p><p>小米音频眼镜官方名称叫做MIJIA智能音频眼镜，购于小米有品众筹。2023年5月1日收到货，佩戴13天。</p><p>买小米眼镜的原因是Bose眼镜续航太短，听歌3个小时就没电了，只能用一个早上，所以买小米的轮班。</p><p><img src="https://cdn.wyr.me/post-files/2023-05-13/1683977806518/bose&mijia.jpg" alt="小米与Bose合拍"></p>]]></description><link>https://www.wyr.me/post/751</link><guid isPermaLink="false">https://www.wyr.me/post/751</guid><dc:creator><![CDATA[轶哥]]></dc:creator><pubDate>Sat, 13 May 2023 12:03:32 GMT</pubDate></item><item><title><![CDATA[AI谈编程语言（Rust、Go、TS、Python）]]></title><description><![CDATA[<p>在ChatGPT等AI大模型流行前2年，我的代码就已经有超过50%是AI辅助编程情况下完成的。之所以AI编程有那么大的占比，是因为我的开发基于低代码DSL，编程过程中存在很多“套路”，因此我的开发效率通常是同类型任务开发者的2-6倍（效率与具体工作内容密切相关）。</p><p><img src="https://cdn.wyr.me/post-files/2023-05-11/1683820538633/AI_tabnine.jpg" alt="AItabnine.jpg"></p><p>上图为2022年使用Tabnine辅助编程中，AI自动完成的代码占比情况。</p><p>由于ChatGPT对中文注释的理解能力更强，目前我已经由团队版Tabnine切换为Github免费提供给我使用的Github Copilot，效率只增不减。</p><p>现今AI辅助编程大行其道，我们再也不用纠结于专精某一门编程语言了。毕竟编程语言设计之初就是为了人类更好的和计算机沟通，如今很多事情可以在AI帮助下快速完成，在掌握主流算法和基础数据结构的基础上，我们可以自由选择对应场景所适合的编程语言，提高效率的同时最大化利用语言优势。</p>]]></description><link>https://www.wyr.me/post/750</link><guid isPermaLink="false">https://www.wyr.me/post/750</guid><dc:creator><![CDATA[轶哥]]></dc:creator><pubDate>Thu, 11 May 2023 16:22:56 GMT</pubDate></item><item><title><![CDATA[Windows安装rsync命令一键脚本]]></title><description><![CDATA[<p>在Windows上安装rsync通常需要使用诸如WSL2或Cygwin等解决方案。然而，这些方法可能会导致性能下降、系统资源占用高以及用户体验不佳等问题。因此，我们将通过一个简单的PowerShell脚本来安装cwRsync，避免上述问题。</p><p><strong>请注意：</strong> 执行这个脚本意味着您同意cwRsync的相关协议。</p>]]></description><link>https://www.wyr.me/post/749</link><guid isPermaLink="false">https://www.wyr.me/post/749</guid><dc:creator><![CDATA[轶哥]]></dc:creator><pubDate>Tue, 09 May 2023 13:45:26 GMT</pubDate></item><item><title><![CDATA[Vue3对接ChatGPT4接口（打字机效果）]]></title><description><![CDATA[<p>本篇文章将介绍如何在 Vue3 中实现与 ChatGPT4 API 的对接。具体的后端 API 对接方式，还请参考这篇文章：<a target="_blank" href="https://www.wyr.me/post/736" title="" rel="external">《对接ChatGPT3.5/4的API实现打字机效果》</a>。</p>]]></description><link>https://www.wyr.me/post/748</link><guid isPermaLink="false">https://www.wyr.me/post/748</guid><dc:creator><![CDATA[轶哥]]></dc:creator><pubDate>Mon, 08 May 2023 02:39:15 GMT</pubDate></item><item><title><![CDATA[强行修改笔记本风扇转速的方法]]></title><description><![CDATA[<p>在这篇文章中，我们将讨论如何通过修改EC寄存器来调整笔记本电脑的风扇转速。请注意，本文 <strong>不会给出直接的解决方案</strong> ，而是提供解决问题的思路和大致方法。对于了解这些概念的用户，他们应该能够知道如何具体实现。对于不熟悉这些知识的用户来说，尝试进行相关操作可能存在很大的风险。</p><p>进行操作前，请务必备份当前EC寄存器的值，并确保具备拆机、断电和恢复BIOS的动手能力。</p>]]></description><link>https://www.wyr.me/post/747</link><guid isPermaLink="false">https://www.wyr.me/post/747</guid><dc:creator><![CDATA[轶哥]]></dc:creator><pubDate>Sat, 06 May 2023 16:26:23 GMT</pubDate></item><item><title><![CDATA[解决pnpm (ERR_INVALID_THIS)异常 Node.js 20]]></title><description><![CDATA[<p>在Node.js 20版本中，你可能会遇到如下异常：</p><pre><code class="language-plaintext"> WARN  GET https://registry.npmjs.org/chatgpt/-/chatgpt-5.0.10.tgz error (ERR_INVALID_THIS). Will retry in 10 seconds. 2 retries left.</code></pre><p>为了解决这个问题，你只需要升级到pnpm v8.3.1或更高版本。可以通过以下命令安装并激活指定版本的pnpm：</p><pre><code class="language-bash">corepack prepare pnpm@8.3.1 --activate</code></pre>]]></description><link>https://www.wyr.me/post/746</link><guid isPermaLink="false">https://www.wyr.me/post/746</guid><dc:creator><![CDATA[轶哥]]></dc:creator><pubDate>Thu, 04 May 2023 09:13:09 GMT</pubDate></item><item><title><![CDATA[解决VSCode Ctrl + . 快捷键被占用]]></title><description><![CDATA[<p>在日常使用Visual Studio Code (VSCode) 的过程中，你可能会遇到<code>Ctrl + .</code>快捷键被占用的问题。这个快捷键在VSCode中本来是用于快速修复（Quick Fixes）的，但有时可能会失效。究其原因，与输入法的中/英文标点切换快捷键冲突有关。本文将为你提供一种解决方法。</p><h2>问题原因</h2><ol><li><strong>微软拼音输入法</strong> ：微软拼音输入法中，中/英文标点切换的快捷键为<code>Ctrl + .</code>，与VSCode的快速修复快捷键冲突。</li><li><strong>微信键盘输入法</strong> ：在微信键盘输入法中，“中文时使用英文标点”的功能也占用了<code>Ctrl + .</code>快捷键，同样导致冲突。</li></ol>]]></description><link>https://www.wyr.me/post/745</link><guid isPermaLink="false">https://www.wyr.me/post/745</guid><dc:creator><![CDATA[轶哥]]></dc:creator><pubDate>Wed, 03 May 2023 04:46:53 GMT</pubDate></item><item><title><![CDATA[CDN加载失败自动切换为加载本地静态资源]]></title><description><![CDATA[<p>在Web开发中，我们通常使用CDN（内容分发网络）来加速网站的静态资源（如CSS和JavaScript文件）加载。然而，CDN有时可能会失效，导致网站加载速度变慢或者无法正常运行。本文将介绍一种优化方案，当HTML中引入的style或JavaScript静态资源CDN失效时，自动切换为加载本地js/css。我们还将介绍一个名为 &quot;CDN to Local Fallback for HTML Files&quot; 的VSCode插件的开发和测试过程，以帮助您更轻松地实现这个方案。</p><h2>前端静态资源CDN加载失败的优化方案</h2><p>要实现这个优化方案，我们需要在HTML文件中添加一个特殊的<code>&lt;script&gt;</code>标签，当CDN资源加载失败时，该脚本将自动切换到使用本地资源。具体实现方法如下：</p><ol><li>遍历HTML文件中所有引用外部CSS和JavaScript资源的<code>&lt;link&gt;</code>和<code>&lt;script&gt;</code>标签。</li><li>下载这些标签所指向的CDN资源，并将其保存到本地目录。</li><li>在每个<code>&lt;link&gt;</code>和<code>&lt;script&gt;</code>标签中添加一个<code>onerror</code>属性，该属性指向一个名为<code>loadFallbackResource</code>的函数。</li><li>在HTML文件中添加一个<code>&lt;script&gt;</code>标签，该标签包含<code>loadFallbackResource</code>函数的实现，以及一个在页面加载完成后遍历所有带有<code>onerror</code>属性的元素并调用<code>loadFallbackResource</code>的事件监听器。</li></ol>]]></description><link>https://www.wyr.me/post/744</link><guid isPermaLink="false">https://www.wyr.me/post/744</guid><dc:creator><![CDATA[轶哥]]></dc:creator><pubDate>Sun, 30 Apr 2023 15:50:01 GMT</pubDate></item><item><title><![CDATA[Nginx反向代理OpenAI API]]></title><description><![CDATA[<p>在本教程中，我们将介绍如何使用Nginx反向代理访问OpenAI API，并提供相应的测试方法。主要目标是保证Server-sent events (SSE)类型响应的流畅输出，从而提供良好的用户体验。</p>]]></description><link>https://www.wyr.me/post/743</link><guid isPermaLink="false">https://www.wyr.me/post/743</guid><dc:creator><![CDATA[轶哥]]></dc:creator><pubDate>Sun, 30 Apr 2023 03:59:48 GMT</pubDate></item><item><title><![CDATA[解决 push 到 GitHub 异常 - 无法连接22端口]]></title><description><![CDATA[<p>本文将介绍如何解决在尝试 push 到 GitHub 时遇到的 &quot;ssh: connect to host xx.xx.xx.xx port 22: Connection timed out&quot; 错误。我们将通过修改 SSH 配置并使用端口 443 进行连接来解决此问题。</p>]]></description><link>https://www.wyr.me/post/742</link><guid isPermaLink="false">https://www.wyr.me/post/742</guid><dc:creator><![CDATA[轶哥]]></dc:creator><pubDate>Sat, 29 Apr 2023 11:23:38 GMT</pubDate></item><item><title><![CDATA[1Password去重脚本]]></title><description><![CDATA[<p>随着时间的推移，1Password中的记录可能会出现重复（其实是1Password老版本的BUG导致的）。这些重复记录可能会导致混乱，并增加在查找需要的凭据时的困难。为了解决这个问题，我们创建了一个用于查找并删除重复项的Python脚本。</p><h2>脚本概述</h2><p>该脚本首先获取所有重复的title，然后提取相关的ID。接着，脚本通过比较Fields和URLs部分，找到重复的项目并将多余的项目ID添加到一个列表中。最后，根据需要，您可以选择删除多余的项目。</p><h2>使用方法</h2><ol><li>确保已安装Python 3，并确保1Password CLI（命令行界面）已经正确配置。</li><li>保存以下脚本到名为 <code>1password_deduplicate.py</code> 的文件中。</li><li>在终端中，导航到包含脚本的文件夹，然后运行 <code>python 1password_deduplicate.py</code>。</li><li>脚本将显示需要删除的额外项目ID。如需删除这些项目，请取消脚本末尾相关行的注释，并重新运行脚本。</li></ol>]]></description><link>https://www.wyr.me/post/741</link><guid isPermaLink="false">https://www.wyr.me/post/741</guid><dc:creator><![CDATA[轶哥]]></dc:creator><pubDate>Thu, 23 Mar 2023 11:21:23 GMT</pubDate></item><item><title><![CDATA[网络监测小工具]]></title><description><![CDATA[<p>网络监测小工具是一个使用Golang编写的工具，可以帮助您定期地监测网络性能。它将自动测试网络延迟、丢包率和下载速度，并将结果记录到Excel文件中。今天，我们将介绍这个工具的功能以及如何使用它。</p><p><img src="https://cdn.wyr.me/post-files/2023-03-22/1679493322261/%E7%BD%91%E7%BB%9C%E6%A3%80%E6%B5%8B%E8%AE%B0%E5%BD%95.png" alt="%E7%BD%91%E7%BB%9C%E6%A3%80%E6%B5%8B%E8%AE%B0%E5%BD%95.png"></p><p><strong>主要功能</strong></p><ul><li>每5分钟自动测试网络状态</li><li>记录主路由、网关、百度网站以及服务器的平均延迟和丢包率</li><li>记录两个下载链接的下载速度</li><li>将结果保存到Excel文件中</li></ul>]]></description><link>https://www.wyr.me/post/740</link><guid isPermaLink="false">https://www.wyr.me/post/740</guid><dc:creator><![CDATA[轶哥]]></dc:creator><pubDate>Wed, 22 Mar 2023 13:58:41 GMT</pubDate></item><item><title><![CDATA[执行Shell脚本报错：/bin/bash^M: bad interpreter 解决方法]]></title><description><![CDATA[<p>执行Shell脚本提示：</p><pre><code class="language-shell">/bin/bash^M: bad interpreter: No such file or directory...</code></pre><p>这个问题是由于在 Windows 系统中创建或编辑的 shell 脚本文件，在行尾使用了 Windows 风格的换行符（CRLF，即回车+换行），而非 Unix 风格的换行符（LF，即换行）。当您在 Unix 或 Linux 系统上运行这个脚本时，它不能正确解析这个 Windows 风格的换行符，从而导致报错。</p>]]></description><link>https://www.wyr.me/post/739</link><guid isPermaLink="false">https://www.wyr.me/post/739</guid><dc:creator><![CDATA[轶哥]]></dc:creator><pubDate>Tue, 21 Mar 2023 10:25:20 GMT</pubDate></item><item><title><![CDATA[Windows客户端EV证书代码签名踩坑]]></title><description><![CDATA[<p>在现今的数字时代，软件安全日益受到重视。对于Windows客户端开发者来说，使用EV（Extended Validation）证书对软件进行代码签名是确保用户信任和防止恶意攻击的关键一环。本文将探讨在Windows下的桌面软件开发过程中进行EV证书代码签名的必要性，未签名可能存在的问题，以及在签名过程中可能遇到的问题和解决方法。</p>]]></description><link>https://www.wyr.me/post/738</link><guid isPermaLink="false">https://www.wyr.me/post/738</guid><dc:creator><![CDATA[轶哥]]></dc:creator><pubDate>Tue, 21 Mar 2023 08:20:24 GMT</pubDate></item><item><title><![CDATA[编译安卓版本frpc]]></title><description><![CDATA[<p>frp是一个高性能的反向代理工具，它可以帮助我们穿透NAT和防火墙，实现内网穿透。它采用客户端-服务器模式，在内网中部署客户端程序，将需要访问的端口映射到公网上的服务器上，即可通过公网地址访问内网服务。同时，frp还可以作为正向代理使用，从而实现某些特定场景下的代理功能。frpc是frp的客户端程序。</p><p>在本文中，我们本文将详细介绍如何编译开源项目frpc的安卓版本。在禁用CGO的情况下，编译一个适用于Android操作系统、基于ARM64架构的可执行文件，同时使用 <code>-trimpath</code> 和 <code>-ldflags &quot;-s -w&quot;</code> 选项来减小二进制文件的大小，并在安卓设备上运行它，以实现在嵌入式设备（自助终端设备）上使用frpc的功能。</p>]]></description><link>https://www.wyr.me/post/737</link><guid isPermaLink="false">https://www.wyr.me/post/737</guid><dc:creator><![CDATA[轶哥]]></dc:creator><pubDate>Mon, 13 Mar 2023 16:21:40 GMT</pubDate></item><item><title><![CDATA[对接ChatGPT3.5/4的API实现打字机效果]]></title><description><![CDATA[<p>回一个完整的对话文本。我们将介绍一个 Node.js 服务器和一个 HTML 页面的示例代码，这两个组件通过 HTTP 请求和 SSE（Server-Sent Events）协议连接，并实现了基于流式 API 的长时间运行的聊天功能。</p><p>对接ChatGPT3.5/4接口本身很简单，但是实现<code>stream</code>以打字机效果展示并且实现自动长回复，不少小伙伴遇到问题，特整理了一份3.5接口开放当天用于临时验证的示例代码供学习参考（千万不要用于生产环境）。</p>]]></description><link>https://www.wyr.me/post/736</link><guid isPermaLink="false">https://www.wyr.me/post/736</guid><dc:creator><![CDATA[轶哥]]></dc:creator><pubDate>Mon, 13 Mar 2023 15:52:44 GMT</pubDate></item><item><title><![CDATA[ssh一键部署frpc内网穿透脚本]]></title><description><![CDATA[<p>以下是实现自动安装frpc的Shell脚本，实现ssh的22端口内网穿透，注册systemd服务开机自动启动。</p><p><strong>直接使用线上地址快速下载并执行Shell脚本一件部署可以使用以下命令：</strong></p><p>使用curl：</p><pre><code class="language-bash">curl -sSL https://openapi.site/install_frpc.sh | bash -s 端口号 token server_addr [server_port=7000]</code></pre><p>使用wget：</p><pre><code class="language-bash">wget -qO- https://openapi.site/install_frpc.sh | bash -s 端口号 token server_addr [server_port=7000]</code></pre><p>其中端口号、token、server_addr为必须传入的参数，server_port为可选参数，如果没有传入则默认为7000。请根据自己的需要替换相应的参数值。</p>]]></description><link>https://www.wyr.me/post/735</link><guid isPermaLink="false">https://www.wyr.me/post/735</guid><dc:creator><![CDATA[轶哥]]></dc:creator><pubDate>Mon, 13 Mar 2023 15:22:16 GMT</pubDate></item><item><title><![CDATA[frp更新中心API]]></title><description><![CDATA[<p><code>frp-update-center</code> 是一个开源的基于 Python 编写的更新中心，为 <a target="_blank" href="https://github.com/fatedier/frp" title="" rel="external nofollow">frp</a> 提供最新版本和不同平台架构的组件，使用户能够轻松下载和更新。</p><p><code>frp</code> 是一个快速的反向代理工具，由 Go 语言编写，它可以帮助用户轻松地将内网服务映射到公网上，从而实现访问内网服务的目的。<code>frp</code> 拥有强大的功能和良好的性能，在企业和个人使用场景中广泛应用。</p><p>由于 <code>frp</code> 是一个跨平台的工具，因此用户需要在不同的操作系统和架构上安装和更新它。<code>frp-update-center</code> 就是为了解决这个问题而诞生的，它提供了一个统一的接口，使用户能够方便地获取和下载最新版本的 <code>frp</code> 组件。</p>]]></description><link>https://www.wyr.me/post/734</link><guid isPermaLink="false">https://www.wyr.me/post/734</guid><dc:creator><![CDATA[轶哥]]></dc:creator><pubDate>Thu, 09 Mar 2023 11:46:47 GMT</pubDate></item><item><title><![CDATA[【视频】ChatGPT完整实现定时请求小系统]]></title><description><![CDATA[<iframe src="https://player.bilibili.com/player.html?aid=610130846&bvid=BV1u84y1E79f&cid=1031780759&page=1" scrolling="no" border="0" frameborder="no" framespacing="0" allowfullscreen="true"> </iframe><p>实现预览：</p><p><img src="https://cdn.wyr.me/post-files/2023-02-28/1677595282482/scheduled-requests-chatgpt.png" alt="scheduledrequestschatgpt.png"></p><p><strong>B站视频：</strong> <a target="_blank" href="https://www.bilibili.com/video/BV1u84y1E79f/?share_source=copy_web&vd_source=de30ad927aff7c4075790b558eb50e56" title="" rel="external nofollow">https://www.bilibili.com/video/BV1u84y1E79f/?share_source=copy_web&amp;vd_source=de30ad927aff7c4075790b558eb50e56</a></p><p><strong>代码仓库：</strong><a target="_blank" href="https://github.com/yi-ge/scheduled-requests" title="" rel="external nofollow">https://github.com/yi-ge/scheduled-requests</a></p>]]></description><link>https://www.wyr.me/post/733</link><guid isPermaLink="false">https://www.wyr.me/post/733</guid><dc:creator><![CDATA[轶哥]]></dc:creator><pubDate>Tue, 28 Feb 2023 14:48:31 GMT</pubDate></item><item><title><![CDATA[创建访客统计徽章]]></title><description><![CDATA[<p>访客徽章通常用于<a target="_blank" href="https://github.com/yi-ge" title="" rel="external nofollow">Github个人主页</a>或者开源项目Markdown中统计访客数量。</p><p><img src="https://app.yizcore.xyz/badge.php?page_id=yi-ge" alt="visitors"></p><p>借助于ChatGPT强大的语义理解能力，编写PHP单文件实现完整badge功能非常容易。甚至就是一句话的事。</p><p><img src="https://cdn.wyr.me/post-files/2023-02-27/1677507369499/chatgpt-php.jpg" alt="chatgptphp.jpg"></p>]]></description><link>https://www.wyr.me/post/732</link><guid isPermaLink="false">https://www.wyr.me/post/732</guid><dc:creator><![CDATA[轶哥]]></dc:creator><pubDate>Mon, 27 Feb 2023 14:30:00 GMT</pubDate></item><item><title><![CDATA[ChatGPT已具备编写完整程序的能力]]></title><description><![CDATA[<p>随着人工智能技术的不断发展，自然语言处理模型也越来越强大。其中，OpenAI公司开发的ChatGPT模型可以说是自然语言处理技术中的一股强劲力量。除了能够进行自然语言的理解和生成，ChatGPT还具备编写完整程序的能力。</p><p>ChatGPT是一个基于神经网络的自然语言处理模型，它被训练出来可以模仿人类语言的表达方式，包括语法、语义和逻辑。ChatGPT的强大之处在于它可以利用这些语言知识来推理和判断，从而生成有意义的回复。这种能力使得ChatGPT成为了一个非常有用的工具，可以应用于多个领域，ChatGPT可以理解人类语言，分析和处理语言信息，实现对话和回答问题的功能。除此之外，ChatGPT还可以通过学习和自我更新，不断提高自身的处理能力和实现更加复杂的任务。</p>]]></description><link>https://www.wyr.me/post/731</link><guid isPermaLink="false">https://www.wyr.me/post/731</guid><dc:creator><![CDATA[轶哥]]></dc:creator><pubDate>Thu, 23 Feb 2023 15:32:11 GMT</pubDate></item><item><title><![CDATA[开源Dock快捷键MacOS应用 Dock Shortcut]]></title><description><![CDATA[<p>使用热键来打开Dock中的应用程序。<code>option + 1</code> 打开Dock中的第一个应用程序，就像Linux和Windows那样。</p><p><img src="https://cdn.wyr.me/post-files/2022-12-26/1672024905455/Preview_CHS.png" alt="PreviewCHS.png"></p>]]></description><link>https://www.wyr.me/post/730</link><guid isPermaLink="false">https://www.wyr.me/post/730</guid><dc:creator><![CDATA[轶哥]]></dc:creator><pubDate>Mon, 26 Dec 2022 03:21:58 GMT</pubDate></item><item><title><![CDATA[开发了一个国内可以使用的ChatGPT H5版本]]></title><description><![CDATA[<p>ChatGPT的出现改变了很多人对AI的看法，也包括我。</p><p>出于对新鲜事物的好奇，我也体验了一段时间的ChatGPT。</p><p>然而体验ChatGPT并非一件容易的事情，出于让更多人能体验到目前公开的最先进的生成式AI的目的，特地编写了一个H5版本的ChatGPT客户端。</p>]]></description><link>https://www.wyr.me/post/729</link><guid isPermaLink="false">https://www.wyr.me/post/729</guid><dc:creator><![CDATA[轶哥]]></dc:creator><pubDate>Sat, 10 Dec 2022 13:33:32 GMT</pubDate></item><item><title><![CDATA[Kali升级内核]]></title><description><![CDATA[<p>随着<code>Kali Linux 2022.3</code>版本的发布，Linux内核也随之更新为<code>5.18.5</code>(2020-07-07)。截止2022年10月29日，<code>amd64</code>架构下最新版内核为<code>5.19.11</code>(2022-10-10)。注意，目前Linux Kernel 5.19生命周期已结束，在 <a target="_blank" href="https://kernel.org" title="" rel="external nofollow">kernel.org</a> 上被标记为 EOL ，这意味着该版本不会再有任何 Bug 修复和安全补丁。建议等待Kali发布最新的内核后及时升级。</p><p>然而随着Kali系统不断升级，中途部分软件包依赖破裂，导致内核无法用正常软件宝管理工具升级的方法升级。</p>]]></description><link>https://www.wyr.me/post/728</link><guid isPermaLink="false">https://www.wyr.me/post/728</guid><dc:creator><![CDATA[轶哥]]></dc:creator><pubDate>Fri, 28 Oct 2022 16:40:31 GMT</pubDate></item><item><title><![CDATA[Office表格转HTML Table]]></title><description><![CDATA[<p>这个程序大约写于5年前，在3年前开源。这是一篇3年前就应该写的文章，一直沉睡在TODO List，由于优先级过低，竟然拖到今天才写。</p><p><img src="https://cdn.wyr.me/post-files/2022-08-22/1661179445509/office2table.png" alt="office2table.png"></p><p><strong>这个小工具诞生的原因背景：</strong></p><p>Office的Excel是目前最优秀的表格工具，Office三套件经久不衰，无疑是职场最具影响力的生产力软件。而World与Excel中的表格直接复制到网页（HTML组件）中会遗留非常多的额外标签，这些标签在浏览器中有的是无法识别的，有的是能识别但是会出现显示异常的。</p><p>在Web2.0时代，出现了“所见即所得”的HTML富文本编辑器。与此同时，Web前端飞速发展，出现了多种自适应布局方式，可以让Web页面兼容不同大小和分辨率的显示器。</p><p>由于Office新版协议采用了和HTML类似的标记语言来表达富文本内容，使得WPS等第三方Office软件得以在不破解协议的情况下修改Office文件。然而World、Excel和PowerPoint的表格内容直接复制出来粘贴到HTML富文本编辑器是可以使用的，但是多余的标签会衍生出各种问题。</p><p>这个 Office Table 转 HTML Table 就是为了解决此问题开发的<strong>纯前段处理数据</strong>的Web小程序。</p>]]></description><link>https://www.wyr.me/post/727</link><guid isPermaLink="false">https://www.wyr.me/post/727</guid><dc:creator><![CDATA[轶哥]]></dc:creator><pubDate>Mon, 22 Aug 2022 14:50:13 GMT</pubDate></item><item><title><![CDATA[实测Studio Display兼容Linux、Windows]]></title><description><![CDATA[<p>Apple Studio Display 2022款自入手以来我一直作为主显示器，合盖使用MacBook Pro。从未想过与Linux或Windows的连接。今日实测了iPad Pro、Linux、Windows与Studio Display的配套使用，发现均可正常兼容，包括摄像头、扬声器、麦克风以及下联TypeC接口，甚至也支持给设备供电，在安装了驱动的情况下还可以调节亮度。实在是既意外又惊喜！</p><p>Apple Studio Display 作为一款入门级的专业显示器，其色彩精准度不必怀疑。让我没有想到的是，在和Windows、Linux等非“门当户对”的系统搭配使用时，也能自动匹配色彩描述文件，使用非专业的色彩比对硬件发现色彩还原的准确度很高。</p>]]></description><link>https://www.wyr.me/post/726</link><guid isPermaLink="false">https://www.wyr.me/post/726</guid><dc:creator><![CDATA[轶哥]]></dc:creator><pubDate>Sat, 30 Jul 2022 05:31:15 GMT</pubDate></item><item><title><![CDATA[解决VSCode中Github登录状态无法保存的异常]]></title><description><![CDATA[<p>在MacOS Ventura 13.0 Beta版中，使用VSCode会出现Github登录状态丢失的情况，导致重启/新窗口中需要重复登录Github账号才可以同步UI以及插件等设置。</p><p>在VSCode的<code>github authentication</code>插件日志可以看到，每次启动VSCode后，都会从MacOS的<code>钥匙串访问</code>APP中获取登录信息。</p><pre><code>[Info  - 03:49:14.381] Reading sessions from keychain...</code></pre>]]></description><link>https://www.wyr.me/post/725</link><guid isPermaLink="false">https://www.wyr.me/post/725</guid><dc:creator><![CDATA[轶哥]]></dc:creator><pubDate>Mon, 25 Jul 2022 04:03:29 GMT</pubDate></item><item><title><![CDATA[在MacOS中运行Linux图形程序]]></title><description><![CDATA[<p>近期分享了《<a target="_blank" href="https://www.wyr.me/post/723" title="" rel="external">从SSH远程唤起本地浏览器打开URL</a>》，其实从远程SSH也可以直接打开带GUI的Linux应用程序的。之前分享过《<a target="_blank" href="https://www.wyr.me/post/685" title="" rel="external">Win10中通过WSL2开发基于Electron的Ubuntu应用程序</a>》，原理上其实是一样的。</p><p>都是通过安装X11服务来实现。</p><p>此方法和虚拟机以及Wine有本质区别。应用程序可以运行在远程服务器，这样是不占用系统内存和CPU的。</p><p>本文介绍的方法是<strong>从MacOS中SSH远程到服务器调试和开发Linux平台的GUI应用程序</strong>。</p><p>在MacOS中运行Linux的GUI程序需要借助开源软件<a target="_blank" href="https://www.xquartz.org" title="" rel="external nofollow">XQuartz</a>。</p>]]></description><link>https://www.wyr.me/post/724</link><guid isPermaLink="false">https://www.wyr.me/post/724</guid><dc:creator><![CDATA[轶哥]]></dc:creator><pubDate>Thu, 23 Jun 2022 05:12:23 GMT</pubDate></item><item><title><![CDATA[从SSH远程唤起本地浏览器打开URL]]></title><description><![CDATA[<p>从SSH连接的远程环境中在本地网页浏览器中打开URL，且URL是服务器的本机/内网地址。这是完全可以做到的，就像在本地进行软件开发一样。</p><p>这里介绍两种方法，一个是仅转发服务器本地端口，在本地浏览器打开运行。另一个是拦截服务器中打开浏览器相关命令，在本地浏览器中打开，且可以配合第一个方法实现本地浏览器打开服务器本地页面。</p><p>温馨提示，通过VScode的Remote-SSH插件可以像在本地开发一样编辑服务器上的代码（其它编辑器也有类似功能，例如neovim支持远程网络文件编辑），配合本文的方法可以做到本地调试服务器本地代码。</p>]]></description><link>https://www.wyr.me/post/723</link><guid isPermaLink="false">https://www.wyr.me/post/723</guid><dc:creator><![CDATA[轶哥]]></dc:creator><pubDate>Wed, 22 Jun 2022 01:48:05 GMT</pubDate></item><item><title><![CDATA[OMV5 升级 OMV6]]></title><description><![CDATA[<p>专注于NAS的系统 OMV5 (OpenMediaVault) 升级 OMV6 很容易，但是由于OMV6存在较大变化，插件亦不能完全向后兼容，因此有很多细节之处需要注意。</p><p>OMV6基于Debian 11（OpenMediaVault 6.0 Shaitan，基于 Debian 11，目前已经Stable，正式版发布于2022年5月），内核5.16+（OMV5的5.10），能很好的支持r8152/8156等2.5G网卡。</p><p>以下方法支持x86-64和ARM架构下的OMV5升级。</p>]]></description><link>https://www.wyr.me/post/722</link><guid isPermaLink="false">https://www.wyr.me/post/722</guid><dc:creator><![CDATA[轶哥]]></dc:creator><pubDate>Sun, 19 Jun 2022 07:29:40 GMT</pubDate></item><item><title><![CDATA[给运行OMV的NAS配置UPS]]></title><description><![CDATA[<p>虽然我一直忧虑UPS的安全性，但是考虑NAS的数据安全，还是非常有必要给NAS配置UPS的。</p><p>我用过各种不同型号的UPS，现在除了特别便宜的UPS不带有和上位机通讯的功能外，一般都有USB接口，主机可以获取到UPS的电压、电流、电池余量等相关信号量。</p><p>即便使用USB接口，很多UPS都是和电脑进行串口通讯的，也有不少USB HID方式通讯的。</p><p>在OpenMediaVault(OMV5)的<code>插件</code>中添加<code>openmediavault-nut</code>插件。</p>]]></description><link>https://www.wyr.me/post/721</link><guid isPermaLink="false">https://www.wyr.me/post/721</guid><dc:creator><![CDATA[轶哥]]></dc:creator><pubDate>Sat, 18 Jun 2022 15:38:20 GMT</pubDate></item><item><title><![CDATA[NAS/电脑主机风扇噪音优化]]></title><description><![CDATA[<p>我是一个对噪音非常敏感的人，即使我在家里放了一个机柜，也是全无风扇被动散热的。我通常选择低功耗的设备作为边缘服务器，同时对部分无法完全避免风扇的设备进行改造，增强设备散热的同时降低噪音。</p><p>这里记录了我优化NAS和电脑主机的噪音的方案，供有同样困扰网友作为参考。</p>]]></description><link>https://www.wyr.me/post/720</link><guid isPermaLink="false">https://www.wyr.me/post/720</guid><dc:creator><![CDATA[轶哥]]></dc:creator><pubDate>Sat, 18 Jun 2022 14:50:53 GMT</pubDate></item><item><title><![CDATA[新版本Safari无法正常访问Bilibili等网站的解决办法]]></title><description><![CDATA[<p>在更新IOS版本（Beta16+）或MacOS版本（Beta13+）后，如果开启了iCloud+，由于默认的隐私保护选项，将有可能无法正常访问包括Bilibili在内的很多网站，通常表现为<strong>能显示标题，但是页面却始终处于<code>正在加载中</code>的状态</strong>。</p><p>这是由于在新版本的Safari for IOS及Safari for macOS中，都新增了加强型的隐私保护功能——<code>隐藏IP地址</code>。</p><p>Apple对该功能的描述是：<strong>你的IP地址可用于确定你的位置等个人信息。为了保护此类信息，Safari浏览器可对已知跟踪器隐藏你的IP地址。</strong></p><p>为了节约主服务器的带宽资源同时加速页面访问，很多网站经常会使用第三方CDN来加载一些常见的静态资源，例如字体、jQuery等JavaScript库。</p><p>由于该功能的开启，访问部分可能带有跟踪器功能的CDN资源将会陷入无限等待的状态。例如<code>at.alicdn.com</code>、<code>cdn.jsdelivr.net</code>，将会一直请求但无法得到请求结果。</p><p>解决此问题的方法很简单，关闭Safari的<code>隐藏IP地址</code>功能即可。该功能对国内用户来说意义不大。</p>]]></description><link>https://www.wyr.me/post/719</link><guid isPermaLink="false">https://www.wyr.me/post/719</guid><dc:creator><![CDATA[轶哥]]></dc:creator><pubDate>Sat, 18 Jun 2022 11:41:48 GMT</pubDate></item><item><title><![CDATA[解决Ubuntu画面撕裂]]></title><description><![CDATA[<p>Ubuntu屏幕画面撕裂非常常见的问题。其实不光Ubuntu，只要是Linux系统都可能存在这个问题。以下解决方法在Debian、Linux Mint、Kali等不同发行版Linux通用。</p><p>这里顺带说明一下，Ubuntu 20.04、22.10、22.04、18.04都可能存在图像撕裂这个问题，从原理上来说，这个问题是无法通过升级系统或安装更新的驱动程序来解决的。因此解决此问题也需要根据不同情况对症下药。</p><p>画面撕裂的问题有可能跟Intel核芯显卡、Nvidia显卡、AMD显卡有关系，因此你需要先知道自己使用的设备搭载了哪款显卡。</p><p>特地说明一下，虽然画面撕裂在网页和游戏中最为明显，在视频中也会有体现，但是Chrome和Firefox并未对Linux下的N卡适配硬件加速。也就是说，网页中播放视频CPU利用率高的问题和画面撕裂是两个问题，默认从官网下载的Chrome和Firefox并不支持GPU加速。解决画面撕裂和开启N卡A卡硬解无关。</p>]]></description><link>https://www.wyr.me/post/718</link><guid isPermaLink="false">https://www.wyr.me/post/718</guid><dc:creator><![CDATA[轶哥]]></dc:creator><pubDate>Thu, 16 Jun 2022 15:11:48 GMT</pubDate></item><item><title><![CDATA[如何安装Xcode 14 Beta？]]></title><description><![CDATA[<p>Xcode的版本总是和操作系统绑定，因此升级了到MacOS 13 beta（macOS Ventura）后Xcode13将不再可用。</p><p>在安装MacOS 13 beta描述文件页面有提示：</p><blockquote><p>在运行 macOS 13 Beta 版的 Mac 上构建 app 时，需要 Xcode 14 Beta 版。要使用Xcode 13构建应用程序，您可以在Mac上创建<a target="_blank" href="https://support.apple.com/en-us/HT208891" title="" rel="external nofollow">单独的卷</a>并运行macOS 12。</p></blockquote><p>升级到MacOS 13 beta后，在应用商店是没有<code>Xcode 14 Beta</code>版本的更新提示的。只能手工下载。</p><p><strong>下载地址：</strong> <a target="_blank" href="https://developer.apple.com/download/all/" title="" rel="external nofollow">https://developer.apple.com/download/all/</a></p><p><em>需要登录Apple开发者账号。</em></p>]]></description><link>https://www.wyr.me/post/717</link><guid isPermaLink="false">https://www.wyr.me/post/717</guid><dc:creator><![CDATA[轶哥]]></dc:creator><pubDate>Mon, 13 Jun 2022 09:13:09 GMT</pubDate></item><item><title><![CDATA[Linux安装微信并设置缩放与快捷键]]></title><description><![CDATA[<p>由于没有得到官方适配，在Linux中安装微信的最佳方案是使用Wine。</p><p>借助开源项目<a target="_blank" href="https://github.com/zq1997/deepin-wine" title="" rel="external nofollow">https://github.com/zq1997/deepin-wine</a>，我们可以非常方便的在Linux中安装微信。只不过安装完成后设置缩放及绑定快捷键并非易事。特整理具体方法如下。</p><p>以下方法在Ubuntu 22.04、Ubuntu 20.04、Kali Linux 2022.2（Debian）测试通过。</p>]]></description><link>https://www.wyr.me/post/716</link><guid isPermaLink="false">https://www.wyr.me/post/716</guid><dc:creator><![CDATA[轶哥]]></dc:creator><pubDate>Sun, 12 Jun 2022 15:00:42 GMT</pubDate></item><item><title><![CDATA[iTerm2中使用vim/neovim时Alt快捷键失效的解决办法]]></title><description><![CDATA[<p>在iTerm2默认配置下，使用vim/neovim时，与Alt相关的快捷键会全部失效【操作系统是macOS Ventura 13.0 Beta版(22A5266r)】。尚不清楚更老的版本是否存在同样问题。</p><p>在vim/neovim中进入<code>:map</code>，发现快捷键绑定未现异常，检查快捷键配置lua写法也兼容当前环境并无报错。</p><p><strong>解决方法：</strong></p><p>右上角选择<code>iTerm2</code>-<code>Preferences...</code>，在打开的窗口中选择<code>Profiles</code>，选中<code>Default</code>，右边选择<code>Keys</code>-<code>General</code>。</p><p><img src="https://cdn.wyr.me/post-files/2022-06-09/1654768258361/iTerm2.png" alt="iTerm2.png"></p><p><code>Left Option Key</code> 默认是<code>Normal</code>，改为<code>Esc+</code>即可。</p>]]></description><link>https://www.wyr.me/post/715</link><guid isPermaLink="false">https://www.wyr.me/post/715</guid><dc:creator><![CDATA[轶哥]]></dc:creator><pubDate>Thu, 09 Jun 2022 09:52:59 GMT</pubDate></item><item><title><![CDATA[Xfce桌面安装AppImage应用程序图标丢失问题解决]]></title><description><![CDATA[<p>自Kali Linux2019.3起，默认的桌面环境被设置为Xfce4而不是GNOME。Kali Linux支持Xfce、GNOME、KDE、Enlightenment、i3mw、LXDE、MATE作为桌面环境。</p><p>Xfce默认的桌面环境中不包含针对<code>desktop</code>图标的处理，因此安装<code>deb</code>或者<code>AppImage</code>等应用程序后，在默认的应用程序列表/菜单栏/应用程序启动器找不到程序图标。即安装应用程序后无法生成<code>.desktop</code>的图标，并且<code>Home</code>目录中没有<code>.icons</code>文件夹。</p><p>具体表现为：安装应用程序丢失图标，无法通过应用程序启动器直接启动应用程序。</p>]]></description><link>https://www.wyr.me/post/714</link><guid isPermaLink="false">https://www.wyr.me/post/714</guid><dc:creator><![CDATA[轶哥]]></dc:creator><pubDate>Sat, 04 Jun 2022 08:15:39 GMT</pubDate></item><item><title><![CDATA[VSCode自动更换主题]]></title><description><![CDATA[<p><img src="https://cdn.wyr.me/post-files/2022-05-31/1654006879268/AutoDetectColorScheme.jpg" alt="AutoDetectColorScheme.jpg"></p><p>VSCode支持根据操作系统的夜间模式和日间模式自动切换深色主题，无需安装插件，只需要点开左下角<code>设置</code>，搜索<code>auto detect</code>选中上图所示的<code>Auto Detect Color Scheme</code>选项即可。</p><p>直接编辑<code>settings.json</code>文件亦可，添加：<code>&quot;window.autoDetectColorScheme&quot;: true,</code>即可。需要注意配置文件中不能同时存在<code>workbench.colorTheme</code>设置，否则将默认使用该值。</p><p>支持Win10、Win11、MacOS。</p>]]></description><link>https://www.wyr.me/post/713</link><guid isPermaLink="false">https://www.wyr.me/post/713</guid><dc:creator><![CDATA[轶哥]]></dc:creator><pubDate>Tue, 31 May 2022 14:35:11 GMT</pubDate></item><item><title><![CDATA[Kali Linux安装VMware Workstation 16及Win11教程]]></title><description><![CDATA[<p>在Kali Linux中安装VMware Workstation 16 Player和VMware Workstation 16 Pro的方法大体一致，与Debian的安装方法相似。在Kali Linux中安装VMware Workstation没有详细教程将会比较困难，特整理如下。</p>]]></description><link>https://www.wyr.me/post/712</link><guid isPermaLink="false">https://www.wyr.me/post/712</guid><dc:creator><![CDATA[轶哥]]></dc:creator><pubDate>Tue, 10 May 2022 06:01:07 GMT</pubDate></item><item><title><![CDATA[OpenWRT使用4G卡托拨号上网]]></title><description><![CDATA[<p>之前轶哥介绍过《<a target="_blank" href="https://www.wyr.me/post/699" title="" rel="external">OpenWRT使用4G/5G无线网卡模块上网</a>》的方法，文中对拨号上网部分描述不是很详细。本文我们就专门针对拨号上网的设置方法详细说明。</p><h1>测试环境</h1><ul><li>GL-MT300N-V2最新OpenWRT官方固件：<a target="_blank" href="https://openwrt.org/toh/hwdata/gl.inet/gl.inet_gl-mt300n_v2" title="" rel="external nofollow">https://openwrt.org/toh/hwdata/gl.inet/gl.inet_gl-mt300n_v2</a></li><li>高通05c6:6001上网卡托（中沃ZM50 USB 4G网卡，支持电信/联通 4G/3G）。</li></ul>]]></description><link>https://www.wyr.me/post/711</link><guid isPermaLink="false">https://www.wyr.me/post/711</guid><dc:creator><![CDATA[轶哥]]></dc:creator><pubDate>Mon, 09 May 2022 05:35:14 GMT</pubDate></item><item><title><![CDATA[OpenWRT配合爱快实现WAN口拓展]]></title><description><![CDATA[<p>通过网管型交换机配置VLAN和爱快搭配可以实现拓展WAN口，然而2.5G或万兆的网管型交换机价格不菲，而拓展WAN口并不需要全部口都是2.5G或者万兆，只需要出口的网卡是大速率的，就可以实现对WAN口的汇聚了。在《<a target="_blank" href="https://www.wyr.me/post/708" title="" rel="external">OpenWRT设置VLAN</a>》一文中我们提到OpenWRT可以作为网管型交换机来设置VLAN使用，也尝试进行了《<a target="_blank" href="https://www.wyr.me/post/709" title="" rel="external">OpenWRT与爱快链路聚合</a>》，这次我们尝试使用软路由安装OpenWRT配置VLAN配合爱快拓展WAN口。</p><p><img src="https://cdn.wyr.me/post-files/2022-05-02/1651475525988/%E8%BD%AF%E8%B7%AF%E7%94%B1%E6%8B%93%E6%89%91%E5%9B%BE.jpg" alt="%E8%BD%AF%E8%B7%AF%E7%94%B1%E6%8B%93%E6%89%91%E5%9B%BE.jpg"></p><p>如上图所示，我们通过OpenWRT充当网管型交换机，将3个1G口的2500M网络分配给1个2.5G网卡，将另外两个1G口的2000M网络分配给另外一个2.5G网卡。富余的一个网卡让OpenWRT在当交换机的同事作为旁路由。这样确保了每一个端口的速率都是充足的。</p>]]></description><link>https://www.wyr.me/post/710</link><guid isPermaLink="false">https://www.wyr.me/post/710</guid><dc:creator><![CDATA[轶哥]]></dc:creator><pubDate>Mon, 02 May 2022 07:57:51 GMT</pubDate></item><item><title><![CDATA[OpenWRT与爱快链路聚合]]></title><description><![CDATA[<p>轶哥在《<a target="_blank" href="https://www.wyr.me/post/708" title="" rel="external">OpenWRT设置VLAN</a>》一文中提到，很多网管型交换机价格不菲，甚至比软路由还贵。而OpenWRT是可以实现大部分网管型交换机功能的。例如<code>链路聚合</code>，可以实现和NAS做链路聚合从而实现1G+1G的2G速率或者2.5G+2.5G的5G速率的带宽叠加，也可以和爱快LAN口或WAN口做链路聚合（例如《<a target="_blank" href="https://www.wyr.me/post/710" title="" rel="external">OpenWRT配合爱快实现WAN口拓展</a>》），实现端口汇聚，有效增加链路带宽的同时，提高链路的可靠性，满足对高带宽及高可靠性的需求。</p><p>此文介绍的配置方法也适用于和爱快与网管型交换机的链路聚合。</p>]]></description><link>https://www.wyr.me/post/709</link><guid isPermaLink="false">https://www.wyr.me/post/709</guid><dc:creator><![CDATA[轶哥]]></dc:creator><pubDate>Mon, 02 May 2022 06:26:10 GMT</pubDate></item><item><title><![CDATA[OpenWRT设置VLAN]]></title><description><![CDATA[<p>2.5G的网管型交换机动辄千元，而可以安装OpenWRT的2.5g软路由却量大实惠。OpenWRT本身就可以作为网管型交换机使用，例如划分VLAN、链路聚合/端口汇聚（例如《<a target="_blank" href="https://www.wyr.me/post/709" title="" rel="external">OpenWRT与爱快链路聚合</a>》）、防火墙配置、流量统计、端口镜像都是可以的。</p><p>通过OpenWRT划分VLAN可将内部网络划分为多个局域网，满足网络资源的划分和管理需求，实现有效控制内网广播，增强网络的安全性和适应多业务。也可以轻松实现基于VLAN的多WAN口拓展，例如《<a target="_blank" href="https://www.wyr.me/post/710" title="" rel="external">OpenWRT配合爱快实现WAN口拓展</a>》。</p><p>OpenWRT设置VLAN非常简单但却没有明确的文章阐述方法。网络中的资料大都是老版本OpenWRT的配置方式，不适用于独立网络端口的x86软路由，或者就是需要复杂的命令配置。甚至有网友因此转战ROS。</p>]]></description><link>https://www.wyr.me/post/708</link><guid isPermaLink="false">https://www.wyr.me/post/708</guid><dc:creator><![CDATA[轶哥]]></dc:creator><pubDate>Mon, 02 May 2022 05:15:57 GMT</pubDate></item><item><title><![CDATA[Linux网卡优先级配置及同时访问内外网设置]]></title><description><![CDATA[<p>在Linux系统中，双网卡或多网卡上网并不会同时使用两者同时上网，只会优先把请求发送到优先级高的默认网关（对应网卡的内网网段除外）。插入多个网卡的时候，路由表中就会存在多个默认网关，访问外部网络的时候，系统根据路由原则，<code>Metric</code>值小的网卡优先级高，会优先使用该网卡上网。</p><p>在MacOS系统中，设置网卡优先级只需要在<code>系统偏好设置</code>-<code>网络</code>中设置<code>设定网卡服务顺序</code>，具体操作见《<a target="_blank" href="https://www.wyr.me/post/638" title="" rel="external">MacOS 同时使用内网和外网（双网卡同时联网）</a>》。</p><p>在Windows系统中，设置网卡优先级只需要设置网卡的<code>跃点数</code>，具体操作见《<a target="_blank" href="https://www.wyr.me/post/659" title="" rel="external">win10链路聚合，双网卡带宽叠加负载均衡</a>》（win11同理）。</p><p>而在Linux系统中，设置网卡优先级需要修改路由表配置，调整默认网关的<code>Metric</code>值。</p>]]></description><link>https://www.wyr.me/post/707</link><guid isPermaLink="false">https://www.wyr.me/post/707</guid><dc:creator><![CDATA[轶哥]]></dc:creator><pubDate>Mon, 02 May 2022 04:15:11 GMT</pubDate></item><item><title><![CDATA[Shell异步延迟执行命令]]></title><description><![CDATA[<p>在Shell脚本中，特别是Linux操作系统内置的各项启动脚本，经常会遇到需要延迟异步去执行的命令。例如在<code>/etc/rc.local</code>文件或配置网卡相关的脚本文件里面，希望对应脚本能够先返回<code>exit 0</code>以免阻塞任务，然后再异步的去执行不关注执行结果的一些命令，甚至延迟执行异步命令。</p><p>在*nux命令中，<code>命令 &amp;</code>为后台进程命令（放在命令参数最后面的<code>&amp;</code>表示设置此命令后台执行）。</p><p>因此，在Shell中，命令之后跟上<code>&amp;</code>即异步去执行该命令。</p><p><code>sleep</code>是延时命令，<code>sleep 1</code>代表将命令延迟1秒后执行。</p>]]></description><link>https://www.wyr.me/post/706</link><guid isPermaLink="false">https://www.wyr.me/post/706</guid><dc:creator><![CDATA[轶哥]]></dc:creator><pubDate>Mon, 02 May 2022 03:22:48 GMT</pubDate></item><item><title><![CDATA[OpenWRT根据网址段分配不同网关/旁路由]]></title><description><![CDATA[<p>OpenWRT默认的DHCP Server服务器是Dnsmasq，借助Dnsmasq可以实现根据网址段分配不同网关（旁路由），也可以实现根据MAC地址/IP地址分配不同网关。</p><p>换句话说，可以实现一个OpenWRT下搭配多个旁路由，方便针对不同的设备指定其实用的旁路由是哪一个。</p><blockquote><p>Dnsmasq为小型网络提供网络基础设施：DNS、DHCP、Router Advertisement 和 Network boot。它设计轻巧，资源占用少，适用于资源有限的路由器和防火墙。它还被广泛用于在智能手机和便携式热点上，并支持虚拟化框架中的虚拟网络。支持的平台包括Linux（带有glibc和uclibc）、Android、*BSD和Mac OS X。Dnsmasq包含在大多数Linux发行版以及FreeBSD、OpenBSD和NetBSD的端口系统中。Dnsmasq提供全面的IPv6支持。</p></blockquote>]]></description><link>https://www.wyr.me/post/705</link><guid isPermaLink="false">https://www.wyr.me/post/705</guid><dc:creator><![CDATA[轶哥]]></dc:creator><pubDate>Sun, 24 Apr 2022 00:10:27 GMT</pubDate></item><item><title><![CDATA[Linux 2.5G USB网卡驱动安装RTL8156/8156B]]></title><description><![CDATA[<p>近期在使用2.5G速率的USB有线网卡的时候遇到诸多问题，特整理驱动安装过程如下。</p><p>市面上常见的2.5G USB网卡通常使用RTL8156或RTL8156B芯片（例如绿联、比亚兹的2.5G有线网卡USB-A/TypeC采用的便是此芯片）。</p><p>如果在爱快或ESXI安装2.5G网卡驱动或安装的是无线网卡，请阅读相关文章：《<a target="_blank" href="https://www.wyr.me/post/662" title="" rel="external">ESXI+爱快+OpenWRT 使用2.5G USB网卡 RTL8156</a>》、《<a target="_blank" href="https://www.wyr.me/post/666" title="" rel="external">ESXi 安装USB网卡驱动</a>》、《<a target="_blank" href="https://www.wyr.me/post/623" title="" rel="external">Linux安装无线网卡驱动通用方法</a>》。</p><p>下面以OMV(OpenMediaVault)安装RTL8156/8156B芯片的2.5G USB网卡为例，即Debian平台（Ubuntu或Kali等发行版安装方法一致）。注意，OMV需要先升级到OMV6《<a target="_blank" href="https://www.wyr.me/post/722" title="" rel="external">OMV5 升级 OMV6</a>》。</p><p>Linux内核版本最好升级到5.15+。</p>]]></description><link>https://www.wyr.me/post/704</link><guid isPermaLink="false">https://www.wyr.me/post/704</guid><dc:creator><![CDATA[轶哥]]></dc:creator><pubDate>Fri, 22 Apr 2022 05:55:05 GMT</pubDate></item><item><title><![CDATA[Mac通用控制bug临时解决方案]]></title><description><![CDATA[<p><img src="https://cdn.wyr.me/post-files/2022-04-10/1649602457436/MacOS.png" alt="MacOS.png"></p><p>Mac新增加的通用控制功能非常省事方便，特别是多台Mac同时使用的时候，如同在操作同一台设备的分屏。但是通用控制毕竟是新出的功能，还不太完善，以下是我在MacOS 12.4 Beta版本(21F5048e)遇到的两个问题及临时的解决办法。</p>]]></description><link>https://www.wyr.me/post/703</link><guid isPermaLink="false">https://www.wyr.me/post/703</guid><dc:creator><![CDATA[轶哥]]></dc:creator><pubDate>Sun, 10 Apr 2022 15:19:52 GMT</pubDate></item><item><title><![CDATA[为Linux启用人脸识别登录/授权]]></title><description><![CDATA[<p>现在新购买默认搭载Windows系统的电脑一般都会提供一个<code>Windows Hello</code>身份认证方案，例如指纹或者人脸识别。Howdy是一个在Linux上模仿Windows Hello的程序，可以实现在<code>系统用户登录</code>、<code>锁屏登录</code>、<code>sudo</code>、<code> su</code>等身份认证时候使用人脸识别。</p><p>Howdy开源地址：<a target="_blank" href="https://github.com/boltgolt/howdy" title="" rel="external nofollow">https://github.com/boltgolt/howdy</a></p><p>Howdy程序本身的使用方法官方已经已经非常详细了，在此仅做补充。</p><p>除了说明提到的<code>Ubuntu or Linux Mint</code>、<code>Debian</code>、<code>Arch Linux</code>、<code>Fedora</code>、<code>openSUSE</code>这些Linux发行版之外，基于这些系统的一系列发行版系统都是可以用的。例如<code>Raspberry Pi OS</code>、<code>Kali</code>。</p><p>支持<code>Windows Hello</code>的笔记本电脑配有红外摄像头和红外光线发射器。红外网络摄像头通常可以在Linux上自动检测到，但默认情况下，红外光线发射器不起作用。为了使它们工作，请安装和配置<a target="_blank" href="https://github.com/EmixamPP/linux-enable-ir-emitter" title="" rel="external nofollow">linux-enable-ir-emitter</a>。</p>]]></description><link>https://www.wyr.me/post/702</link><guid isPermaLink="false">https://www.wyr.me/post/702</guid><dc:creator><![CDATA[轶哥]]></dc:creator><pubDate>Wed, 06 Apr 2022 14:11:48 GMT</pubDate></item><item><title><![CDATA[Win11 多用户同时登录远程桌面配置方法]]></title><description><![CDATA[<p>Windows server系列系统是支持多用户同时连接远程桌面独立使用互不影响的，但是常规版本并未直接支持。如果您使用Windows Vista、Windows 7/8/8.1/10的配置参考：<a target="_blank" href="https://github.com/stascorp/rdpwrap" title="" rel="external nofollow">https://github.com/stascorp/rdpwrap</a>。<strong>win11中无需安装此软件。</strong></p><p>在Win11中配置多用户同时登陆远程桌面（并发远程桌面RDP）之前，请先确保已开启远程桌面并单用户访问运行正常。</p><p>需要<strong>注意</strong>的是，除非手动修改，否则在Win11的<code>设置</code>-<code>账户</code>-<code>家庭和其他用户</code>中添加<code>其他用户</code>默认添加的是<code>Microsoft用户</code>而不是<code>本地用户</code>，添加用户后还需要在<code>设置</code>-<code>系统</code>-<code>远程桌面</code>-<code>远程桌面用户</code>中添加新配置的用户，操作完成后，还必须使用真实显示器本地登录一次<code>Microsoft用户</code>才能将此用户用于远程桌面访问（首次登录需要配置用户信息），否则将提示<code>无法使用此凭据</code>，类似于密码错误的提示。需要通过管理登录并关闭<code>为了提高安全性，仅允许对此设备上的Microsoft账户使用Windows Hello登录</code>，否则可能导致部分场景下无法使用<code>Microsoft用户</code>进行远程登录。</p>]]></description><link>https://www.wyr.me/post/701</link><guid isPermaLink="false">https://www.wyr.me/post/701</guid><dc:creator><![CDATA[轶哥]]></dc:creator><pubDate>Wed, 06 Apr 2022 10:23:37 GMT</pubDate></item><item><title><![CDATA[Powershell7 中文乱码问题解决]]></title><description><![CDATA[<p>修改<code>$Profile</code>文件(<code>notepad.exe $Profile</code>)，添加</p><pre><code class="language-bash">$OutputEncoding = [console]::InputEncoding = [console]::OutputEncoding = New-Object System.Text.UTF8Encoding</code></pre><p>说明：上述操作修改了输出编码为<code>UTF-8</code>，兼容了大部分的程序输出的中文。</p>]]></description><link>https://www.wyr.me/post/700</link><guid isPermaLink="false">https://www.wyr.me/post/700</guid><dc:creator><![CDATA[轶哥]]></dc:creator><pubDate>Wed, 06 Apr 2022 09:14:02 GMT</pubDate></item><item><title><![CDATA[OpenWRT使用4G/5G无线网卡模块上网]]></title><description><![CDATA[<p>由于无线上网卡驱动的完善，随着内核的更新大部分的4G/5G无线网卡得到免驱支持。</p><p>OpenWRT社区包含了大量的无线网卡驱动，其中不乏4G/5G模块，现如今市面上常见的模块型号都得到了支持。</p><p>如果在其它Linux发行版使用4G/5G模块，请参考<a target="_blank" href="https://www.wyr.me/post/656" title="" rel="external">《Linux使用4G/5G无线网卡模块上网》</a>。</p>]]></description><link>https://www.wyr.me/post/699</link><guid isPermaLink="false">https://www.wyr.me/post/699</guid><dc:creator><![CDATA[轶哥]]></dc:creator><pubDate>Sun, 27 Mar 2022 12:46:19 GMT</pubDate></item><item><title><![CDATA[CentOS 8 升级 RHEL 8]]></title><description><![CDATA[<p>由于RedHat停止了CentOS8的支持，同时RedHat允许开发者注册16个正版RHEL系统，我决定将部分 CentOS 8 服务器更新到 RHEL 8。以下两篇文章是官方发布的与之密切相关的内容：</p><p><a target="_blank" href="https://blog.centos.org/2020/12/future-is-centos-stream/" title="" rel="external nofollow">CentOS Project shifts focus to CentOS Stream</a></p><p><a target="_blank" href="https://www.redhat.com/en/blog/new-year-new-red-hat-enterprise-linux-programs-easier-ways-access-rhel" title="" rel="external nofollow">New Year, new Red Hat Enterprise Linux programs: Easier ways to access RHEL</a></p><p>注意，因参考本文操作导致的任何损失与鄙人无关，专业用户请直接访问官方升级说明（请注意官方源无法使用，因此部分sed命令需要修改）：<a target="_blank" href="https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/8/html-single/converting_from_an_rpm-based_linux_distribution_to_rhel/index" title="" rel="external nofollow">https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/8/html-single/converting_from_an_rpm-based_linux_distribution_to_rhel/index</a> 。</p><h1>关于为什么不选择升级至CentOS Stream？</h1><p>一直以来我的客户都在使用正版RHEL系统，购买了即时的订阅，只有部分预算有限的客户使用了CentOS系统，但无论如何他们对于安全、稳定性或技术支持即时性的要求都很高。</p><p>能够得到官方的技术支持是我们更加看重的。</p><p>目前不支持从CentOS Stream转换/升级到RHEL8，不排除将来也不支持，如果后续有升级需求将不得不重装系统。同理，已经升级到<code>CentOS Stream</code>的用户就别折腾了，必须重装。（只是因为更新到vault源更新过软件，<code>cat /etc/system-release</code>却得到<code>CentOS Stream release 8</code>，说明实际已经升级到CentOS Stream了，是不可以升级到RHEL 8的。）</p>]]></description><link>https://www.wyr.me/post/698</link><guid isPermaLink="false">https://www.wyr.me/post/698</guid><dc:creator><![CDATA[轶哥]]></dc:creator><pubDate>Sun, 20 Mar 2022 14:00:48 GMT</pubDate></item><item><title><![CDATA[MySQL导入数据库中文乱码问题解决]]></title><description><![CDATA[<p>温馨提示：如果需要迁移大量数据，一定要使用专业工具并请专业的公司提供技术支持，同时做好迁移审计工作。以下方案仅供参考。</p><p>MySQL导入数据库导致中文乱码属于常见问题。一般用客户端工具导入不容易出现此问题，但是有点大又不是特别大（10G-100G）的数据通过命令导入就比较容易遇到这个问题。而网上的答案几乎都是经验性的结论，答主大多知其然不知其所以然。</p><p>注：命令导入，即<code>source xxx.sql</code>。</p>]]></description><link>https://www.wyr.me/post/697</link><guid isPermaLink="false">https://www.wyr.me/post/697</guid><dc:creator><![CDATA[轶哥]]></dc:creator><pubDate>Wed, 23 Feb 2022 12:55:58 GMT</pubDate></item><item><title><![CDATA[MySQL批量重命名表名和列名]]></title><description><![CDATA[<p>MySQL批量重命名表名和列名，修改表名为大驼峰，列名为小驼峰。</p><p>最近公司项目重构，为了适应<a target="_blank" href="https://www.prisma.io/docs/guides/migrate-to-prisma/migrate-from-sequelize#25-adjust-the-prisma-schema-optional" title="" rel="external nofollow">Prisma的习惯</a>，保持数据库字段命名方式和代码模式一致，特地编写此脚本实现批量重命名已存在的表名和列名。</p>]]></description><link>https://www.wyr.me/post/696</link><guid isPermaLink="false">https://www.wyr.me/post/696</guid><dc:creator><![CDATA[轶哥]]></dc:creator><pubDate>Wed, 23 Feb 2022 12:16:12 GMT</pubDate></item><item><title><![CDATA[联发科芯片手机刷入Magisk boot教程（解决无限重启）]]></title><description><![CDATA[<p>红米K30至尊纪念版（天玑1000）刷最新版MIUI13内测版（cezanne 22.2.18）后不能root，magisk刷了后root拿不到，官方root提示：“很抱歉，当前版本暂不支持开启root权限，可能是root包未准备好或该版本已撤包”。Recovery也自动恢复成小米官方版本了。</p><p>安装Magisk Manager APP后提示提示<code>Ramdisk</code>为&quot;是&quot;，但是无法正常授权，拿不到Root权限。点击安装后提示“选择并修补一个文件”。</p><p>以下为解决方法联发科芯片手机刷入Magisk boot解决方案。</p>]]></description><link>https://www.wyr.me/post/695</link><guid isPermaLink="false">https://www.wyr.me/post/695</guid><dc:creator><![CDATA[轶哥]]></dc:creator><pubDate>Tue, 22 Feb 2022 09:28:12 GMT</pubDate></item><item><title><![CDATA[Auto.js 小米MIUI自动解锁屏幕脚本]]></title><description><![CDATA[<p>使用Auto.js解锁MIUI13的密码锁屏，不能直接滑动屏幕，会因为防误触功能导致解锁失败，关闭防误触也没用。只需要滑动的时候不那么直接即可。</p><pre><code class="language-javascript">if (!device.isScreenOn()) {        //从息屏状态  将屏幕唤醒    device.wakeUp()//唤醒设备    sleep(2000) // 等待屏幕亮起    swipe(random(device.width / 3, device.width / 2), random(device.height * 8 / 10, device.height * 7 / 10), random(device.width / 3, device.width / 2), random(device.height * 2 / 10, device.height / 10), random(500, 1000))    sleep(1000)    //解锁    desc(1).findOne().click()    desc(2).findOne().click()    desc(3).findOne().click()    desc(4).findOne().click()}</code></pre><p>通过下拉再点击时间的方式在MIUI13行不通了，但实现也不复杂，核心实现是上述第四行代码。</p>]]></description><link>https://www.wyr.me/post/694</link><guid isPermaLink="false">https://www.wyr.me/post/694</guid><dc:creator><![CDATA[轶哥]]></dc:creator><pubDate>Mon, 21 Feb 2022 14:53:16 GMT</pubDate></item><item><title><![CDATA[Win11设置IPv4优先]]></title><description><![CDATA[<p>在IPv6正常工作的情况下，访问部分IPv6网站异常的情况下，可以考虑设置IPv4优先，因为纯IPv6的网站非常罕见，通常网站都是配置双栈的。</p><p>设置IPv4优先并不会影响基于RTC或P2P（点对点）的IPv6通讯，直接访问IPv6或只支持IPv6的网站也是没问题的。</p>]]></description><link>https://www.wyr.me/post/693</link><guid isPermaLink="false">https://www.wyr.me/post/693</guid><dc:creator><![CDATA[轶哥]]></dc:creator><pubDate>Wed, 16 Feb 2022 14:11:18 GMT</pubDate></item><item><title><![CDATA[MacOS 12.3 无法正常使用code命令的解决方法]]></title><description><![CDATA[<p><del>从MacOS 12.3 Beta版本开始，系统将不再内置python2且将无法正常安装python2，无论是intel芯片还是Apple芯片的设备都无法安装。原因是<code>/usr/bin/python</code>的软链接无法正常被删除或覆盖。并且默认不开启python3命令。</del></p><p><strong>2022年04月17日14:58:00更新：</strong> 从MacOS 12.4 Beta版(21F5048e) 开始，可以通过<code>pyenv</code>在intel和Apple芯片中安装python2。详细方法见<a target="_blank" href="https://www.wyr.me/post/658" title="" rel="external">《brew安装python2》</a>。</p><p>因此可能会导致一系列依赖<code>python</code>命令的应用程序无法运行。</p><p>例如将会遇到VS(Visual Studio Code)无法使用<code>code</code>命令。</p><pre><code class="language-bash">➜  saas-web git:(892f9ef) ✗ code ./usr/local/bin/code: line 6: python: command not found/usr/local/bin/code: line 10: ./MacOS/Electron: No such file or directory</code></pre><p>由此也可能导致<code>&quot;Visual Studio Code - Insiders&quot; needs to be updated on macOS Monterey</code>弹窗的问题。</p>]]></description><link>https://www.wyr.me/post/692</link><guid isPermaLink="false">https://www.wyr.me/post/692</guid><dc:creator><![CDATA[轶哥]]></dc:creator><pubDate>Thu, 03 Feb 2022 15:32:40 GMT</pubDate></item><item><title><![CDATA[SSL证书过期监测]]></title><description><![CDATA[<p>部分程序配置了<a target="_blank" href="https://www.wyr.me/post/616" title="" rel="external">免费 SSL 证书更新程序</a>，但是更新程序更新证书失败并不会通知到管理员，可能导致业务异常。通过针对域名的 SSL 证书过期监测小程序，作为二道防火墙，避免事故发生。</p><h2>需求</h2><ol><li>以 cron 风格定时监测 SSL 证书过期和可用状态。</li><li>提前 2 天发送短信通知管理员（需要支持多手机号）。</li><li>可以在线维护通知列表（<code>域名</code>+<code>手机号</code>）。</li><li>程序要尽量简单，尽量降低后续维护成本。</li><li>开发要尽可能快。</li></ol>]]></description><link>https://www.wyr.me/post/691</link><guid isPermaLink="false">https://www.wyr.me/post/691</guid><dc:creator><![CDATA[轶哥]]></dc:creator><pubDate>Fri, 28 Jan 2022 15:46:00 GMT</pubDate></item><item><title><![CDATA[Win11设置默认浏览器的方法]]></title><description><![CDATA[<p>在win11正式版中，设置默认浏览器的方法被微软修改了，更加精细，以至于一开始我竟没有找到在哪里设置。</p><p>以前在win10中，设置默认浏览器只需要进入<code>设置</code>-<code>应用</code>-<code>默认应用</code>，对<code>Web浏览器</code>进行选择即可调整默认应用程序。但是在win11中居然开了个倒车，没有提供这样的默认选项，取而代之的是精细化的默认应用设置。</p><p>虽然精细化的设置能够最大程度的把管理权交给用户，但是win10的快捷设置方式也不失为一个值得保留的选项。两者完全可以共存。摒弃简单方案提高了用户切换默认浏览器的难度，在第一次启动Edge的时候不小心点了介绍界面的<code>确定</code>按钮，win11就把默认浏览器设置一键为Edge了，还不晓得杂个改回去，就这实在是有点流氓。</p>]]></description><link>https://www.wyr.me/post/690</link><guid isPermaLink="false">https://www.wyr.me/post/690</guid><dc:creator><![CDATA[轶哥]]></dc:creator><pubDate>Sat, 09 Oct 2021 10:31:18 GMT</pubDate></item><item><title><![CDATA[Win11正式版升级安装Docker(基于WSL2)]]></title><description><![CDATA[<p>微软于今日（2021年10月05日）发布了正式版win11。访问<a target="_blank" href="https://www.microsoft.com/zh-cn/software-download/windows11" title="" rel="external nofollow">Windows 11 安装助手</a>即可下载安装。下载和前期安装过程不会影响系统正常使用，最后的重启安装的过程大概耗时20分钟，和普通更新感觉耗时差不多。</p><h1>问题描述</h1><p>从Win10升级到Win11后，当计算机第一次启动时（以及之后的每次），Docker Desktop 将无法启动。Docker  Desktop 在 Windows 更新之前运行良好。</p><p>每次重新启动计算机或尝试手动启动 Docker Desktop 时，都会出现此问题。</p><p>安装win11后Docker运行报错，主要报错内容是<code>Microsoft .NET Framework</code>无法连接xxx，其实就是无法连接到wsl2。</p><p>根据Docker官方说明，需要升级到最新的<code>wsl2内核</code>和<a target="_blank" href="https://www.docker.com/products/docker-desktop" title="" rel="external nofollow">Docker Desktop</a>。</p>]]></description><link>https://www.wyr.me/post/689</link><guid isPermaLink="false">https://www.wyr.me/post/689</guid><dc:creator><![CDATA[轶哥]]></dc:creator><pubDate>Tue, 05 Oct 2021 14:13:27 GMT</pubDate></item><item><title><![CDATA[苹果磁吸充电宝并不是智商税]]></title><description><![CDATA[<p><img src="https://store.storeimages.cdn-apple.com/8756/as-images.apple.com/is/MJWY3_AV4?wid=1144&hei=1144&fmt=jpeg&qlt=80&.v=1631213468000" alt="MagSafe 外接电池"></p><p>2021年7月14日凌晨，苹果官网上线新款MagSafe外接电池。官网原价749元。</p><p>此消息一出，立刻有不少网友吐槽：“祖传5V 1A充电宝，屁大点容量卖那么贵，完全是智商税”。</p><p>然而事实并非如此，苹果磁吸充电宝实则是一个设计上非常优秀的产品。</p><p>首先，苹果将此充电宝称为“MagSafe外接电池”，这就说明此产品并非简单的无线移动电源。既然是备用电池，那么就不只是没电的时候用来给手机充电的产品了，这是苹果<code>Smart Battery Case</code>产品线的替代品。</p><p><img src="https://store.storeimages.cdn-apple.com/8756/as-images.apple.com/is/MN012_AV1_GOLD?wid=1144&hei=1144&fmt=jpeg&qlt=80&.v=1497909275627" alt="Smart Battery Case"></p><p>早在2015年，Apple公司就推出了Smart Battery Case（智能电池壳）产品。我们都知道苹果公司很大的优势在于强大的软硬件整合能力，苹果公司借助自身对软件的定制化能力去完善硬件体验。用户使用Smart Battery Case的时候，iPhone 的锁定屏幕和通知中心会智能显示电池状态，它还可以实现在手机充电的同时，交叉为保护壳充电。这是第三方保护壳或者充电宝无法实现的。</p><p>在MagSafe外接电池产品的设计上，苹果也采用了类似的方案。通过苹果私有的通讯协议和IOS系统进行通讯，iPhone中可以查看MagSafe外接电池的电量，同时在充电的时候iPhone会自动控制什么时候充手机什么时候充MagSafe外接电池。</p>]]></description><link>https://www.wyr.me/post/688</link><guid isPermaLink="false">https://www.wyr.me/post/688</guid><dc:creator><![CDATA[轶哥]]></dc:creator><pubDate>Thu, 30 Sep 2021 06:00:00 GMT</pubDate></item><item><title><![CDATA[Linux/Win/OMV5 安装WebDAV服务]]></title><description><![CDATA[<p><strong>此安装方法通用于所有*unix系统、Windows系统。</strong></p><p>在OMV5（<a target="_blank" href="https://www.openmediavault.org/" title="" rel="external nofollow">openmediavault</a>）中安装WebDAV服务器端的方法不同于旧版本。在OMV5之前的版本，可以直接在管理界面的“插件”中安装并启用WebDAV服务，但是新版本去除了此插件，需要手工进行安装。目前相关资料较为匮乏，网上的WebDAV镜像质量也参差不齐。</p><p>通过对比目前较为受欢迎的WebDAV服务器端软件，<a target="_blank" href="https://github.com/hacdias/webdav" title="" rel="external nofollow">https://github.com/hacdias/webdav</a> 较为稳定（唯一遗憾的是，此仓库作者提供的Docker镜像竟然在Docker Hub中排名非常靠后，以至于完全搜不到）。</p><p>此开源项目是使用GoLang开发的，因此兼容性非常强悍，仅作者预编译针对不同操作系统和CPU架构的二进制文件就有34种，可以说涵盖了几乎所有运行环境。</p><p>作者默认使用此软件的都是专业选手，因此没有手把手的文档可以参考。这对于非程序员甚至非GoLang程序员不太友好。</p>]]></description><link>https://www.wyr.me/post/687</link><guid isPermaLink="false">https://www.wyr.me/post/687</guid><dc:creator><![CDATA[轶哥]]></dc:creator><pubDate>Sun, 08 Aug 2021 16:21:27 GMT</pubDate></item><item><title><![CDATA[关于JavaScript作用域与函数提升的一道思考题]]></title><description><![CDATA[<p>在某个JavaScript前端群里面，网友<code>深圳-resolve</code>发的一道<code>关于JavaScript作用域与函数提升</code>的思考题引发了众位大佬的讨论。</p><h1>题目</h1><pre><code class="language-javascript">console.log(a)if (true) {    a = 2    function a () {}    a = 3    console.log(&#39;内部&#39;, a)}console.log(&#39;外部&#39;, a)</code></pre><p>执行结果：</p><p><img src="https://cdn.wyr.me/post-files/2021-05-11/1620754626877/image.png" alt="image.png"></p><p>打印<code>a</code>在所有位置的值：</p><p><img src="https://cdn.wyr.me/post-files/2021-05-11/1620754626907/image.png" alt="image.png"></p>]]></description><link>https://www.wyr.me/post/686</link><guid isPermaLink="false">https://www.wyr.me/post/686</guid><dc:creator><![CDATA[轶哥]]></dc:creator><pubDate>Tue, 11 May 2021 17:37:23 GMT</pubDate></item><item><title><![CDATA[Win10中通过WSL2开发基于Electron的Ubuntu应用程序]]></title><description><![CDATA[<p>本文将介绍如何在Windows 10操作系统中借助WSL2开发基于Electron的Ubuntu窗口应用程序，可以实现在win10中编写代码并查看linux应用的运行效果。</p><p>借助此方法，仅需一台MacOS设备和一台Win10的设备，即可通过Electron开发和测试主流操作系统（Windows、Linux、MacOS）下桌面应用程序并可以有差异化的调用操作系统的原生API。</p><p>通过MacOS系统可以编译几乎所有平台的应用程序，例如可以在MacOS中编译<code>Win10 x64</code>、<code>Linux ARM64</code>等平台的应用程序。但是在<code>win10</code>或<code>ubuntu</code>中无法编译<code>MacOS应用程序</code>（可以借助虚拟机或者带有MacOS系统的Docker镜像实现MacOS平台应用程序的编译，但是可能无法正常进行签名）。关于Electron自动编译及自动更新、分发，可以参阅<a target="_blank" href="https://www.wyr.me/post/675" title="" rel="external">此视频教程</a>。</p>]]></description><link>https://www.wyr.me/post/685</link><guid isPermaLink="false">https://www.wyr.me/post/685</guid><dc:creator><![CDATA[轶哥]]></dc:creator><pubDate>Sun, 11 Apr 2021 15:12:18 GMT</pubDate></item><item><title><![CDATA[自助设备广告屏自动播放视频功能实现]]></title><description><![CDATA[<p>接到一个需求，基于Electron开发Windows下的自助设备广告屏（上屏）自动播放视频的功能。设备下屏是带触控功能的屏幕，可以进行业务咨询、业务办理、视频咨询，上屏是不带触控功能的1080P屏幕。</p><p><img src="https://cdn.wyr.me/post-files/2021-04-06/1617704261360/%E8%87%AA%E5%8A%A9%E8%AE%BE%E5%A4%87.jpg" alt="%E8%87%AA%E5%8A%A9%E8%AE%BE%E5%A4%87.jpg">两个屏幕接入了同一个主机，下屏是主屏幕，上屏是分屏（扩展屏）。为了避免下屏进行视频咨询的时候，上屏播放视频的声音影响到对话，因此上屏播放视频功能需要开放相应的API接口，在下屏播放视频或进行音视频咨询的时候，相关的开发者能够通过API对上屏视频禁音。</p><p>由于我们已经开发了Android平台的同款设备，因此Electron平台需要和Android平台保持一致的API。</p>]]></description><link>https://www.wyr.me/post/684</link><guid isPermaLink="false">https://www.wyr.me/post/684</guid><dc:creator><![CDATA[轶哥]]></dc:creator><pubDate>Tue, 06 Apr 2021 10:28:01 GMT</pubDate></item><item><title><![CDATA[记一次Intel AX201网卡卡顿问题解决]]></title><description><![CDATA[<p>使用一台全新的<code>联想yoga14s</code>（intel版）设备连接了<code>wifi6</code>网络，在安装Symless（一款多设备协同软件）后，发现鼠标移动卡顿，<code>ping</code>内网网关，发现延迟高达<code>60ms</code>，还伴随有断流现象。出现高延迟、断流的同时，蓝牙也会变得卡顿，断开无线网络后，蓝牙功能恢复正常。</p><p>网卡设备工作在160MHZ，显示协商网速在1200M附近。使用MacBook和IOS、Android设备测试到网关的延迟是正常的，说明路由器在工作。</p>]]></description><link>https://www.wyr.me/post/683</link><guid isPermaLink="false">https://www.wyr.me/post/683</guid><dc:creator><![CDATA[轶哥]]></dc:creator><pubDate>Mon, 05 Apr 2021 14:54:38 GMT</pubDate></item><item><title><![CDATA[win10共享文件无法访问，保存了错误密码]]></title><description><![CDATA[<p>在win10中，访问<code>网络</code>中的计算机共享文件，有些计算机配置需要使用账户和密码才能访问其共享的文件。</p><p><img src="https://cdn.wyr.me/post-files/2021-03-28/1616945320502/image.png" alt="image.png"></p><p>然而，如果勾选了<code>记住我的凭据</code>，但是记住了一个错误的凭据（特别是当这个凭据用户名为<code>guest</code>或者某个被禁用的用户）。那么将会出现下面的报错，无法进入共享文件夹且无法切换用户。</p><p><img src="https://cdn.wyr.me/post-files/2021-03-28/1616945320517/image.png" alt="image.png"><strong>报错内容：</strong> \DESKTOP-XX 无法访问。你可能没有权限使用网络资源。请与这台服务器的管理员联系以查明你是否有访问权限。此用户无法登录，因为该帐户当前已被禁用。</p><p><strong>解决此问题需要删除在系统中已保存的有异常的用户信息。</strong></p>]]></description><link>https://www.wyr.me/post/682</link><guid isPermaLink="false">https://www.wyr.me/post/682</guid><dc:creator><![CDATA[轶哥]]></dc:creator><pubDate>Sun, 28 Mar 2021 15:32:44 GMT</pubDate></item><item><title><![CDATA[Apple M1 编译原生Electron应用程序]]></title><description><![CDATA[<p>Apple Silicon M1芯片可谓是性能爆炸，开发体验极佳，生态中适配速度也算得上势如破竹。借助Rosetta 2平稳过渡ARM64，实在是高明。在MacOS 11+系统中通过 Apple M1 编译原生M1 Electron应用程序也算得上轻松容易。</p><p>理论兼容M1芯片的Electron版本是<code>11.2.3</code>，实测兼容较好的版本是<code>13.0.0-beta.5+</code>。</p><p><a target="_blank" href="https://github.com/electron-userland/electron-builder" title="" rel="external nofollow">electron-builder</a>需升级至<code>20.10+</code>，建议版本<code>22.10.5+</code>。</p><p>本地<code>Node.js</code>版本请安装<code>v15.5.0+</code>。</p><p>MacOS建议升级到<code>11.2.3+</code>。</p><p>通过<code>electron-builder</code>编译Electron ARM64应用程序，需调整<code>package.json</code>配置文件。</p>]]></description><link>https://www.wyr.me/post/681</link><guid isPermaLink="false">https://www.wyr.me/post/681</guid><dc:creator><![CDATA[轶哥]]></dc:creator><pubDate>Thu, 18 Mar 2021 02:48:56 GMT</pubDate></item><item><title><![CDATA[Electron 12+ 出现 require is not defined 报错解决]]></title><description><![CDATA[<p>在 Electron 12 及更高版本，设置了<code>nodeIntegration: true</code>及<code>nodeIntegrationInWorker: true</code>、<code>nodeIntegrationInSubframes: true</code>，渲染进程仍然可能出现<code>require is not defined</code>的报错。</p><p>这个报错还跟随有<code>module is not defined</code>或<code>exports is not defined</code>。</p><p>同样的报错在Electron 5+曾出现过，原因是发布<code>v5.0.0</code>的时候，官方将<code>nodeIntegration</code>默认值设置为了<code>false</code>（与此同时还将<code>webviewTag</code>设置为了<code>false</code>）。</p><p>近期，Electron 12.0.0 发布。修复了诸多异常。同时也将<code>contextIsolation</code>的默认值更改为<code>true</code>（详见：<a target="_blank" href="https://github.com/electron/electron/pull/27949" title="" rel="external nofollow">https://github.com/electron/electron/pull/27949</a>）。</p>]]></description><link>https://www.wyr.me/post/680</link><guid isPermaLink="false">https://www.wyr.me/post/680</guid><dc:creator><![CDATA[轶哥]]></dc:creator><pubDate>Thu, 18 Mar 2021 01:44:46 GMT</pubDate></item><item><title><![CDATA[CentOS8卸载podman安装docker]]></title><description><![CDATA[<p>由于CentOS8默认安装了podman，因此在CentOS8中安装docker会导致冲突引发如下异常。</p><pre><code class="language-bash">Error:  Problem 1: problem with installed package podman-2.0.5-5.module_el8.3.0+512+b3b58dca.x86_64  - package podman-2.0.5-5.module_el8.3.0+512+b3b58dca.x86_64 requires runc &gt;= 1.0.0-57, but none of the providers can be installed  - package containerd.io-1.4.3-3.1.el8.x86_64 conflicts with runc provided by runc-1.0.0-68.rc92.module_el8.3.0+475+c50ce30b.x86_64  - package containerd.io-1.4.3-3.1.el8.x86_64 obsoletes runc provided by runc-1.0.0-68.rc92.module_el8.3.0+475+c50ce30b.x86_64  - cannot install the best candidate for the job  - package runc-1.0.0-64.rc10.module_el8.3.0+479+69e2ae26.x86_64 is filtered out by modular filtering Problem 2: problem with installed package buildah-1.15.1-2.module_el8.3.0+475+c50ce30b.x86_64  - package buildah-1.15.1-2.module_el8.3.0+475+c50ce30b.x86_64 requires runc &gt;= 1.0.0-26, but none of the providers can be installed  - package docker-ce-3:20.10.1-3.el8.x86_64 requires containerd.io &gt;= 1.4.1, but none of the providers can be installed  - package containerd.io-1.4.3-3.1.el8.x86_64 conflicts with runc provided by runc-1.0.0-68.rc92.module_el8.3.0+475+c50ce30b.x86_64  - package containerd.io-1.4.3-3.1.el8.x86_64 obsoletes runc provided by runc-1.0.0-68.rc92.module_el8.3.0+475+c50ce30b.x86_64  - package containerd.io-1.4.1-3.1.el8.x86_64 conflicts with runc provided by runc-1.0.0-68.rc92.module_el8.3.0+475+c50ce30b.x86_64  - package containerd.io-1.4.1-3.1.el8.x86_64 obsoletes runc provided by runc-1.0.0-68.rc92.module_el8.3.0+475+c50ce30b.x86_64  - package containerd.io-1.4.3-3.el8.x86_64 conflicts with runc provided by runc-1.0.0-68.rc92.module_el8.3.0+475+c50ce30b.x86_64  - package containerd.io-1.4.3-3.el8.x86_64 obsoletes runc provided by runc-1.0.0-68.rc92.module_el8.3.0+475+c50ce30b.x86_64  - cannot install the best candidate for the job  - package runc-1.0.0-56.rc5.dev.git2abd837.module_el8.3.0+569+1bada2e4.x86_64 is filtered out by modular filtering  - package runc-1.0.0-64.rc10.module_el8.3.0+479+69e2ae26.x86_64 is filtered out by modular filtering</code></pre><p>在部分场景中却不得不使用docker，因为podman是新东西，即便命令和docker及其相似，也因为生态原因，各类API还无法完全兼容。例如《<a target="_blank" href="https://www.wyr.me/post/675" title="" rel="external">【视频教程】Electron自动编译及自动更新、分发</a>》就对这个情况进行过说明，在使用<a target="_blank" href="https://www.wyr.me/post/611" title="" rel="external">Electron 应用分发系统</a>的时候，由于使用了开源项目<a target="_blank" href="https://github.com/apocas/dockerode" title="" rel="external nofollow">dockerode</a>对docker进行控制，因此需要卸载<code>podman</code>改用<code>docker</code>。</p>]]></description><link>https://www.wyr.me/post/679</link><guid isPermaLink="false">https://www.wyr.me/post/679</guid><dc:creator><![CDATA[轶哥]]></dc:creator><pubDate>Sun, 14 Mar 2021 13:40:43 GMT</pubDate></item><item><title><![CDATA[ubuntu 20.04 安装 pip2]]></title><description><![CDATA[<p>在ubuntu 20.04 LTS版本中，可以通过<code>sudo apt install python</code>安装python2，但是无法通过<code>sudo apt install python-pip</code>安装pip2，提示<code>E: Unable to locate package python-pip</code>。</p><p>无法找到python-pip安装包的原因是，Python 2.7的支持周期已于2020年1月1日结束。因为不再维护Python 2.7，pip 21.0已于2021年1月停止对Python 2.7的支持。</p><p>如果通过<code>pypa.io</code>的默认<code>get-pip.py</code>脚本进行安装，也将遇到<code>This script does not work on Python 2.7 The minimum supported Python version is 3.6.</code>提示。</p>]]></description><link>https://www.wyr.me/post/678</link><guid isPermaLink="false">https://www.wyr.me/post/678</guid><dc:creator><![CDATA[轶哥]]></dc:creator><pubDate>Sun, 14 Mar 2021 09:34:03 GMT</pubDate></item><item><title><![CDATA[SR300 F200 开启 Windows Hello 人脸登录]]></title><description><![CDATA[<p>Intel RealSense SR300 F200 Windows10 开启 Windows Hello 人脸，可以实现人脸识别登录。速度很快，安全性很高。</p><p><img src="https://cdn.wyr.me/post-files/2021-03-14/161570933302916157092371543d.JPG" alt="3d.JPG"></p><p>笔者有幸参与了第一批Intel RealSence设备的开发，至今家里还有不少F200、SR300的开发版本的设备。</p>]]></description><link>https://www.wyr.me/post/677</link><guid isPermaLink="false">https://www.wyr.me/post/677</guid><dc:creator><![CDATA[轶哥]]></dc:creator><pubDate>Sun, 14 Mar 2021 08:27:28 GMT</pubDate></item><item><title><![CDATA[OpenWRT 设置桥接交换机模式（AP模式）]]></title><description><![CDATA[<p>OpenWRT / LEDE 设置桥接模式作为交换机，能够将路由器当无线AP使，同时有线网口作为交换机使用。</p><p><img src="https://cdn.wyr.me/post-files/2021-03-13/161563116079716156303822171596726672674openwrt-lan.png" alt="openwrtlan.png"></p><p>先将原有的<code>wan</code>口删除，然后进入<code>lan</code>口设置页面<code>物理接口</code>选项，勾选<code>桥接接口</code>选项，将未勾选的/之前用于<code>wan</code>口的<code>以太网适配器: &quot;eth0.x&quot;</code>勾选桥接。</p><p><img src="https://cdn.wyr.me/post-files/2021-03-13/161563116076916156303822281615545080058image.png" alt="image.png"></p><p>勾选<code>lan</code>口<code>DHCP</code>服务器<code>忽略此接口</code>选项。设置完成后，所有的接口都可以作为交换机LAN口使用。无线设置不变。</p>]]></description><link>https://www.wyr.me/post/676</link><guid isPermaLink="false">https://www.wyr.me/post/676</guid><dc:creator><![CDATA[轶哥]]></dc:creator><pubDate>Sat, 13 Mar 2021 10:27:35 GMT</pubDate></item><item><title><![CDATA[【视频教程】Electron自动编译及自动更新、分发]]></title><description><![CDATA[<p>为了实现Electron的自动更新，曾撰文《<a target="_blank" href="https://www.wyr.me/post/611" title="" rel="external">Electron 应用分发系统（Electron自动更新）</a>》，不少小伙伴反应说不知道正确的操作姿势。仔细想来，这个部署确实不简单，因此特意录制此视频。</p><p>视频从头开始讲解了如何搭建一个Electron官方示例，配置并实现<code>push</code>到git仓库后服务器端自动编译、自动上传编译后的文件到七牛对象存储、客户端捕获更新信息并且后台静默更新的配置全过程。</p><p>需要特别留意的是，每次发布新版本之前都需要修改<code>package.json</code>里面的<code>version</code>版本号，否则自动更新分发会失效。</p>]]></description><link>https://www.wyr.me/post/675</link><guid isPermaLink="false">https://www.wyr.me/post/675</guid><dc:creator><![CDATA[轶哥]]></dc:creator><pubDate>Thu, 11 Mar 2021 09:32:24 GMT</pubDate></item><item><title><![CDATA[Redash导出仪表盘中所有数据为Excel文件]]></title><description><![CDATA[<p>在《<a target="_blank" href="https://www.wyr.me/post/673" title="" rel="external">Redash刷新整个仪表盘API</a>》一文中，提到了<code>导出仪表盘中所有的Widget数据为Excel文件</code>的需求。</p><p>实现该需求只需要调用官方的API，但是<a target="_blank" href="https://redash.io/help/user-guide/integrations-and-api/api" title="" rel="external nofollow">官方API文档</a>对于使用的描述基本没有。</p><h1>第一步：获取仪表盘数据，得到QueryID</h1><p>通过请求</p><pre><code>GET /api/dashboards/&lt;dashboard_slug&gt;?api_key=&lt;API_KEY&gt;</code></pre><p>获取仪表盘数据。</p>]]></description><link>https://www.wyr.me/post/674</link><guid isPermaLink="false">https://www.wyr.me/post/674</guid><dc:creator><![CDATA[轶哥]]></dc:creator><pubDate>Wed, 10 Mar 2021 10:38:50 GMT</pubDate></item><item><title><![CDATA[Redash刷新整个仪表盘API]]></title><description><![CDATA[<p>转眼间使用<a target="_blank" href="https://redash.io/" title="" rel="external nofollow">Redash</a>已经两年多了，<code>redash</code>给我的感觉就是省心省事。基础需求都能实现，用户体验很好，升级版本也容易，二次开发也方便简单。</p><p>只不过有两个需求redash没有实现：</p><ul><li>API刷新整个仪表盘</li><li>导出仪表盘中所有的Widget数据为Excel文件</li></ul><p>第二个需求，我在《<a target="_blank" href="https://www.wyr.me/post/674" title="" rel="external">Redash导出仪表盘中所有数据为Excel文件</a>》一文进行了实现说明。</p>]]></description><link>https://www.wyr.me/post/673</link><guid isPermaLink="false">https://www.wyr.me/post/673</guid><dc:creator><![CDATA[轶哥]]></dc:creator><pubDate>Wed, 10 Mar 2021 10:38:37 GMT</pubDate></item><item><title><![CDATA[Poetry快速安装教程]]></title><description><![CDATA[<p>Poetry是一个Python的依赖管理工具。设计思路比较先进，运行速度非常快。非常类似于<code>Node.js</code>里面的<code>yarn</code>。</p><p><code>Poetry</code>在国内的安装速度比较慢。好在安装脚本提供了<code>--file</code>参数，可以指定安装包。我们可以通过这个方法进行快速安装。</p><h1>关于Poetry</h1><p><code>Poetry</code>是用于处理依赖项安装以及Python程序包构建和打包的工具。只需一个文件即可完成所有工作：<a target="_blank" href="https://peps.python.org/pep-0518/" title="" rel="external nofollow">标准化的</a> <code>pyproject.toml</code>。</p><p>换句话说，用<code>pyproject.toml</code>来代替<code>setup.py</code>，<code>requirements.txt</code>，<code>setup.cfg</code>，<code>MANIFEST.in</code>和新加入的<code>Pipfile</code>。</p><ul><li>将尝试将<a target="_blank" href="https://semver.org/" title="" rel="external nofollow">语义版本控制</a>作为版本命名的最佳实践。</li><li>可以指定自述文件，included 和 excluded 文件：no more <code>MANIFEST.in</code>。 <code>poetry</code>还将使用VCS忽略文件（如<code>.gitignore</code>）填充该<code>exclude</code>部分。</li><li>可以指定关键字（最多5个），并在包发布站点上用作标签。</li><li>依赖项部分支持插入符号，波浪号，通配符，不等式和多重依赖。</li><li>您必须指定与您的软件包兼容的python版本。</li></ul><p><code>poetry</code>还将检测您是否在<code>virtualenv</code>中，并相应地安装软件包。因此，<code>poetry</code>可以在全球范围内安装并在任何地方使用。</p><p><code>poetry</code> 还带有完整的依赖关系解析库。</p><p>更多内容不再赘述，参考peotry官网：<a target="_blank" href="https://python-poetry.org/" title="" rel="external nofollow">https://python-poetry.org/</a></p><p>使用方法参考 peotry开源地址：<a target="_blank" href="https://github.com/python-poetry/poetry" title="" rel="external nofollow">https://github.com/python-poetry/poetry</a></p>]]></description><link>https://www.wyr.me/post/672</link><guid isPermaLink="false">https://www.wyr.me/post/672</guid><dc:creator><![CDATA[轶哥]]></dc:creator><pubDate>Wed, 10 Mar 2021 05:16:21 GMT</pubDate></item><item><title><![CDATA[Nginx通过域名进行TCP反向代理]]></title><description><![CDATA[<p>使用Nginx可以实现根据域名进行TCP反向代理到不同的内网服务器。</p><h1>应用场景</h1><p>一家公司购买了很多服务器，为了节约成本，使用了阿里云/腾讯云的<code>NAT网关</code>，通过几台网关服务器进行NAT出口，通过大量内网服务器进行数据计算，节约公网带宽费用且确保了内网服务器不因公网IP泄露导致被攻击。</p><p><img src="https://cdn.wyr.me/post-files/2021-03-07/16151339546681615133503610aliyun.png" alt="aliyun.png"></p><div style="display: block;text-align: center;">（上图来自阿里云）</div><p>但是在用作网关的出口服务器上，需要配置SSL域名证书。如果在网关配置域名证书，各个业务对证书的要求不一样，网关服务器管理员疲于运维。因此，通过TCP反向代理到内网服务器，让内网服务器管理员自行配置SSL证书。</p>]]></description><link>https://www.wyr.me/post/671</link><guid isPermaLink="false">https://www.wyr.me/post/671</guid><dc:creator><![CDATA[轶哥]]></dc:creator><pubDate>Sun, 07 Mar 2021 16:19:58 GMT</pubDate></item><item><title><![CDATA[云服务器Linux磁盘扩容]]></title><description><![CDATA[<p>云服务器云盘扩容相关文章挺多的，坑也比较多。特整理正确操作如下。</p><h1>支持的发行版</h1><ul><li>Ubuntu</li><li>CentOS</li><li>Debain</li><li>Alpine</li><li>Arch</li></ul><p>在 <code>Ubuntu 16.04</code>、<code>Ubuntu 18.04</code>、<code>Ubuntu 20.04</code>测试过。</p><p>在<code>CentOS 6</code>、<code>CentOS 7</code>、<code>CentOS 8</code>测试过。</p><p>在<code>阿里云</code>、<code>腾讯云</code>、<code>AWS EC2</code>实测过扩容，以上云服务商都支持云盘扩容。</p><p>需要注意的是，虽然扩容方法支持系统盘和数据盘，然而部分云服务提供商并不支持系统盘扩容，只支持在购买云服务器/VPS的时候选择系统盘大小。通常这些服务商都支持对系统盘进行备份，可以通过新购服务器还原系统盘镜像然后再执行此文操作的方式进行迁移扩容。</p><p>此方法不支持ARM服务器扩容。一般来说，ARM服务器、Raspberry Pi、NanoPi等arm架构的设备都有专门的扩容方法，需要查阅相应文档进行扩容。</p>]]></description><link>https://www.wyr.me/post/670</link><guid isPermaLink="false">https://www.wyr.me/post/670</guid><dc:creator><![CDATA[轶哥]]></dc:creator><pubDate>Sun, 07 Mar 2021 15:54:29 GMT</pubDate></item><item><title><![CDATA[Node.js在VM环境使用ECMAScript modules]]></title><description><![CDATA[<p><code>vm</code>模块允许在V8虚拟机上下文中编译和运行代码。但是不是安全机制，如果有沙箱(sandbox)需求，可以考虑<a target="_blank" href="https://github.com/patriksimek/vm2" title="" rel="external nofollow">https://github.com/patriksimek/vm2</a>。</p><p>在VM环境中使用<code>ECMAScript modules</code>，即在VM环境中可以用<code>import</code>代替<code>require</code>引入某个模块，避免<code>Cannot use import statement outside a module</code>错误，也可以用<code>export</code>代替<code>module.exports</code>。</p><p><strong>我的使用场景：</strong></p><p>通过Node.js在VM环境使用ECMAScript modules之目的，是为了构建一个虚拟环境（可控的上下文内容）动态执行一些代码，方便在复杂系统中构建小型脚本动态的快速验证一些想法。</p><p>在<a target="_blank" href="https://github.com/yi-ge/api-proxy" title="" rel="external nofollow">https://github.com/yi-ge/api-proxy</a>这个小项目中也有用到<code>vm</code>模块。</p>]]></description><link>https://www.wyr.me/post/669</link><guid isPermaLink="false">https://www.wyr.me/post/669</guid><dc:creator><![CDATA[轶哥]]></dc:creator><pubDate>Thu, 04 Mar 2021 05:25:32 GMT</pubDate></item><item><title><![CDATA[ESXi + Frp 内网穿透]]></title><description><![CDATA[<p>ESXi + Frp 实现内网穿透，可以做到远程管理ESXi。由于ESXi默认启用了SSL本地证书，因此配置方法与传统http站点反向代理有所不同。</p><pre><code class="language-ini">[esxi-web]type = tcplocal_ip = 10.10.10.254local_port = 443remote_port = 6012</code></pre><p>可以看到上述绑定的本地端口号是443。这里的<code>type</code>只设置为<code>tcp</code>，远程访问地址：<code>https://xx.xx.xx.xx:6012</code>，注意，需要以<code>https</code>开头并忽略证书错误。</p>]]></description><link>https://www.wyr.me/post/668</link><guid isPermaLink="false">https://www.wyr.me/post/668</guid><dc:creator><![CDATA[轶哥]]></dc:creator><pubDate>Wed, 03 Mar 2021 06:10:19 GMT</pubDate></item><item><title><![CDATA[ESXi无法添加网络适配器问题解决]]></title><description><![CDATA[<p><img src="https://cdn.wyr.me/post-files/2021-03-03/16147492119581614748790590net-select.png" alt="netselect.png"></p><p>ESXi有可能会出现无法添加网络适配器，即无法选择虚拟网卡，网络适配器没有选项（如图）。这个问题是错误的配置导致的，并非系统BUG。</p><p><img src="https://cdn.wyr.me/post-files/2021-03-03/16147492120641614748849421net-number.png" alt="netnumber.png"></p><p>此时网络数量可能显示为0，或者与实际网络数量不符。</p>]]></description><link>https://www.wyr.me/post/667</link><guid isPermaLink="false">https://www.wyr.me/post/667</guid><dc:creator><![CDATA[轶哥]]></dc:creator><pubDate>Wed, 03 Mar 2021 05:27:38 GMT</pubDate></item><item><title><![CDATA[ESXi 安装USB网卡驱动]]></title><description><![CDATA[<p>通过给ESXi宿主机安装USB驱动，可以实现兼容虚拟机无法驱动的硬件。如果虚拟机本身已经兼容了该硬件，可以参考《<a target="_blank" href="https://www.wyr.me/post/662" title="" rel="external">ESXI+爱快+OpenWRT 使用2.5G USB网卡 RTL8156</a>》设置USB芯片组直通，获得更好的性能体验。</p><p><strong>驱动下载地址：</strong> <a target="_blank" href="https://flings.vmware.com/usb-network-native-driver-for-esxi" title="" rel="external nofollow">https://flings.vmware.com/usb-network-native-driver-for-esxi</a></p><p><strong>注：</strong> 根据官网说明，flings是实验性的，不应该用于生产环境。</p><p>支持的ESXi版本：6.5.0，6.7.0，7.0.0，7.0.1。建议升级到<code>ESXi 7.0 Update 1</code>以获得最佳体验（参考《<a target="_blank" href="https://www.wyr.me/post/665" title="" rel="external">ESXi7.0.0 升级到 ESXi 7.0 Update 1</a>》）。低版本可能导致重启后USB网卡无法正常工作且无法恢复。</p><p>Linux系统参考《<a target="_blank" href="https://www.wyr.me/post/704" title="" rel="external">Linux 2.5G USB网卡驱动安装RTL8156/8156B</a>》。</p>]]></description><link>https://www.wyr.me/post/666</link><guid isPermaLink="false">https://www.wyr.me/post/666</guid><dc:creator><![CDATA[轶哥]]></dc:creator><pubDate>Tue, 02 Mar 2021 06:26:05 GMT</pubDate></item><item><title><![CDATA[ESXi 7.0.0 升级到 ESXi 7.0 Update 1]]></title><description><![CDATA[<p>ESXi 7.0 Update 1 升级说明：《<a target="_blank" href="https://docs.vmware.com/en/VMware-vSphere/7.0/rn/vsphere-esxi-701-release-notes.html" title="" rel="external nofollow">VMware ESXi 7.0 Update 1 Release Notes</a>》，解决了诸多Bug。</p><p>随着<a target="_blank" href="https://www.altaro.com/vmware/whats-new-in-vsphere-7/" title="" rel="external nofollow">VMware vSphere 7 Update 1</a>的发布，不少VMware用户正在考虑将生产基础架构升级到新版本。</p><h1>如何安装ESXi 7 Update 1</h1><p>有多种安装ESXi 7 Update1的方法。</p><ol><li>全新安装ESXi 7 Update 1</li><li>命令行升级</li><li>vSphere Update Manager</li><li>vSphere Lifecycle Manager</li></ol><p>升级前需参考《<a target="_blank" href="https://www.wyr.me/post/664" title="" rel="external">ESXi宿主机联网配置</a>》让ESXi宿主机联网。</p><p>也可以<a target="_blank" href="http://my.vmware.com/group/vmware/downloads/" title="" rel="external nofollow">下载</a>最新版的ISO文件，通过刻录光盘或U盘进行升级安装（方法一）。</p><p>以下以第二种方式为例。</p>]]></description><link>https://www.wyr.me/post/665</link><guid isPermaLink="false">https://www.wyr.me/post/665</guid><dc:creator><![CDATA[轶哥]]></dc:creator><pubDate>Mon, 01 Mar 2021 10:26:10 GMT</pubDate></item><item><title><![CDATA[ESXi宿主机联网配置]]></title><description><![CDATA[<p>ESXi宿主机联网后可以通过SSH在线升级系统版本（例如《<a target="_blank" href="https://www.wyr.me/post/665" title="" rel="external">ESXi7.0.0 升级到 ESXi 7.0 Update 1</a>》），获得更多新特性。</p><h1>联网必备条件</h1><ul><li><strong>至少一根联网线路接入到ESXi宿主机</strong>或<strong>虚拟机中存在一个同网段可联网网关</strong></li><li>拥有<code>VMware vSphere client</code>或<code>ESXi</code>管理员权限</li></ul><p>注：上述“<strong>虚拟机中存在一个同网段可联网网关</strong>”，例如<code>ESXi + OpenWrt/LEDE</code>或<code>ESXi + iKuai</code>组合，其中的<code>OpenWrt/LEDE</code>或<code>iKuai</code>可以作为联网网关。比如说将<code>ESXi</code>管理地址设置为<code>10.10.10.252</code>，而<code>爱快</code>负责<code>pppoe</code>及<code>DHCP Server</code>，且<code>DHCP网段</code>和<code>10.10.10.254</code>在同一个网段。</p>]]></description><link>https://www.wyr.me/post/664</link><guid isPermaLink="false">https://www.wyr.me/post/664</guid><dc:creator><![CDATA[轶哥]]></dc:creator><pubDate>Mon, 01 Mar 2021 10:25:51 GMT</pubDate></item><item><title><![CDATA[爱快+ OpenWRT旁路由 开启IPv6]]></title><description><![CDATA[<p>ESXI+爱快+OpenWRT/LEDE（旁路由）的搭配是非常高效的，兼容性也很好。开启IPv6的前提条件是爱快负责DHCP，OpenWRT作为旁路由模式，路由器改为桥接模式（或配置了IPv6 DHCPv6，且依照下文iKuai的配置方法进行配置）。</p><p>目前移动、联通、电信三大运营商都已经为客户分配了公网IPv6。鹏博士（长城宽带）尚未支持IPv6，不过鹏博士可以通过NAT优化渠道支持IPv6。</p>]]></description><link>https://www.wyr.me/post/663</link><guid isPermaLink="false">https://www.wyr.me/post/663</guid><dc:creator><![CDATA[轶哥]]></dc:creator><pubDate>Mon, 22 Feb 2021 16:32:09 GMT</pubDate></item><item><title><![CDATA[ESXI+爱快+OpenWRT 使用2.5G USB网卡 RTL8156]]></title><description><![CDATA[<p>目前爱快完美兼容芯片为RTL8156的2.5G USB有线网卡。<del>目前OpenWRT(LEDE)尚不支持RTL8156网卡</del>（可以参考《<a target="_blank" href="https://www.wyr.me/post/666" title="" rel="external">ESXi 安装USB网卡驱动</a>》实现<code>ESXi + OpenWRT</code>。2021年03月14日，OpenWRT正式支持RTL8152。Linux系统可参考《<a target="_blank" href="https://www.wyr.me/post/704" title="" rel="external">Linux 2.5G USB网卡驱动安装RTL8156/8156B</a>》）。</p><p>爱快需要升级到3.4.0+。该版本新增兼容的型号：</p><ol><li>PCI网卡驱动:RTL8125</li><li>USB有线网卡驱动:RTL8150/8152/8153/8156,AX88179/8817x</li></ol><p>ESXI+爱快+OpenWRT搭配，可以实现完美驱动该网卡，打造2.5G软路由。目前支持2.5G的设备不多，常见的是小米AX6000无线路由器，TP-Link新出的2.5G交换机，自带2.5G口的群辉等，当然群辉+绿联RTL8156也是非常稳定的。</p><p>让爱快兼容USB网卡的思路也是先让网卡直通。只不过这里得先让USB控制器直通。</p>]]></description><link>https://www.wyr.me/post/662</link><guid isPermaLink="false">https://www.wyr.me/post/662</guid><dc:creator><![CDATA[轶哥]]></dc:creator><pubDate>Sun, 21 Feb 2021 13:36:31 GMT</pubDate></item><item><title><![CDATA[Linux配置Swap]]></title><description><![CDATA[<p>编译程序的时候可能出现<code>aarch64-linux-gnu-gcc: internal compiler error: Killed (program cc1)</code>类似的报错。这是由于内存不足引起的。可以通过开启Swap分区解决。开启<code>swap</code>，即使用一部分硬盘作为虚拟内存，解决内存容量不足的情况。</p>]]></description><link>https://www.wyr.me/post/661</link><guid isPermaLink="false">https://www.wyr.me/post/661</guid><dc:creator><![CDATA[轶哥]]></dc:creator><pubDate>Fri, 19 Feb 2021 06:26:34 GMT</pubDate></item><item><title><![CDATA[Json Schema定义“既可以是对象，又可以是数组”]]></title><description><![CDATA[<blockquote><p>如果我想定义json的内容（root）既可以是一个对象，又可以是一个数组，应该如何书写json schema？</p></blockquote><p>这个问题换一种描述方式，“json schema定义了一个对象，但是希望内容也可以是这个对象的数组，如何书写json schema？”。</p><p>例如，Typescript中：<code>root: object | [object]</code>。</p><p>例如，我希望数据可以是下面这样的一个对象：</p><pre><code class="language-json">{  &quot;method&quot;: &quot;GET&quot;}</code></pre><p>也可以是这样的数组：</p><pre><code class="language-json">[  {    &quot;method&quot;: &quot;GET&quot;  }]</code></pre>]]></description><link>https://www.wyr.me/post/660</link><guid isPermaLink="false">https://www.wyr.me/post/660</guid><dc:creator><![CDATA[轶哥]]></dc:creator><pubDate>Sat, 06 Feb 2021 15:45:04 GMT</pubDate></item><item><title><![CDATA[win10链路聚合，双网卡带宽叠加负载均衡]]></title><description><![CDATA[<p>设备具有两个及以上网卡就有可能实现链路聚合，进行带宽叠加。windows平台提供了一些链路聚合的实现方案。</p><h1>链路聚合方案</h1><ol><li>双网卡都设置同样的跃点数(Metric)。需要符合链接速度，<a target="_blank" href="https://learn.microsoft.com/zh-cn/troubleshoot/windows-server/networking/automatic-metric-for-ipv4-routes" title="" rel="external nofollow">参阅</a>。</li><li><a target="_blank" href="https://learn.microsoft.com/en-us/powershell/module/netswitchteam/?view=win10-ps" title="" rel="external nofollow">NetSwitchTeam(推荐)</a></li><li><a target="_blank" href="https://docs.microsoft.com/zh-cn/windows-server/networking/technologies/nic-teaming/nic-teaming-settings" title="" rel="external nofollow">NIC 组合(仅windows server平台)</a></li><li><a target="_blank" href="https://www.intel.cn/content/www/cn/zh/support/articles/000023545/network-and-io.html" title="" rel="external nofollow">Intel® PROSet</a>（仅用于Intel部分网卡，需要驱动支持。详见官方文档，不再赘述）</li></ol>]]></description><link>https://www.wyr.me/post/659</link><guid isPermaLink="false">https://www.wyr.me/post/659</guid><dc:creator><![CDATA[轶哥]]></dc:creator><pubDate>Fri, 05 Feb 2021 11:03:23 GMT</pubDate></item><item><title><![CDATA[brew安装python2]]></title><description><![CDATA[<p><a target="_blank" href="https://brew.sh/" title="" rel="external nofollow">Homebrew</a>是MacOS中绝佳的包管理工具。通过brew安装pyton3非常容易<code>brew install python@3</code>，将会自动添加<code>python3</code>和<code>pip3</code>命令。</p><p>关于python的安装，在<code>Homebrew</code>官网给出了详细的说明：<a target="_blank" href="https://docs.brew.sh/Homebrew-and-Python" title="" rel="external nofollow">https://docs.brew.sh/Homebrew-and-Python</a></p><blockquote><p>Homebrew provided a <code>python@2</code> formula until the end of 2019, at which point it was removed due to the Python 2 deprecation.</p></blockquote><p>根据提示，我们知道<code>python@2</code>已经被移除。在2020年初，<code>python@2</code>仍然可以正常安装，但就在不久前，官方移除了<code>python@2</code>。我对<code>Homebrew</code>官方的操作表示支持和理解，毕竟技术的更新和迭代是不可逆转的，是需要大家一起支持的。</p>]]></description><link>https://www.wyr.me/post/658</link><guid isPermaLink="false">https://www.wyr.me/post/658</guid><dc:creator><![CDATA[轶哥]]></dc:creator><pubDate>Wed, 03 Feb 2021 06:18:06 GMT</pubDate></item><item><title><![CDATA[JavaScript练习题]]></title><description><![CDATA[<p>学习JavaScript绝佳的方法是阅读代码。阅读代码需要熟悉JavaScript的基本语法，包括作用域、类型及类型转换、原型链、函数、异步、闭包等内容。<a target="_blank" href="https://github.com/yeungon/In-JavaScript-we-trust" title="" rel="external nofollow">In-JavaScript-we-trust</a>给我们提供了非常好的练习素材。</p><p>赶紧自测一下JavaScript掌握得怎么样！</p><p><strong>H5在线练习地址</strong>：<a target="_blank" href="https://js.wyr.me/" title="" rel="external">https://js.wyr.me</a></p><p>仅支持手机访问（毕竟做完68道题是需要耐心的，这是为了避免打开调试界面偷懒而设计）。</p>]]></description><link>https://www.wyr.me/post/657</link><guid isPermaLink="false">https://www.wyr.me/post/657</guid><dc:creator><![CDATA[轶哥]]></dc:creator><pubDate>Tue, 02 Feb 2021 13:58:27 GMT</pubDate></item><item><title><![CDATA[Linux使用4G/5G无线网卡模块上网]]></title><description><![CDATA[<h2>识别模块</h2><p><img src="https://cdn.wyr.me/post-files/2021-01-24/16115068985861611506826467IMG_0028.JPG" alt="5G模块"></p><p>将4G/5G开发板插入设备，终端输入<code>lsusb</code>或<code>lspci</code>，看设备是否识别到4G/5G模块。</p><pre><code class="language-bash">root@raspberrypi:~ $ lsusbBus 001 Device 001: ID 05c6:1000 Qualcomm, Inc. Mass Storage Device</code></pre><p>以树莓派(Raspberry)为例，上述命令显示设备识别到高通芯片的4G模块。了解更多详情请阅读<a target="_blank" href="https://www.wyr.me/post/623" title="" rel="external">《Linux安装无线网卡驱动通用方法》</a>。</p><p>需要特别注意的是，部分4G模块（特别是性能较好的高通芯片）是内核免驱，载入成功后直接体现为网卡。使用<code>ifconfig</code>即可直接看到网卡并能上网。这种情况下，USB接口实现的是一个USB网卡端，类似于Raspberry OTG USB上网。参考：<a target="_blank" href="https://www.wyr.me/post/620" title="" rel="external">《树莓派4使用OTG功能变身有线网卡》</a>。</p>]]></description><link>https://www.wyr.me/post/656</link><guid isPermaLink="false">https://www.wyr.me/post/656</guid><dc:creator><![CDATA[轶哥]]></dc:creator><pubDate>Sun, 24 Jan 2021 16:49:21 GMT</pubDate></item><item><title><![CDATA[NuxtJS中Axios的配置说明]]></title><description><![CDATA[<p>在<a target="_blank" href="https://nuxt.com/" title="" rel="external nofollow">nuxt.js</a>中使用<a target="_blank" href="https://github.com/axios/axios" title="" rel="external nofollow">axios</a>，推荐使用nuxt定制款<code>nuxt/axios</code>(<a target="_blank" href="https://axios.nuxtjs.org/" title="" rel="external nofollow">https://axios.nuxtjs.org/</a>)。相比原生<code>axios</code>有如下优势：</p><ul><li>自动为客户端和服务器端设置<code>baseURL</code></li><li>将<code>setToken</code>函数暴露给<code>$axios</code>，可以非常容易的进行全局<code>Authentication tokens</code>设置</li><li>基于<code>baseURL</code>发起请求时，自动启用<code>withCredentials</code></li><li>添加用于服务器端渲染的<code>Proxy</code>请求<code>Header</code></li><li>支持使用<code>axios</code>加载<code>CSS</code></li><li>与<code>Nuxt</code>进度条集成</li><li>与<code>Proxi</code>模块集成</li><li>使用<code>axios-retry</code>自动重试请求</li></ul>]]></description><link>https://www.wyr.me/post/655</link><guid isPermaLink="false">https://www.wyr.me/post/655</guid><dc:creator><![CDATA[轶哥]]></dc:creator><pubDate>Sat, 19 Dec 2020 15:48:03 GMT</pubDate></item><item><title><![CDATA[适用于嵌入式设备的高性能PDF在线预览方案]]></title><description><![CDATA[<p><img src="https://cdn.wyr.me/post-files/2020-11-12/16051949509131605193010616desktop.jpeg" alt="desktop.jpeg"></p><p>对于内存较小的嵌入式设备或者移动设备（例如带屏智能音响，安卓、IOS平台的设备），在线预览PDF功能经常会导致内存溢出、应用程序闪退。</p><p>对于非常大的PDF文档，一次性下载整个文档将消耗大量的时间，即使开启分段下载，PDF文档正常下载完成并加载，超大的内存占用也会导致设备运行卡顿。</p>]]></description><link>https://www.wyr.me/post/654</link><guid isPermaLink="false">https://www.wyr.me/post/654</guid><dc:creator><![CDATA[轶哥]]></dc:creator><pubDate>Thu, 12 Nov 2020 15:49:23 GMT</pubDate></item><item><title><![CDATA[从Apple备忘录导入到Standard Notes]]></title><description><![CDATA[<p><code>Standard Notes</code>是一款部分开源的优秀的跨平台加密笔记软件。作为<code>备忘录</code>（Apple Notes）的替代品（补充品），<code>Standard Notes</code>订阅版支持丰富的插件和编辑器。</p>]]></description><link>https://www.wyr.me/post/653</link><guid isPermaLink="false">https://www.wyr.me/post/653</guid><dc:creator><![CDATA[轶哥]]></dc:creator><pubDate>Tue, 10 Nov 2020 13:17:54 GMT</pubDate></item><item><title><![CDATA[Google Authenticator 密钥导出到新iPhone]]></title><description><![CDATA[<p>此文章提供的方法可以将<code>Google Authenticator</code>（安卓中显示为<code>Google 身份验证器</code>）中所有的密钥导出到其它的2FA双因素认证软件（例如<code>Microsoft Authenticator</code>、<code>Step Two</code>、<code>Duo Mobile</code>、<code>Authy</code>等二次验证APP），甚至从<code>Android</code>版本的<code>Google Authenticator</code>导入到<code>IOS</code>版本的<code>Google Authenticator</code>（例如将华为手机里面的身份验证数据导入到<code>IPhone</code>，两个手机可以同时使用）。</p><p>研究迁移方法的原因是，<code>Android</code>版本的<code>Google Authenticator</code>右上角提供了<code>迁移账号</code>功能，而在<code>IPhone</code>中无法导入从<code>Android</code>中迁移出来的账号（估计是<code>IOS</code>版本年久失修）。我的密码数量很多，挨个到原始账号设置的地方重置二次验证数据不太现实。</p>]]></description><link>https://www.wyr.me/post/652</link><guid isPermaLink="false">https://www.wyr.me/post/652</guid><dc:creator><![CDATA[轶哥]]></dc:creator><pubDate>Sun, 08 Nov 2020 16:39:32 GMT</pubDate></item><item><title><![CDATA[Microsoft ToDo和GoodTask数据同步]]></title><description><![CDATA[<p><code>Microsoft ToDo</code>和<code>GoodTask</code>都是非常优秀的待办事项管理工具，<code>Microsoft ToDo</code>是全平台的，而<code>GoodTask</code>只能在Mac/IOS下使用。</p><p><code>Microsoft ToDo</code>和<code>GoodTask</code>是可以互相同步数据的，需要借助<code>Outlook</code>邮箱账号来进行同步，包括标签和分类在内的计划任务数据都可以正常被同步。</p><p>推荐在<code>iPhone</code>手机和<code>MacOS</code>电脑中使用<code>GoodTask</code>管理任务，其它平台使用<code>Microsoft Todo</code>以达到最佳使用体验。</p>]]></description><link>https://www.wyr.me/post/651</link><guid isPermaLink="false">https://www.wyr.me/post/651</guid><dc:creator><![CDATA[轶哥]]></dc:creator><pubDate>Sun, 08 Nov 2020 14:50:33 GMT</pubDate></item><item><title><![CDATA[人为提升服务器CPU、内存、硬盘使用率]]></title><description><![CDATA[<p>遇到一个奇怪的需求，需要在项目未正式交付前，各台服务器使用率满足“CPU不低于 20% ，内存不低于40%，磁盘不低于40%”的要求。</p>]]></description><link>https://www.wyr.me/post/650</link><guid isPermaLink="false">https://www.wyr.me/post/650</guid><dc:creator><![CDATA[轶哥]]></dc:creator><pubDate>Fri, 06 Nov 2020 11:09:51 GMT</pubDate></item><item><title><![CDATA[CryptoJS PBKDF2 AES对称加密]]></title><description><![CDATA[<p><code>CryptoJS</code>提供了和<code>OpenSSL</code>加密命令一致的AES对称加密方法，此方法基于<code>EvpKDF</code>对<code>Secret Passphrase</code> 进行计算（<a target="_blank" href="https://docs.openssl.org/master/man3/EVP_BytesToKey/" title="" rel="external nofollow"><code>This key derivation function is meant to conform with EVP_BytesToKey.</code></a>），确保进行AES加密计算的<code>key</code>符合长度标准并提升AES加密的安全性。<code>CryptoJS</code>没有直接提供基于<code>PBKDF2</code>的AES加密方法，但在<code>OpenSSL</code>中提供了<code>-pbkdf2</code>参数并将该参数作为AES加密的推荐选项。</p>]]></description><link>https://www.wyr.me/post/649</link><guid isPermaLink="false">https://www.wyr.me/post/649</guid><dc:creator><![CDATA[轶哥]]></dc:creator><pubDate>Sun, 18 Oct 2020 15:50:55 GMT</pubDate></item><item><title><![CDATA[Node.js调用FFmpeg]]></title><description><![CDATA[<p>在Node.js中调用<code>ffmpeg</code>的绝佳方法是使用<a target="_blank" href="https://github.com/fluent-ffmpeg/node-fluent-ffmpeg" title="" rel="external nofollow">node-fluent-ffmpeg</a>库。</p><p><code>fluent-ffmpeg</code>开源地址：<a target="_blank" href="https://github.com/fluent-ffmpeg/node-fluent-ffmpeg" title="" rel="external nofollow">https://github.com/fluent-ffmpeg/node-fluent-ffmpeg</a></p>]]></description><link>https://www.wyr.me/post/648</link><guid isPermaLink="false">https://www.wyr.me/post/648</guid><dc:creator><![CDATA[轶哥]]></dc:creator><pubDate>Sat, 26 Sep 2020 14:51:26 GMT</pubDate></item><item><title><![CDATA[昆明社保卡使用攻略]]></title><description><![CDATA[<p>昆明的社保卡集<code>医保账户</code>、<code>金融账户</code>于一体。此卡有两个密码，一个是药店买药/医院看病的医保密码，另一个是内置银行卡的密码。</p><p>首先到应用商店下载<code>“昆明人社通”</code>APP，用身份信息登录即可查看社保卡、医保账户等相关信息。</p>]]></description><link>https://www.wyr.me/post/647</link><guid isPermaLink="false">https://www.wyr.me/post/647</guid><dc:creator><![CDATA[轶哥]]></dc:creator><pubDate>Sat, 26 Sep 2020 09:24:00 GMT</pubDate></item><item><title><![CDATA[ESXi 7.0 安装教程]]></title><description><![CDATA[<p><code>VMware vSphere</code>是<code>VMware</code> 的<code>虚拟化平台</code>。<code>VMwarev Sphere</code>的两个核心组件是<code>ESXi</code>和<code>vCenter Server</code>。<code>ESXi</code>是用于创建并运行虚拟机和虚拟设备的虚拟化平台。<code>vCenter Server</code>是一项服务，用于管理网络中连接的多个主机，并将主机<code>资源池化</code>。</p><p>可以简单理解为<code>ESXi</code>是安装在物理机上的，通过<code>vCenter Server</code>将多个物理机资源整合起来。</p><p>目前<code>ESXi</code>可以独立运行在某个物理设备上，为设备提供虚拟化平台（虚拟机）。例如在软路由中安装<code>ESXi 7.0</code>，以实现<code>爱快</code>+<code>OpenWrt</code>等组合搭配。</p>]]></description><link>https://www.wyr.me/post/646</link><guid isPermaLink="false">https://www.wyr.me/post/646</guid><dc:creator><![CDATA[轶哥]]></dc:creator><pubDate>Thu, 17 Sep 2020 06:16:26 GMT</pubDate></item><item><title><![CDATA[GPD Pocket 2 安装Ubuntu]]></title><description><![CDATA[<p><code>Ubuntu Mate</code>官方为<code>GPD Pocket 2</code>推出了<a target="_blank" href="https://ubuntu-mate.org/ports/umpcs/" title="" rel="external nofollow">定制固件</a>，此固件最新版为<code>19.10</code>，经实测安装此版本后可以正常通过命令行升级至<code>20.04.1 LTS</code>，升级后各个硬件驱动均正常。但是<code>Ubuntu Mate</code>存在一个巨大的缺陷——色彩显示异常，有一种灰蒙蒙的感觉，类似于16位色彩的显示效果。</p>]]></description><link>https://www.wyr.me/post/644</link><guid isPermaLink="false">https://www.wyr.me/post/644</guid><dc:creator><![CDATA[轶哥]]></dc:creator><pubDate>Wed, 16 Sep 2020 05:38:42 GMT</pubDate></item><item><title><![CDATA[昂达Obook11安装Ubuntu]]></title><description><![CDATA[<p>Onda Obook11可以安装原版Ubuntu，但是GUI运行会比较卡顿。建议安装最新x64版的<a target="_blank" href="https://ubuntu-mate.org/download/amd64/" title="" rel="external nofollow">Ubuntu Mate</a>（在20.04.1 LTS测试通过）。</p><p>安装最新版的Ubuntu后，默认WIFI无法正常驱动，需要通过U盘或USB无线网卡下载驱动文件才能正常使用无线网络。</p>]]></description><link>https://www.wyr.me/post/643</link><guid isPermaLink="false">https://www.wyr.me/post/643</guid><dc:creator><![CDATA[轶哥]]></dc:creator><pubDate>Wed, 16 Sep 2020 04:07:06 GMT</pubDate></item><item><title><![CDATA[WebRTC 安卓有视频无声音问题解决]]></title><description><![CDATA[<p>昨日遇到客户反馈<code>WebRTC</code>在安卓平台出现有视频无声音的故障。</p><p><img src="https://cdn.wyr.me/post-files/2020-09-01/159893519794915989349530771061598934819_.pic_hd.jpg" alt="1061598934819.pichd.jpg"></p><p>系统运行在<code>Android 7.1</code>平台，是小型公证一体机。采用自编译<code>Chromium内核</code>封装Web页面混合开发实现。</p>]]></description><link>https://www.wyr.me/post/642</link><guid isPermaLink="false">https://www.wyr.me/post/642</guid><dc:creator><![CDATA[轶哥]]></dc:creator><pubDate>Tue, 01 Sep 2020 05:13:51 GMT</pubDate></item><item><title><![CDATA[iframe显示特定内容]]></title><description><![CDATA[<p><code>iframe</code>控制显示范围，显示目标网页的特定区域，这对于特定场景非常有用，是一种简单高效的系统整合方案。</p><p>在新版本的浏览器中，<code>vspace</code>和<code>hspace</code>已经失效了。因此<code>iframe</code>显示特定内容只能采取嵌套<code>iframe</code>的方案。</p><p>例如，控制iframe仅显示<code>https://www.wyr.me</code>的头像部分。</p>]]></description><link>https://www.wyr.me/post/641</link><guid isPermaLink="false">https://www.wyr.me/post/641</guid><dc:creator><![CDATA[轶哥]]></dc:creator><pubDate>Tue, 25 Aug 2020 05:54:46 GMT</pubDate></item><item><title><![CDATA[coTurn服务器部署]]></title><description><![CDATA[<p><a target="_blank" href="https://github.com/coturn/coturn" title="" rel="external nofollow">coturn</a>是主流的开源 <code>TURN</code> and <code>STUN</code> 服务器软件，支持诸多规范、功能和数据库。<code>coturn</code>的出现对于<code>WebRTC</code>的发展有着举足轻重的影响。</p><p>鉴于官方文档已经非常详尽，本文仅列举几个常见问题，具体的部署方法不再一一赘述。</p><p><code>coturn</code>开源仓库地址：<a target="_blank" href="https://github.com/coturn/coturn" title="" rel="external nofollow">https://github.com/coturn/coturn</a></p>]]></description><link>https://www.wyr.me/post/640</link><guid isPermaLink="false">https://www.wyr.me/post/640</guid><dc:creator><![CDATA[轶哥]]></dc:creator><pubDate>Thu, 20 Aug 2020 12:09:34 GMT</pubDate></item><item><title><![CDATA[Vue3.0 + Vite 绝佳的开发体验]]></title><description><![CDATA[<p><code>Vite</code>是一个尤大开发的革命性的Web构建工具。</p><p><code>Vite</code>是基于浏览器原生<code>ES Module imports</code>的构建工具。很多场景下，<code>Vite</code>可以代替<code>webpack</code>，开发调试的速度有了非常大的提升。<code>Vite</code>支持对单个文件的热更新，调试一行代码等很久的情况或将成为历史。</p><p><a target="_blank" href="https://en.wiktionary.org/wiki/vite" title="" rel="external nofollow">vite</a>是法语中“ fast”的意思，其发音是<code>/vit/</code>。</p>]]></description><link>https://www.wyr.me/post/639</link><guid isPermaLink="false">https://www.wyr.me/post/639</guid><dc:creator><![CDATA[轶哥]]></dc:creator><pubDate>Thu, 20 Aug 2020 10:52:31 GMT</pubDate></item><item><title><![CDATA[MacOS 同时使用内网和外网（双网卡同时联网）]]></title><description><![CDATA[<p>MacOS使用双网卡连接不同网络时，通常是不能同时使用内网外网系统的。这是由于计算机不知道那些网段一定属于内网导致。</p><p>温馨提示：<strong>单台计算机同时接入内网外网在大部分单位都属于违规操作，非得到授权人员，切勿以身试法。</strong></p><blockquote><p>双网卡不需要都是有线或者都是无线，外网用WIFI，内网用有线，也属于使用双网卡。</p></blockquote>]]></description><link>https://www.wyr.me/post/638</link><guid isPermaLink="false">https://www.wyr.me/post/638</guid><dc:creator><![CDATA[轶哥]]></dc:creator><pubDate>Wed, 19 Aug 2020 05:45:08 GMT</pubDate></item><item><title><![CDATA[Bent - 又一个JS HTTP Request Client]]></title><description><![CDATA[<p>在JavaScript生态中，知名度最高的HTTP Request Library库是<a target="_blank" href="https://github.com/axios/axios" title="" rel="external nofollow">axios</a>。有众多插件的HTTP请求库是<a target="_blank" href="https://github.com/forwardemail/superagent" title="" rel="external nofollow">superagent</a>。各类请求库功能大体相同，用法和用途存在一些差异。今天介绍的HTTP Request Client库则是<a target="_blank" href="https://github.com/request/request" title="" rel="external nofollow">request</a>的替代品<a target="_blank" href="https://github.com/mikeal/bent" title="" rel="external nofollow">bent</a>。</p>]]></description><link>https://www.wyr.me/post/637</link><guid isPermaLink="false">https://www.wyr.me/post/637</guid><dc:creator><![CDATA[轶哥]]></dc:creator><pubDate>Sun, 16 Aug 2020 11:31:24 GMT</pubDate></item><item><title><![CDATA[PHP 获取客户端真实IP地址]]></title><description><![CDATA[<p>PHP获取客户端真实IP地址，需要根据具体的服务器环境来确定使用哪种方法。目前搜索到的方法，大多是直接贴代码，没有针对不同情况作出说明，有可能导致系统被假IP骗过（IP欺骗）。</p><p>很多文章都提到“无法保证获取到的访客IP地址100%准确”，是否意味着PHP获取访客IP一定有漏洞可钻呢？</p><p>只要根据实际部署情况选择相对应的代码获取访客IP地址，是可以确保程序不被假IP欺骗的。</p>]]></description><link>https://www.wyr.me/post/636</link><guid isPermaLink="false">https://www.wyr.me/post/636</guid><dc:creator><![CDATA[轶哥]]></dc:creator><pubDate>Fri, 14 Aug 2020 12:26:12 GMT</pubDate></item><item><title><![CDATA[JavaScript 安全计算]]></title><description><![CDATA[<p>C/C++、Java、JavaScript等语言，都有计算不精准的问题。原因是这些语言在计算的时候遵循IEEE 二进制浮点数算术标准（<a target="_blank" href="https://baike.baidu.com/item/IEEE%20754" title="" rel="external nofollow">IEEE 754</a>），跟CPU浮点运算器有关系。</p>]]></description><link>https://www.wyr.me/post/635</link><guid isPermaLink="false">https://www.wyr.me/post/635</guid><dc:creator><![CDATA[轶哥]]></dc:creator><pubDate>Fri, 07 Aug 2020 11:26:16 GMT</pubDate></item><item><title><![CDATA[路由器当交换机/AP用]]></title><description><![CDATA[<p>所有的路由器都可以当做交换机使用。在现今WIFI6大放异彩的时代，家里可能淘汰了一些旧路由，同时又新增了一些网络设备。可以通过简单设置，将闲置路由器作为交换机使用。</p><h1>进入路由器管理后台设置界面</h1><p>将网线连接到路由器任意LAN口，或通过WIFI连接到路由器网络中。在电脑浏览器上通过<code>192.168.1.1</code>进入路由器管理后台，如果无法访问，可以查看网络设置属性中的网关地址，网关地址即为路由器设置界面的访问地址。</p>]]></description><link>https://www.wyr.me/post/634</link><guid isPermaLink="false">https://www.wyr.me/post/634</guid><dc:creator><![CDATA[轶哥]]></dc:creator><pubDate>Thu, 06 Aug 2020 15:14:57 GMT</pubDate></item><item><title><![CDATA[Docker 内网部署 离线部署]]></title><description><![CDATA[<p>除了部分监听端口过多的程序，其它情况Docker都非常适合用在内网应用的部署。</p><h1>下载Docker离线文件</h1><h2>下载地址</h2><p>官方下载地址：</p><p><a target="_blank" href="https://download.docker.com/" title="" rel="external nofollow">https://download.docker.com/</a></p><p>...</p>]]></description><link>https://www.wyr.me/post/633</link><guid isPermaLink="false">https://www.wyr.me/post/633</guid><dc:creator><![CDATA[轶哥]]></dc:creator><pubDate>Thu, 06 Aug 2020 13:44:22 GMT</pubDate></item><item><title><![CDATA[通过.env文件设置环境变量]]></title><description><![CDATA[<p>通常情况下，.env文件以key/value的键值对的方式存储环境变量。例如：</p><pre><code class="language-bash">HOST=0.0.0.0PORT=80</code></pre><p>在前端框架<a target="_blank" href="https://cli.vuejs.org/zh/guide/mode-and-env.html" title="" rel="external nofollow">Vue</a>和<a target="_blank" href="https://create-react-app.dev/docs/adding-custom-environment-variables/" title="" rel="external nofollow">React</a>中均有针对环境变量文件的使用描述。</p><p>在<code>Node.js</code>或者其它后端项目中，常常会碰到加载环境变量到当前Session的需求。</p>]]></description><link>https://www.wyr.me/post/632</link><guid isPermaLink="false">https://www.wyr.me/post/632</guid><dc:creator><![CDATA[轶哥]]></dc:creator><pubDate>Thu, 06 Aug 2020 05:34:03 GMT</pubDate></item><item><title><![CDATA[将新网址推送到百度、谷歌、Bing搜索引擎]]></title><description><![CDATA[<p>为了方便大家快速集成，我将推送URL到百度、谷歌、Bing搜索引擎的功能整合至<a target="_blank" href="`https://github.com/yi-ge/submit-url`" title="" rel="external nofollow">submit-url</a>模块中。</p><p>模块支持两种方式调用，如果您使用的是海外服务器，且使用Node.js作为服务器端，可以通过<code>npm install submit-url</code>的方式安装该模块。否则，请运行模块作为HTTP服务，您的程序通过调用此HTTP API来提交网址，确保推送到谷歌和Bing搜索引擎的稳定。</p>]]></description><link>https://www.wyr.me/post/631</link><guid isPermaLink="false">https://www.wyr.me/post/631</guid><dc:creator><![CDATA[轶哥]]></dc:creator><pubDate>Tue, 04 Aug 2020 15:44:06 GMT</pubDate></item><item><title><![CDATA[PHP实现Github头像缓存]]></title><description><![CDATA[<p>在开发博客<code>Github登录</code>功能，缓存<code>Github头像</code>的时候，发现下载头像是个很费劲的事情。</p><p>利用位于HK的PHP虚拟主机，可以轻松解决这个问题。</p><p>伪静态依赖Apache的Rewrite模块。</p>]]></description><link>https://www.wyr.me/post/630</link><guid isPermaLink="false">https://www.wyr.me/post/630</guid><dc:creator><![CDATA[轶哥]]></dc:creator><pubDate>Tue, 21 Jul 2020 06:56:34 GMT</pubDate></item><item><title><![CDATA[解决XML报错：Input is not proper UTF-8, indicate encoding]]></title><description><![CDATA[<p>如果使用Chrome浏览器访问XML地址，返回报错信息：</p><pre><code>Input is not proper UTF-8, indicate encoding !Bytes: 0x08 0xE6 0xBA 0x90</code></pre><p>这是由于返回回来的数据存在ASCII<a target="_blank" href="https://baike.baidu.com/item/%E6%8E%A7%E5%88%B6%E5%AD%97%E7%AC%A6" title="" rel="external nofollow">控制字符</a>。XML规范不支持这部分控制字符。</p><p>这个报错提示是Chrome浏览器生成的报错，不是服务器端返回的报错。</p><p>关于该报错的详细信息请参阅：《<a target="_blank" href="https://learn.microsoft.com/en-us/troubleshoot/previous-versions/msxml/error-when-xml-contains-low-order-ascii" title="" rel="external nofollow">PRB: Error Message When an XML Document Contains Low-Order ASCII Characters</a>》。</p>]]></description><link>https://www.wyr.me/post/629</link><guid isPermaLink="false">https://www.wyr.me/post/629</guid><dc:creator><![CDATA[轶哥]]></dc:creator><pubDate>Mon, 20 Jul 2020 16:14:40 GMT</pubDate></item><item><title><![CDATA[玩客云刷OpenWRT]]></title><description><![CDATA[<p>玩客云是性价比极高的NAS，用来作单臂路由同样给力。玩客云作为单臂路由，可以在提供NAS功能的同时可以用来作为Web测试服务器、APP测试工具等。</p><p><em>很抱歉，不同的人对OpenWRT的用法不同，就像一把刀，有人用来切菜，有人用来行凶。因此，OpenWRT固件不提供，请自行查找。</em></p><h2>准备工作</h2><ul><li>下载玩客云OpenWRT固件、<a target="_blank" href="https://androidmtk.com/download-amlogic-usb-burning-tool" title="" rel="external nofollow">晶晨刷机工具 Amlogic USB Burning Tool</a>、晶晨s805Flash（与OpenWRT固件配套）。</li><li>公对公USB线。</li></ul>]]></description><link>https://www.wyr.me/post/628</link><guid isPermaLink="false">https://www.wyr.me/post/628</guid><dc:creator><![CDATA[轶哥]]></dc:creator><pubDate>Sun, 19 Jul 2020 16:11:37 GMT</pubDate></item><item><title><![CDATA[贝壳云P1刷OpenWrt教程]]></title><description><![CDATA[<p>贝壳云跟某讯N1配置接近，但是多了4个<code>USB3.0</code>接口，可以外接<code>USB3.0千兆网卡</code>，可玩性很高。</p><p>网传贝壳云P1跟某讯N1主要差异：</p><ul><li>散热</li><li>必须拆机焊接USB口才能刷机（引出USB线刷）</li></ul><p>经过实测，散热问题基本可以忽略。至于刷机，也不复杂，拆开焊个<code>USB公头</code>引出USB接线，再短接即可。</p><p>红米AC2100，因NAND闪存原因，使用第三方固件容易翻车。可以使用贝壳云搭配普通路由器实现无线功能，性价比极高。</p><blockquote><p>N1相关博文《<a target="_blank" href="https://www.wyr.me/post/625" title="" rel="external">N1刷OpenWRT及开启旁路由/单臂路由教程(Mac&amp;Win)</a>》</p></blockquote>]]></description><link>https://www.wyr.me/post/627</link><guid isPermaLink="false">https://www.wyr.me/post/627</guid><dc:creator><![CDATA[轶哥]]></dc:creator><pubDate>Wed, 10 Jun 2020 16:27:32 GMT</pubDate></item><item><title><![CDATA[快速对比Word文档差异小程序]]></title><description><![CDATA[<p>多次和某个乙方合作，对方在后续合作的合同中偷偷修改了部分条款，直到第五次合作的时候才发现合同内容已经被修改了🤦。</p><p>因此，昨天我编写了<code>Word对比</code>小程序，可以离线使用，快速对比聊天记录中两份Word文档的内容差异。</p><ol><li>本地处理数据，不上传服务器，文档不会被泄密。可开启飞行模式离线使用。</li><li>目前仅支持 .docx 格式的 Word 文档。</li><li>独家算法，请进入小程序后点击右上角添加到“我的小程序”以备不时之需。</li></ol>]]></description><link>https://www.wyr.me/post/626</link><guid isPermaLink="false">https://www.wyr.me/post/626</guid><dc:creator><![CDATA[轶哥]]></dc:creator><pubDate>Sun, 31 May 2020 05:47:47 GMT</pubDate></item><item><title><![CDATA[斐讯N1刷OpenWrt及开启旁路由/单臂路由教程(Mac&Win)]]></title><description><![CDATA[<p>经常被朋友安x，由于可玩性强近期涨价了，最终还是忍不住入手。真香！😂</p><h2>准备</h2><ul><li>公对公USB数据线</li><li>U盘</li><li>显示器 + USB鼠标 + HDMI线</li></ul><h2>原理</h2><p>N1默认系统是<code>Android</code>，不过开机只显示一个简单界面。</p><ol><li>先通过<code>adb</code>远程连接设备，然后发命令重启至<code>fastboot</code>模式，刷入<code>boot</code>、<code>bootloader</code>、<code>recovery</code>进行降级。</li><li>降级后使用U盘启动U盘中的<code>OpenWrt</code>系统（无需刷<code>Armbian</code>），然后使用<code>ssh</code>连接到设备，将U盘中的系统写入到<code>emmc</code>。</li></ol>]]></description><link>https://www.wyr.me/post/625</link><guid isPermaLink="false">https://www.wyr.me/post/625</guid><dc:creator><![CDATA[轶哥]]></dc:creator><pubDate>Thu, 28 May 2020 14:30:07 GMT</pubDate></item><item><title><![CDATA[MacOS安装无线网卡驱动通用方法]]></title><description><![CDATA[<p><a target="_blank" href="https://www.wyr.me/post/623" title="" rel="external">《Linux安装无线网卡驱动通用教程》</a>收到不少好评，本文归纳MacOS下安装WIFI驱动的常规操作。无论是<code>黑苹果</code>(<code>Hackintosh</code>)还是<code>白苹果</code>(<code>Real Mac</code>)，安装思路大体是一致的（仍需要谨慎辨别驱动兼容的环境）。</p>]]></description><link>https://www.wyr.me/post/624</link><guid isPermaLink="false">https://www.wyr.me/post/624</guid><dc:creator><![CDATA[轶哥]]></dc:creator><pubDate>Sun, 24 May 2020 14:29:29 GMT</pubDate></item><item><title><![CDATA[Linux安装无线网卡驱动通用方法]]></title><description><![CDATA[<p>本文将阐述Linux环境下安装WIFI驱动的常规思路。网络上绝大多数教程对新手极其不友好，现在咱们就用简单一点的方式来搞定无线网卡驱动安装。</p><p>本文的安装思路在<code>Ubuntu</code>、<code>Debian</code>、<code>Deepin</code>、<code>CentOS</code>、<code>Kali</code>等不同<code>Linux发行版</code>通用。无论使用<code>Raspberry Pi</code>、<code>Nano Pi</code>、<code>Orange Pi</code>等<code>ARM开发板</code>还是<code>x86</code>架构的设备，安装思路大体一致。</p>]]></description><link>https://www.wyr.me/post/623</link><guid isPermaLink="false">https://www.wyr.me/post/623</guid><dc:creator><![CDATA[轶哥]]></dc:creator><pubDate>Sun, 17 May 2020 15:43:16 GMT</pubDate></item><item><title><![CDATA[K个一组翻转链表]]></title><description><![CDATA[<p>LeetCode 25. K 个一组翻转链表 <a target="_blank" href="https://leetcode.cn/problems/reverse-nodes-in-k-group/" title="" rel="external nofollow">https://leetcode.cn/problems/reverse-nodes-in-k-group/</a><br>LintCode 450. K组翻转链表 <a target="_blank" href="https://www.lintcode.com/problem/reverse-nodes-in-k-group/" title="" rel="external nofollow">https://www.lintcode.com/problem/reverse-nodes-in-k-group/</a></p><p>这是一道用常规思路就能解的算法题。目标清晰、题目易懂，不涉及复杂的算法。</p><p>按照题目要求，遍历链表，遍历的同时每经过<code>k</code>个节点就进行一次翻转。需要注意的是，第一次翻转后，记录下整个链表的<code>head</code>作为返回值。从第二次翻转开始，需要将之前翻转过的最后一个结点与新翻转后的第一个结点相连。</p>]]></description><link>https://www.wyr.me/post/622</link><guid isPermaLink="false">https://www.wyr.me/post/622</guid><dc:creator><![CDATA[轶哥]]></dc:creator><pubDate>Sat, 16 May 2020 13:04:29 GMT</pubDate></item><item><title><![CDATA[树莓派4变身旁路由]]></title><description><![CDATA[<p>上篇文章轶哥介绍了<a target="_blank" href="https://www.wyr.me/post/620" title="" rel="external">树莓派4使用OTG功能变身有线网卡</a>的方法。今天我们就来实践让树莓派4变身路由器。（由于本文的「操作」不具备拨号功能，更适合作为旁路由使用。需要实现拨号请自行研究。😂）</p><p><em>2020年07月23日更新：树莓派可以直接安装OpenWRT作为旁路由，但是无法使用OTG有线网卡这个功能。</em></p><h2>让树莓派联网</h2><p><strong>无线：</strong> 使用<code>raspi-config</code>，设置<code>WIFI网络</code>，让树莓派联网。</p><p><strong>有线：</strong> 使用<code>raspi-config</code>，设置<code>WIFI网络</code>的国家，保存后按<code>Esc</code>退出安装界面，插入网线。</p><p>无论选择以上何种方式，请参考<a target="_blank" href="https://www.wyr.me/post/620" title="" rel="external">树莓派4使用OTG功能变身有线网卡</a>的方法将<code>Type-C接口</code>和电脑的<code>USB接口</code>相连，使用<code>OTG USB</code>网卡确保我们在树莓派中途断网的情况下也能通过<code>ssh root@raspberrypi.local</code>的方式连接到树莓派。</p>]]></description><link>https://www.wyr.me/post/621</link><guid isPermaLink="false">https://www.wyr.me/post/621</guid><dc:creator><![CDATA[轶哥]]></dc:creator><pubDate>Mon, 11 May 2020 16:47:33 GMT</pubDate></item><item><title><![CDATA[树莓派4使用OTG功能变身有线网卡]]></title><description><![CDATA[<p>本文介绍如何开启Raspberry Pi 4 USB OTG模式，让树莓派变身<code>有线网卡</code>。</p><p><img src="https://cdn.wyr.me/imgs/raspberry-pi4.webp?x-oss-process=image/interlace,1/format,jpg" alt="Raspberry4"></p><p>树莓派4相比之前的版本具备三倍的计算性能提升和高达4G的LPDDR4内存，自带双屏无线+蓝牙，千兆网扣，支持双屏4k，新增俩USB3.0，可玩性非常强。无风扇禁音，非常适合作为一个<code>边缘计算节点</code>、<code>旁路由</code>来使用。如果再开启NAT转发，即可实现的变身<code>有线网卡</code>的同时作为<code>无线网络接收器</code>、<code>路由器</code>来使用。</p><p>Raspberry 4 和 Raspberry Zero 一样，具备一个带OTG功能的USB接口（很遗憾Raspberry pi model B、Raspberry pi model B+、Raspberry pi 2 model B、Raspberry pi 3 model B、Raspberry pi 3 model B+均无USB OTG功能）。</p>]]></description><link>https://www.wyr.me/post/620</link><guid isPermaLink="false">https://www.wyr.me/post/620</guid><dc:creator><![CDATA[轶哥]]></dc:creator><pubDate>Sun, 10 May 2020 16:11:48 GMT</pubDate></item><item><title><![CDATA[小米路由器4免拆机刷OpenWrt教程]]></title><description><![CDATA[<p>小米路由器4 LAN口全千兆+5G Wifi，当时顺手买了这货，性价比蛮高。后面由于路由器升级，这货一直在吃灰。最近偶然看到它，发现网上的教程都是需要TTL线刷😂。其实不用线刷也能刷入<code>Openwrt</code>，特地记录下刷机过程。</p><p><strong>Root路由器</strong></p><p>使用网友开源方案<a target="_blank" href="https://github.com/acecilia/OpenWRTInvasion" title="" rel="external nofollow">OpenWRTInvasion</a>进行<code>Root</code>。</p><p>理论上此方案兼容：</p><ul><li>小米路由器4</li><li>小米路由器4A 千兆版</li><li>小米路由器4A 100M版</li><li>小米路由器4C</li><li>小米路由器4Q（R4C）</li><li>小米路由器3Gv2</li><li>小米路由器3C</li></ul>]]></description><link>https://www.wyr.me/post/619</link><guid isPermaLink="false">https://www.wyr.me/post/619</guid><dc:creator><![CDATA[轶哥]]></dc:creator><pubDate>Sun, 10 May 2020 15:13:46 GMT</pubDate></item><item><title><![CDATA[MacOS Chrome信任自签名证书]]></title><description><![CDATA[<p>升级MacOS到10.15.x以后，以往的Chrome信任自签名证书操作无效，信任后依然无法访问（“高级”选项里面没有继续访问的选项🤦）。网上找到的方法几乎都用不了😂。特地记录一下✅姿势。</p><p><strong>报错信息：</strong> 您的连接不是私密连接，攻击者可能会试图从 raspbian 窃取您的信息（例如：密码、通讯内容或信用卡信息）。NET::ERR_CERT_INVALID。</p><p><strong>特别提示：</strong> 本文<span style="color: red">仅限专业用户参考</span>。如果该证书不是您生成，或者您不知道自己在做什么，请勿尝试此文提示的操作，以免使您遭致损失。</p>]]></description><link>https://www.wyr.me/post/618</link><guid isPermaLink="false">https://www.wyr.me/post/618</guid><dc:creator><![CDATA[轶哥]]></dc:creator><pubDate>Tue, 05 May 2020 08:36:18 GMT</pubDate></item><item><title><![CDATA[Office(Word Excel PPT)转PDF-开放API]]></title><description><![CDATA[<p>大约5年前，我在做一个<code>云打印</code>的软硬件一体化项目，其中很关键的一步是通过API将客户发来的Office文档转换为PDF文档进行预览，然后再发送到对应的打印机进行打印，以<code>PDF预览</code>的方式来确保<code>所见即所得</code>。因此当时开发了此API，一直使用至今，历经数次迭代，如今已经很稳定。</p><p>现今免费将此API开放给大家进行使用（因服务器成本较高，不排除将来进行收费的可能。如若将进行收费，我会提前至少两个月联系您。即使收费，我承诺此API仅收取成本费用）。API部署在多地服务器，使用<code>阿里云API网关</code>进行中转。</p>]]></description><link>https://www.wyr.me/post/617</link><guid isPermaLink="false">https://www.wyr.me/post/617</guid><dc:creator><![CDATA[轶哥]]></dc:creator><pubDate>Mon, 04 May 2020 10:06:30 GMT</pubDate></item><item><title><![CDATA[Docker搭配免费SSL证书]]></title><description><![CDATA[<p>在<a target="_blank" href="https://www.wyr.me/post/614" title="" rel="external">MySQL定时备份程序</a>中我有提到一个基于Docker快速生成SSL证书的方式。该文章整理了该方案的详细教程。</p><p>基于<code>Let&#39;s Encrypt</code>免费SSL证书。</p>]]></description><link>https://www.wyr.me/post/616</link><guid isPermaLink="false">https://www.wyr.me/post/616</guid><dc:creator><![CDATA[轶哥]]></dc:creator><pubDate>Sat, 07 Mar 2020 15:39:33 GMT</pubDate></item><item><title><![CDATA[Windows应用以管理员权限开机自启（开源）]]></title><description><![CDATA[<p>在研发自助硬件设备的时候，需要实现Windows下的软件以管理员权限自启。</p><ol><li>Windows服务：需想办法调用UI进程。</li><li>NSSM：一个方便的服务封装程序。但以管理员权限启动UI进程较困难。</li><li>注册表：常见方法在最新版win10测试失败。可尝试抓取<code>Windows任务计划程序</code>对注册表的修改。</li></ol><p>测试了多种方法，发现最终可靠的方法是通过<code>Windows任务计划程序</code>进行注册。</p>]]></description><link>https://www.wyr.me/post/615</link><guid isPermaLink="false">https://www.wyr.me/post/615</guid><dc:creator><![CDATA[轶哥]]></dc:creator><pubDate>Sun, 16 Feb 2020 06:21:14 GMT</pubDate></item><item><title><![CDATA[开源MySQL定时备份系统]]></title><description><![CDATA[<p>自动获取 MySQL 数据库备份文件并将其上传到对象存储。</p><p><strong>Features</strong></p><ol><li>支持加密后压缩上传（默认上传到私密存储的“归档存储”类型，文件需解冻后方可下载）。</li><li>定时自动执行任务。</li><li>Web 可视化动态添加配置，支持同时管理多个数据库，可以设置需要备份的表或不需要备份的表。</li><li><del>支持生成单个 PHP 文件，用于仅内网可访问数据库或虚拟主机数据库的备份。</del></li><li><del>支持生成 Shell 文件，用于仅内网可访问数据库的备份。</del>（由于 Docker 部署已非常方便，这个功能不再开发）</li><li>支持 Swagger UI 查看 API，方便与其它系统整合。</li><li>支持<code>超级管理员</code>添加多个<code>普通管理员</code>，<code>超级管理员</code>可以管理所有数据库，<code>普通管理员</code>之间内容互不可见，适合普通开发团队的使用场景。</li><li>由于此系统仅为灾备设计，仅支持全量备份，默认备份<code>数据+结构</code>（包含视图、触发器等），不支持增量备份。如果您的数据非常重要，请勿将此作为唯一备份系统，可配合服务商提供的备份功能使用。</li><li>兼容支持手机端访问。</li></ol>]]></description><link>https://www.wyr.me/post/614</link><guid isPermaLink="false">https://www.wyr.me/post/614</guid><dc:creator><![CDATA[轶哥]]></dc:creator><pubDate>Sat, 15 Feb 2020 05:10:41 GMT</pubDate></item><item><title><![CDATA[通过 DigiSpark 实现 Windows 免密登录]]></title><description><![CDATA[<p>在新版的 Win10 中，微软添加了 <code>Windows Hello 人脸</code>、 <code>Windows Hello 指纹</code>、<code>安全密钥</code> 等登陆方式。对于不搭载专属配件的设备来说，实现任意一种免密登录的成本都比较高。而 <code>DigiSpark</code> 成本非常低，不到7元包邮，可以实现模拟键鼠。受<code>USB免密登录</code>的启发，通过 <code>DigiSpark</code> 实现 Windows 免密登录，可以做到 <code>移动密钥</code> 的效果 —— 插入即可免密登录，拔出则自动锁定设备。</p>]]></description><link>https://www.wyr.me/post/613</link><guid isPermaLink="false">https://www.wyr.me/post/613</guid><dc:creator><![CDATA[轶哥]]></dc:creator><pubDate>Tue, 12 Nov 2019 07:36:53 GMT</pubDate></item><item><title><![CDATA[Github 仓库迁移至 Gitea 脚本]]></title><description><![CDATA[<p>迁移 <code>github</code> 私有/公有仓库到 <code>gitea</code> 是一件容易的事情，不过可能由于网络原因，部分较大的项目可能会失败。此脚本会自动过滤已经迁移完成的仓库，因此重复执行脚本直至 <code>gitea</code> 中的仓库和 <code>github</code> 中的仓库数量一致，即表示迁移完成。<code>gitea</code> 迁移失败的仓库会被系统自动删除，因此可能出现仓库数量浮动。为了确保代码资产安全，您在迁移完成后应该间隔十分钟再次执行，直到 <code>gitea</code> 中的仓库和 <code>github</code> 中的仓库数量仍然一致。</p><p>需要注意，使用该脚本前，需创建一个<a target="_blank" href="https://github.com/settings/tokens" title="" rel="external nofollow">Github Token</a>，并且需要临时关闭<code>Two-factor authentication</code>。</p>]]></description><link>https://www.wyr.me/post/612</link><guid isPermaLink="false">https://www.wyr.me/post/612</guid><dc:creator><![CDATA[轶哥]]></dc:creator><pubDate>Wed, 12 Jun 2019 00:38:10 GMT</pubDate></item><item><title><![CDATA[Electron 应用分发系统（Electron自动更新）]]></title><description><![CDATA[<p><code>Electron 应用分发系统</code>提供应用程序编译（支持Windows、Linux、MacOS）、自动升级、分发服务。让<code>Electron</code>应用分发变得非常容易。</p><p><img src="https://github.com/yi-ge/electron-distribution/raw/master/preview.png" alt="Electron Distribution"></p><p>开源地址：<a target="_blank" href="https://github.com/yi-ge/electron-distribution" title="" rel="external nofollow">https://github.com/yi-ge/electron-distribution</a></p><p>使用时需要注意，一个<code>git</code>仓库需对应一个<code>Electron</code>应用程序，一个<code>Electron</code>应用程序对应需要部署一套应用分发系统。</p><p><code>Electron 应用分发系统</code>服务器端工作在64位Linux操作系统（必须）和MacOS（可选），默认编译x64应用程序, 其它平台及架构需要修改相应代码（不过这很容易实现）。</p>]]></description><link>https://www.wyr.me/post/611</link><guid isPermaLink="false">https://www.wyr.me/post/611</guid><dc:creator><![CDATA[轶哥]]></dc:creator><pubDate>Fri, 07 Jun 2019 15:11:41 GMT</pubDate></item><item><title><![CDATA[Node.js打印PDF文件]]></title><description><![CDATA[<p>在Windows平台，使用Node.js实现原生打印PDF通常需要借助C++。例如<a target="_blank" href="https://github.com/tojocky/node-printer" title="" rel="external nofollow">node-printer</a>，需要安装Python、Visual Studio，同时还需要使用<a target="_blank" href="https://github.com/tojocky/node-pdfium" title="" rel="external nofollow">node-pdfium</a>进行PDF转EMF。</p><p>也有一些二进制(exe)命令行打印解决方案，但是都有一些缺陷。</p><p><strong>例如：</strong></p><ul><li>借助 Adobe Reader 或 Acrobat 实现打印，则Windows XP、7、10需要安装不同版本的 DPF 软件，并且在打印时会打开该软件。</li><li>Sumatra PDF可以静默进行命令行打印，但是在80mm热敏纸打印机中的打印效果较差（不清晰）。</li></ul><p>理论上这些方案支持所有能在Windows中安装驱动的打印机，包括非串口的热敏纸打印机。大多数方案都是基于<a target="_blank" href="https://code.google.com/p/pdfium/" title="" rel="external nofollow">PDFium</a>的实现，如果您有足够的时间精力，可以深入研究<code>PDFium</code>。</p>]]></description><link>https://www.wyr.me/post/610</link><guid isPermaLink="false">https://www.wyr.me/post/610</guid><dc:creator><![CDATA[轶哥]]></dc:creator><pubDate>Sat, 23 Mar 2019 02:42:48 GMT</pubDate></item><item><title><![CDATA[MediaDevices设置音频输出设备]]></title><description><![CDATA[<p><a target="_blank" href="https://developer.mozilla.org/en-US/docs/Web/API/MediaDevices" title="" rel="external nofollow">MediaDevices</a> 为浏览器控制音频输入设备、音频输出设备、视频输入设备提供了接口。</p>]]></description><link>https://www.wyr.me/post/609</link><guid isPermaLink="false">https://www.wyr.me/post/609</guid><dc:creator><![CDATA[轶哥]]></dc:creator><pubDate>Sun, 10 Mar 2019 12:22:39 GMT</pubDate></item><item><title><![CDATA[JS推测Base64图片类型]]></title><description><![CDATA[<p>部分业务中会碰到Base64图片文本。</p><p>例如：</p><ul><li>微信JS-SDK - “拍照或从手机相册中选图接口”，wx.chooseImage与wx.request结合获取Base64数据。“获取本地图片接口”，wx.getLocalImgData返回Base64数据。</li><li>微信小程序中，图片访问地址受到白名单限制，有可能采用base64数据直接在接口返回。</li><li>某种读卡器获取到的图片数据以Base64格式返回。</li></ul><p>如果返回的图片数据中不包含格式前缀（<strong>甚至某个微信接口在ios中错误返回<code>image/jgp</code>类型</strong>），那就需要推测图片类型。</p>]]></description><link>https://www.wyr.me/post/608</link><guid isPermaLink="false">https://www.wyr.me/post/608</guid><dc:creator><![CDATA[轶哥]]></dc:creator><pubDate>Sat, 23 Feb 2019 14:21:25 GMT</pubDate></item><item><title><![CDATA[Electron 预加载远程页面提升用户体验]]></title><description><![CDATA[<h1>使用场景</h1><p>Electron 内置 <code>Chromium</code> 和 <code>Node.js</code>，为了提升用户体验，通常 Electron 封装的前端静态文件存储在客户端本地。但总有一些特殊情况，会使用到部分远程页面。</p><p>比如微信扫码登录，需要远程访问微信的登录站点，获得扫码结果后跳转到我们自己的服务器，然后通知到<code>主进程</code>来关闭对应的<code>渲染进程</code>。目前这个问题有更高效的解决方案，详见博文<a target="_blank" href="https://www.wyr.me/post/590" title="" rel="external">《无刷新微信扫码登陆解决方案》</a>。</p><p>再比如，部分页面还没有实现前后端分离，为了产品尽快上线，也需要嵌入远程URL。</p><p>直接在Electron中访问远程地址是有风险的，控制远程地址切回本地页面也是较为繁琐的。</p><p>以上需求可以使用<a target="_blank" href="https://www.electronjs.org/docs/latest/api/webview-tag" title="" rel="external nofollow">webview标签</a>实现。这是Electron为我们提供的一个特殊组件，类似于<code>iframe</code>但跟<code>iframe</code>不同，确保了应用的安全性。类似于<code>Android</code>、<code>ios</code>的<code>webview</code>或<code>Crosswalk</code>，Electron中的<code>webview</code>也支持和渲染进程相互通讯。</p>]]></description><link>https://www.wyr.me/post/607</link><guid isPermaLink="false">https://www.wyr.me/post/607</guid><dc:creator><![CDATA[轶哥]]></dc:creator><pubDate>Wed, 23 Jan 2019 12:44:32 GMT</pubDate></item><item><title><![CDATA[Node.js 网页截图服务 - 网页快照API]]></title><description><![CDATA[<p>Puppeteer 是 Headless Chrome Node API。也就是谷歌将Chrome无头浏览模式的接口封装成Node.js的API。利用Puppeteer实现网页截图/网页快照服务是非常容易的。</p><p><a target="_blank" href="https://github.com/yi-ge/webpage-capture" title="" rel="external nofollow">webpage-capture</a>是基于Puppeteer实现带权限认证（多APP授权）、配备消息队列管理的网页快照API。</p><p><strong>源代码：</strong><a target="_blank" href="https://github.com/yi-ge/webpage-capture" title="" rel="external nofollow">https://github.com/yi-ge/webpage-capture</a>.</p><p><strong>功能：</strong> 可对百万级网页数据进行截图采集的API服务。</p>]]></description><link>https://www.wyr.me/post/606</link><guid isPermaLink="false">https://www.wyr.me/post/606</guid><dc:creator><![CDATA[轶哥]]></dc:creator><pubDate>Sun, 13 Jan 2019 11:02:22 GMT</pubDate></item><item><title><![CDATA[创业之殇——管理]]></title><description><![CDATA[<p>最近一年，我一直在研究优秀的项目、写代码、学东西。</p><p>我也不知道为什么突然谈起<code>管理</code>这个话题。</p><h2>小公司也需要管理</h2><p>有人说“小公司最好没有管理，一定要做减法”。从某种角度上看或许是对的，“跟战略对口的人共事，团队成员一定要那种能够自我驱动的人”。</p><p>这个说法在几年前可能我会非常赞同，但是就现在看来，这话说得太绝对。</p><p>选人要看品质，但是“完全自我驱动的人，和完全需要踢着屁股往前走的人，是两个极端，现实中都是很少的(——格总在人间)”，<strong>有自驱动力的人也需要鼓励，也需要管理</strong>。</p><blockquote><p>如果有自我驱动力的员工，他的成绩没有得到认可，对他来说他的感觉可能就是：“<strong>每天都好像在考试，但是从来不公布分数</strong>。总是不知道自己做得好不好，也不知道以后会怎么样...” （节选来自插座学院创始人“何川”文章）。</p></blockquote><p>他没有安全感，也没有成就感。</p><p><strong>公司如果不能让好员工全心投入到工作中，就留不住好员工</strong>。</p><p>当你对即将离职的员工说：“你做的很好，你很优秀，我跟其他领导也一直在表扬你”这些话的时候，已经晚了。</p>]]></description><link>https://www.wyr.me/post/605</link><guid isPermaLink="false">https://www.wyr.me/post/605</guid><dc:creator><![CDATA[轶哥]]></dc:creator><pubDate>Sun, 06 Jan 2019 18:14:51 GMT</pubDate></item><item><title><![CDATA[PHP 7.3正式版+常见拓展的Docker镜像]]></title><description><![CDATA[<p>2018年12月6日PHP官方发布了<code>PHP 7.3.0 正式版</code>。恰逢最近在写一个PHP在线练习的网站，特意去翻了一下7.3.0正式版的Docker镜像。  </p><p>因为官方镜像只包含了最基本的模块，像<code>pdo_mysql</code>、<code>redis</code>之类的模块并没有包含进去。在<code>hub.docker.com</code>中找到一个相对比较合适的 PHP 7.2 版本的<code>Dockerfile</code>（<a target="_blank" href="https://hub.docker.com/r/phpdocker/phpdocker/" title="" rel="external nofollow">https://hub.docker.com/r/phpdocker/phpdocker/</a>），却发现作者将<code>MariaDB</code>、<code>Redis Server</code>、<code>Node.js</code>等内容给编进了Image。  </p><p>我比较喜欢干净的Docker Image，一个镜像只做一个事情。像<code>MySQL</code>、<code>Redis</code>之类的数据库，可以单独启动相应的模块。  </p><p>因此我在前人的基础上，移除了<code>MariaDB</code>、<code>Redis Server</code>、<code>Node.js</code>并升级PHP版本到7.3.0正式版。  </p>]]></description><link>https://www.wyr.me/post/604</link><guid isPermaLink="false">https://www.wyr.me/post/604</guid><dc:creator><![CDATA[轶哥]]></dc:creator><pubDate>Sun, 06 Jan 2019 12:43:12 GMT</pubDate></item><item><title><![CDATA[树莓派挂载硬盘Shell脚本]]></title><description><![CDATA[<p>快速挂载Raspberry PI硬盘，可挂载USB硬盘。<br>注意：此脚本一次性将硬盘整个空间分为一个区，格式化为ext4格式，如果需要分多个区请手工操作。</p><blockquote><p>理论上此脚本适合大部分Linux系统，不推荐在服务器中使用这样的脚本。</p></blockquote>]]></description><link>https://www.wyr.me/post/603</link><guid isPermaLink="false">https://www.wyr.me/post/603</guid><dc:creator><![CDATA[轶哥]]></dc:creator><pubDate>Mon, 31 Dec 2018 10:39:25 GMT</pubDate></item><item><title><![CDATA[桌面字幕——实时语音识别]]></title><description><![CDATA[<p>这是一个基于阿里云实时语音转写实现的桌面字幕。</p><p>代码实现非常简单，根据阿里云开发文档里面的demo代码复制粘贴就完成了。使用 <code>JavaFx</code> 实现透明窗口 + Label。</p><p>实时语音识别的效果不错，可以用于录制教学视频。</p><p>源代码：<a target="_blank" href="https://github.com/yi-ge/desktop-subtitle" title="" rel="external nofollow">https://github.com/yi-ge/desktop-subtitle </a></p>]]></description><link>https://www.wyr.me/post/602</link><guid isPermaLink="false">https://www.wyr.me/post/602</guid><dc:creator><![CDATA[轶哥]]></dc:creator><pubDate>Sat, 22 Dec 2018 04:08:09 GMT</pubDate></item><item><title><![CDATA[解决 Rancher 2 卸载后无法重新运行的问题]]></title><description><![CDATA[<p>因某些原因需要重装<code>Rancher 2</code>，本想着运行在docker中的系统应该很容易重装。但是重装后出现了很多报错。</p><p>一个<code>Rancher</code>集群需要<code>Etcd</code>、<code>Control</code>、<code>Worker</code>三个角色都正常运行，该集群才能正常工作。其中<code>Worker</code>代表执行任务的服务器，<code>Etcd</code>和<code>Control</code>服务至少部署一个。</p><p>重装后<code>Etcd</code>、<code>Control</code>服务均出现报错。</p><h3>报错详情</h3><p>其中<code>Control</code>则是<code>kube-apiserver</code>容器报<code>Unable to create storage</code>，报错类似：</p>]]></description><link>https://www.wyr.me/post/601</link><guid isPermaLink="false">https://www.wyr.me/post/601</guid><dc:creator><![CDATA[轶哥]]></dc:creator><pubDate>Fri, 07 Dec 2018 10:10:07 GMT</pubDate></item><item><title><![CDATA[记一次服务器启动修复 - /etc/fstab错误至系统无法启动]]></title><description><![CDATA[<p>利用RK3399作为ARM微型服务器是非常有趣的事情。然而总有一些意外来得令人措手不及。</p><p>事情是这样的。我在服务器中挂载了三块SSD硬盘，其中两块是放于USB硬盘盒，通过Type-C和USB3.0接口连接。</p><h3>开机自动挂载</h3><p>我们先看一下开机自动挂载方案。</p><p>查询分区的Block ID：</p><pre><code class="language-bash">blkid /dev/sda1/dev/sda1: UUID=&quot;7f50f85e-783c-4d94-be37-d2c662504e58&quot; TYPE=&quot;ext4&quot;</code></pre><p>然后把 Block ID 添加到<code>/etc/fstab</code>文件中，这是我的<code>fstab</code>文件：</p><pre><code class="language-bash">UUID=a848d601-91ac-4b5c-8ce3-ffef674f5dd5 /nvme ext4 defaults 0 0UUID=88eb8df2-1a8f-4f38-acc9-566deb1c8f40 /tf ext4 defaults 0 0UUID=7f50f85e-783c-4d94-be37-d2c662504e58 /ssd0 ext4 defaults 0 0UUID=e66307fc-2c33-406b-ae60-b27e2344d02a /ssd1 ext4 defaults 0 0</code></pre><h3>事情是这样开始的</h3><p>我在检查硬盘状态的时候，发现其中一块硬盘没有进行4k对齐。然后我对该硬盘进行了重新分区。结果服务器就卡死了！?</p><p>当我重启服务器后，一直连不上SSH。</p><p>插入HDMI，显示器一片黑暗！</p><p>如果是X86架构的服务器，挂载<code>/etc/fstab</code>失败后会进入高级模式，可以通过接入显示器解决，但是ARM架构（或者说我这块板子）的系统并没有提供这样的后悔药。</p><p>x86系统可以进入光盘Linux，然后挂载硬盘改写<code>/etc/fstab</code>文件。但是我的系统烧写在eMMC，即便能在SD卡刷机，通过SD卡引导系统并挂载eMMC硬盘也是非常有挑战的事情。</p>]]></description><link>https://www.wyr.me/post/600</link><guid isPermaLink="false">https://www.wyr.me/post/600</guid><dc:creator><![CDATA[轶哥]]></dc:creator><pubDate>Sat, 24 Nov 2018 15:35:41 GMT</pubDate></item><item><title><![CDATA[配置自动续期的免费通配符SSL证书]]></title><description><![CDATA[<p>公益SSL证书机构<code>Let’s Encrypt</code>从2018-03-13起开始支持通配符证书。通配符证书必须通过DDNS添加TXT记录验证域名所属权。</p><ol><li><p>照<a target="_blank" href="https://certbot.eff.org/" title="" rel="external nofollow"> certbot官网</a>安装certbot。</p></li><li><p>安装DNS插件</p><p> <code>cerbot</code>支持很多<a target="_blank" href="https://eff-certbot.readthedocs.io/en/latest/using.html" title="" rel="external nofollow">DNS插件</a>，例如：  </p><pre><code class="language-bash">certbot-dns-cloudflarecertbot-dns-cloudxnscertbot-dns-digitalocean...</code></pre><p> 这里以DNSPOD（腾讯云域名默认DNS）为例：</p><pre><code class="language-bash">git clone https://github.com/tengattack/certbot-dns-dnspodcd certbot-dns-dnspodsudo python setup.py install</code></pre></li></ol>]]></description><link>https://www.wyr.me/post/599</link><guid isPermaLink="false">https://www.wyr.me/post/599</guid><dc:creator><![CDATA[轶哥]]></dc:creator><pubDate>Wed, 14 Nov 2018 11:22:21 GMT</pubDate></item><item><title><![CDATA[Nginx 解决API跨域问题]]></title><description><![CDATA[<p><strong>利用Nginx可以最简单且高效解决跨域问题。</strong></p><p>跨域是前后端分离开发中非常常见的问题。这个问题网上已经有非常多的答案，但大部分是编程框架里面添加CORS头。但无论用什么Web框架，现已很难离开<code>Nginx</code>。因此直接在<code>Nginx</code>中处理跨域问题有得天独厚的优势，可以将<code>OPTIONS</code>请求拦截在API服务之前，节约服务器开销。</p><p>简单说，跨域分为<code>简单跨域</code>和<code>复杂跨域</code>。</p><p><code>简单跨域</code>不会发送<code>OPTIONS</code>请求。</p><p><code>复杂跨域</code>会发送一个预检查<code>OPTIONS</code>请求。</p><p><code>复杂跨域</code>的条件是：</p><ol><li>非GET、HEAD、POST请求。</li><li>POST请求的<code>Content-Type</code>不是<code>application/x-www-form-urlencoded</code>, <code>multipart/form-data</code>, 或<code>text/plain</code>。</li><li>添加了自定义header，例如<code>Token</code>。</li></ol><p><strong>跨域请求浏览器会在Headers中添加<code>Origin</code>，通常情况下不允许用户修改其值。</strong>  </p>]]></description><link>https://www.wyr.me/post/598</link><guid isPermaLink="false">https://www.wyr.me/post/598</guid><dc:creator><![CDATA[轶哥]]></dc:creator><pubDate>Wed, 14 Nov 2018 08:27:47 GMT</pubDate></item><item><title><![CDATA[Vue SSR（ Vue2 + Koa2 + Webpack4）配置指南]]></title><description><![CDATA[<p>正如Vue官方所说，SSR配置适合已经熟悉 Vue, webpack 和 Node.js 开发的开发者阅读。请先移步 <a target="_blank" href="https://ssr.vuejs.org" title="" rel="external nofollow">ssr.vuejs.org</a> 了解手工进行SSR配置的基本内容。  </p><p>从头搭建一个服务端渲染的应用是相当复杂的。如果您有SSR需求，对Webpack及Koa不是很熟悉，请直接使用<a target="_blank" href="https://nuxt.com/" title="" rel="external nofollow">NUXT.js</a>。  </p><p>本文所述内容示例在 <code>Vue SSR Koa2 脚手架</code>：<a target="_blank" href="https://github.com/yi-ge/Vue-SSR-Koa2-Scaffold" title="https://github.com/yi-ge/Vue-SSR-Koa2-Scaffold" rel="external nofollow">https://github.com/yi-ge/Vue-SSR-Koa2-Scaffold </a>  </p><p>我们以撰写本文时的最新版：Vue 2，Webpack 4，Koa 2为例。</p><p><strong>特别说明</strong><br>此文描述的是API与WEB同在一个项目的情况下进行的配置，且API、SSR Server、Static均使用了同一个Koa示例，目的是阐述配置方法，所有的报错显示在一个终端，方便调试。  </p>]]></description><link>https://www.wyr.me/post/593</link><guid isPermaLink="false">https://www.wyr.me/post/593</guid><dc:creator><![CDATA[轶哥]]></dc:creator><pubDate>Sun, 11 Nov 2018 16:28:16 GMT</pubDate></item><item><title><![CDATA[巧用Koa接管“对接微信开发”的工作 - 多用户微信JS-SDK API服务]]></title><description><![CDATA[<p>涉及微信开发的技术人员总会面对一些“对接”工作，每当做好一个产品卖给对方的时候，都需要程序员介入进行一些配置。例如：</p><ol><li><p>使用“微信JS-SDK”的应用，我们需要添加微信公众号“JS接口安全域名”。</p></li><li><p>为了解决微信页面安全提示，我们需要添加微信公众号“业务域名”。</p></li><li><p>为了在小程序中使用WebView页面，我们需要添加微信小程序“业务域名”。</p></li></ol><p>以上三种情况都不是简单的将域名填入到微信管理后台，而是需要下载一个txt文件，保存到服务器根目录，能够被微信服务器直接访问，才能正常保存域名。  </p><p>如果只需要对接一个或几个应用，打开Nginx配置，如下添加：</p><pre><code class="language-ruby">location /YGCSYilWJs.txt {    default_type text/html;    return 200 &#39;78362e6cae6a33ec4609840be35b399b&#39;;}</code></pre><p>假如有几十个甚至几百个项目需要接入?。  </p><p><strong>让我们花20分钟彻底解决这个问题。</strong>  </p><p>进行域名泛解析：<code>*.abc.com</code> -&gt; 服务器，反向代理根目录下<code>.txt</code>结尾的请求。顺便配置一下通配符SSL证书（网上有免费版本）。</p>]]></description><link>https://www.wyr.me/post/592</link><guid isPermaLink="false">https://www.wyr.me/post/592</guid><dc:creator><![CDATA[轶哥]]></dc:creator><pubDate>Wed, 07 Nov 2018 17:18:31 GMT</pubDate></item><item><title><![CDATA[MacOS Mojave 10.14 (18A391) Nvidia Web Driver Notice]]></title><description><![CDATA[<p>由于 MacOS Mojave 10.14 (18A391) 版本的 NVIDIA 显卡 WEB 驱动一直没有发布，其中缘由不能说。因此忙里抽闲用PHP迅速的搭建了一个监控平台，并做成多用户版本。  </p><p>系统每隔15s会自动检测一次列表，如果发现有新版本发布，则会发送邮件及手机短信通知，方便广大N卡用户。  </p><p>访问地址：<a target="_blank" href="https://driver.wyr.me" title="" rel="external">https://driver.wyr.me</a>，填入邮箱或手机号即可。  </p><p>手机短信收取成本费0.5元人民币，源代码开源：<a target="_blank" href="https://github.com/yi-ge/mac-nvidia-web-driver-notice" title="" rel="external nofollow">https://github.com/yi-ge/mac-nvidia-web-driver-notice</a>  </p>]]></description><link>https://www.wyr.me/post/591</link><guid isPermaLink="false">https://www.wyr.me/post/591</guid><dc:creator><![CDATA[轶哥]]></dc:creator><pubDate>Fri, 19 Oct 2018 17:46:46 GMT</pubDate></item><item><title><![CDATA[无刷新微信扫码登陆解决方案]]></title><description><![CDATA[<p>数天前，为解决微信二维码扫码登陆在Electorn跳转处理繁琐的问题，写一个微信开放平台扫码登陆解析处理工具😊，将frame数据处理为图片或Base64图片数据返回客户端进行扫码。<del>解决Chrome70中open.weixin.qq.com腾讯SSL证书不被信任的问题</del>(微信官方于2018年8月23日更换了域名证书)，解决Chrome68中frame跨域被拦截的问题。</p><p><code>此方案最大特点</code>：<strong>扫码登录无跳转</strong>🤠。</p><p><code>Node.js 版本 Demo</code>：<a target="_blank" href="https://weixin.openapi.site/demo" title="" rel="external nofollow">https://weixin.openapi.site/demo</a></p><p><code>PHP 版本 Demo</code>：<a target="_blank" href="https://apio.xyz/weixin-login-php/" title="" rel="external nofollow">https://apio.xyz/weixin-login-php/</a></p><h2>须知</h2><p>  此方案仅适用于<code>微信开放平台</code>-<code>网站应用</code>。</p>]]></description><link>https://www.wyr.me/post/590</link><guid isPermaLink="false">https://www.wyr.me/post/590</guid><dc:creator><![CDATA[轶哥]]></dc:creator><pubDate>Sun, 02 Sep 2018 14:22:10 GMT</pubDate></item><item><title><![CDATA[Node.js 获取项目根目录]]></title><description><![CDATA[<p>介绍一个非常实用的小技巧获取node.js项目根目录</p><p>假设我们的js文件写在server目录中，但是我们的资源文件存储在app/img目录中。如下图，我们需要在server/index.js文件中使用fs读取app/img/favicon.ico文件。</p><p><img src="https://cdn.wyr.me/wp-content/uploads/2016/05/%E8%8E%B7%E5%8F%96node%E9%A1%B9%E7%9B%AE%E6%A0%B9%E7%9B%AE%E5%BD%95.png" alt="获取node项目根目录"></p><p>在node.js只提供了一个<code>__dirname</code>全局变量。通过<code>__dirname</code>可以获得<code>“C:\wwwroot\yidata\server”</code>。这时需要用到path。</p>]]></description><link>https://www.wyr.me/post/582</link><guid isPermaLink="false">https://www.wyr.me/post/582</guid><dc:creator><![CDATA[轶哥]]></dc:creator><pubDate>Fri, 06 May 2016 07:22:23 GMT</pubDate></item><item><title><![CDATA[Node.js6 报Unexpected token import错误解决方案]]></title><description><![CDATA[<p>&emsp;&emsp;虽然Node.js6这个版本已经能够支持96%的ECMAScript 2015 (ES6)，但是仍然不支持import。关于Node.js各个版本对ES6的支持可以浏览这个网站:<a target="_blank" href="https://node.green/" title="" rel="external nofollow">https://node.green/</a></p><p>&emsp;&emsp;Node.js 6 中可以启用ES6功能。在node命令后面加上“--es_staging”或“--harmony”就好。</p>]]></description><link>https://www.wyr.me/post/575</link><guid isPermaLink="false">https://www.wyr.me/post/575</guid><dc:creator><![CDATA[轶哥]]></dc:creator><pubDate>Thu, 05 May 2016 14:49:06 GMT</pubDate></item><item><title><![CDATA[小技巧解决Windows To Go新机驱动问题]]></title><description><![CDATA[<p>&emsp;&emsp;使用Windows To Go的体验比Ubuntu To Go要好得多。特别是加密U盘/移动硬盘的功能很实用。然而无论是Windows To Go还是Ubuntu To Go都无法避免在新机子中移动使用需要安装驱动的问题。欣慰的是在Windows To Go中微软专门针对移动使用定制了部分功能，然而还是无法完美安装所有驱动。特别是在某些win10平板中，几乎有数十个无法识别的驱动（ 设备管理器中的感叹号）。怎么办呢？安装带网卡的驱动人生和驱动精灵？不，这个方法太Low了。</p><p>&emsp;&emsp;对于高手，驱动缺失的第一个反应是去官网找驱动，搜芯片型号。然而很多驱动你根本找不出来，特别是定制性的。这些驱动有个特点，就是驱动人生和驱动精灵也无法识别。</p><p>&emsp;&emsp;这里有一个小技巧，如果Windows To Go的目标主机和Windows To Go中安装的操作系统版本相近，位数相同，那么可以通过原有驱动直接安装。Windows10 To Go和Windows8 To Go均适用。</p>]]></description><link>https://www.wyr.me/post/549</link><guid isPermaLink="false">https://www.wyr.me/post/549</guid><dc:creator><![CDATA[轶哥]]></dc:creator><pubDate>Wed, 04 May 2016 00:46:09 GMT</pubDate></item><item><title><![CDATA[EA6500 V2/EA6700 散热改善，加装散热风扇]]></title><description><![CDATA[<p>&emsp;&emsp;EA6500 V2的CPU发热严重，最高温度可达104°（如上图）。别说煮鸡蛋了，烧水都没问题了。给EA6500 V2/EA6700加装风扇我不是第一个，网友“啥都不会”早在14年10月就已经成功安装过了。</p><p>&emsp;&emsp;本文仅仅说明可以用5V风扇，而且可以控制是否启用。焊接点如下——USB电源接口。</p>]]></description><link>https://www.wyr.me/post/542</link><guid isPermaLink="false">https://www.wyr.me/post/542</guid><dc:creator><![CDATA[轶哥]]></dc:creator><pubDate>Tue, 03 May 2016 10:15:12 GMT</pubDate></item><item><title><![CDATA[EA6500 V2/EA6700 安装 Tomato 实现双WAN双拨负载均衡]]></title><description><![CDATA[<p>  本文介绍了使用EA6500 V2/EA6700 安装 Tomato 实现双WAN双拨负载均衡的方法。需要对设备进行刷机，具体教程请点击下方阅读全文查阅。</p>]]></description><link>https://www.wyr.me/post/533</link><guid isPermaLink="false">https://www.wyr.me/post/533</guid><dc:creator><![CDATA[轶哥]]></dc:creator><pubDate>Mon, 02 May 2016 16:56:48 GMT</pubDate></item><item><title><![CDATA[EA6500 V2/EA6700 TTL刷机教程 - 救机]]></title><description><![CDATA[<p>&emsp;&emsp;一不小心把今早刚刚买的EA6500 V2路由器刷砖了，心急了，提前断电?。ok，上TTL。</p><p>&emsp;&emsp;本文介绍了TTL刷机方法，请点击下方阅读全文浏览。</p>]]></description><link>https://www.wyr.me/post/517</link><guid isPermaLink="false">https://www.wyr.me/post/517</guid><dc:creator><![CDATA[轶哥]]></dc:creator><pubDate>Mon, 02 May 2016 08:02:54 GMT</pubDate></item><item><title><![CDATA[基于Docker部署Node.js应用环境]]></title><description><![CDATA[<p>&emsp;&emsp;利用Docker部署的服务器环境已经成为目前主流。为了实现高负载、易于拓展，我们采用Nginx作为反代，Redis记录访问日志。（主机服务器环境：CentOS7.3，2017年05月02日19:57:08更新）</p><h3>1、安装并启动Docker</h3><h4>1. 设置仓库</h4><p>&emsp;&emsp;在CentOS中设置Docker CE的仓库地址。</p><pre><code>sudo yum install -y yum-utilssudo yum-config-manager \    --add-repo \    https://download.docker.com/linux/centos/docker-ce.reposudo yum makecache fast</code></pre>]]></description><link>https://www.wyr.me/post/425</link><guid isPermaLink="false">https://www.wyr.me/post/425</guid><dc:creator><![CDATA[轶哥]]></dc:creator><pubDate>Thu, 28 Apr 2016 06:07:25 GMT</pubDate></item><item><title><![CDATA[Ubuntu引导错误修复 - EFI]]></title><description><![CDATA[<p>&emsp;&emsp;如果安装ubuntu后启动报错：“Reboot and Select proper Boot device or Insert Boot Media in selected Boot device”。（Ubuntu 16.04）解决方案：插上U盘或CD，进入Try Ubuntu模式。使用<code>sudo fdisk -l</code>查看你的Ubuntu安装在哪里。例如：/dev/sda1，对应修改以下命令执行。<span style="color: #ff0000;"><strong>注意</strong>：不要选择EFI分区！</span></p><pre><code>sudo mount /dev/sda1 /mntsudo apt-get updatesudo apt-get install grub</code></pre><p>&emsp;&emsp;接下来修复引导：</p><pre><code>sudo grub-install /dev/sda --root-directory=/mnt</code></pre>]]></description><link>https://www.wyr.me/post/489</link><guid isPermaLink="false">https://www.wyr.me/post/489</guid><dc:creator><![CDATA[轶哥]]></dc:creator><pubDate>Wed, 20 Apr 2016 05:20:42 GMT</pubDate></item><item><title><![CDATA[JAVA入门 - ArrayList - 产生随机数后去除重复]]></title><description><![CDATA[<p>&emsp;&emsp;三个简单的JAVA练习题。</p><ol><li>建立一个元素类型java.util.Date的线性表，并在表中加入3个日期对象。</li><li>定义一个代表人员的类Person，含有三个数据成员（姓名，性别，年龄）。用TreeSet&lt;Person&gt;存储三个对象。</li><li>产生0-99的随机数100个，去掉重复的，还有多少个相互不同的数？</li></ol>]]></description><link>https://www.wyr.me/post/484</link><guid isPermaLink="false">https://www.wyr.me/post/484</guid><dc:creator><![CDATA[轶哥]]></dc:creator><pubDate>Tue, 19 Apr 2016 12:01:18 GMT</pubDate></item><item><title><![CDATA[在U盘中安装Ubuntu 16.04 - 制作Ubuntu To Go]]></title><description><![CDATA[<p>&emsp;&emsp;制作Ubuntu To Go首先要下载好Ubuntu安装镜像，准备好一个用于安装Ubuntu系统的U盘。这个U盘不是所有U盘都可以的，我建议使用M.2 SSD + 硬盘盒，原因请看下面的速度测评。</p><p>&emsp;&emsp;更多内容请点击下方查看全文按钮浏览。</p>]]></description><link>https://www.wyr.me/post/466</link><guid isPermaLink="false">https://www.wyr.me/post/466</guid><dc:creator><![CDATA[轶哥]]></dc:creator><pubDate>Mon, 18 Apr 2016 14:03:27 GMT</pubDate></item><item><title><![CDATA[使用U盘安装Ubuntu 16.04]]></title><description><![CDATA[<h4>制作启动U盘启动盘</h4><p>&emsp;&emsp;先找一个8G及以上大小的U盘。</p><p>&emsp;&emsp;下载并安装UltraISO，如图选择“打开”，选择安装镜像（本文使用Ubuntu 16.04）。</p><p>&emsp;&emsp;更多内容请点击下方阅读全文按钮。</p>]]></description><link>https://www.wyr.me/post/446</link><guid isPermaLink="false">https://www.wyr.me/post/446</guid><dc:creator><![CDATA[轶哥]]></dc:creator><pubDate>Sun, 17 Apr 2016 04:20:53 GMT</pubDate></item><item><title><![CDATA[Ubuntu引导错误修复 - i386]]></title><description><![CDATA[<p>&emsp;&emsp;如果在制作Ubuntu To Go或安装Ubuntu出现“error: file &#39;/grub/i386-pc/normal.mod&#39; not found”的报错，可以进入LiveCD模式进行引导的安装。  </p><p>&emsp;&emsp;插上U盘或CD，进入Try Ubuntu模式。</p>]]></description><link>https://www.wyr.me/post/442</link><guid isPermaLink="false">https://www.wyr.me/post/442</guid><dc:creator><![CDATA[轶哥]]></dc:creator><pubDate>Sun, 17 Apr 2016 03:17:16 GMT</pubDate></item><item><title><![CDATA[Failed to create shortcut to bash.exe 问题解决方案]]></title><description><![CDATA[<p>&emsp;&emsp;如果在安装Bash on Ubuntu on Windows的时候没有以管理员方式运行“bash”命令，那么可能导致安装报“Failed to create shortcut to bash.exe”的错误。出现这个错误，说明Bash on Ubuntu on Windows的快捷方式没有被正确安装。此时会导致“开始-&gt;bash”无法正常找到。</p>]]></description><link>https://www.wyr.me/post/434</link><guid isPermaLink="false">https://www.wyr.me/post/434</guid><dc:creator><![CDATA[轶哥]]></dc:creator><pubDate>Wed, 13 Apr 2016 07:45:31 GMT</pubDate></item><item><title><![CDATA[Ubuntu安装无线网卡驱动 Wifi/BT BCM4330 (AP6383)]]></title><description><![CDATA[<p>&emsp;&emsp;像BCM4330 (AP6383)这样的Wifi/蓝牙一体化芯片常见于一些平板电脑、笔记本和mini pc中。特别是z3735、z8300、core m这些芯片的平板电脑很常见。AP6210也比较常见，但目前暂未解决其驱动问题。</p><p>&emsp;&emsp;如何在搭载这样芯片的设备中安装Linux驱动呢？Ubuntu16.04版本的内核中仍然没有封装对应驱动（Ps：貌似Intel和Ubuntu合作，Intel NUC可以完美安装Ubuntu）。</p>]]></description><link>https://www.wyr.me/post/392</link><guid isPermaLink="false">https://www.wyr.me/post/392</guid><dc:creator><![CDATA[轶哥]]></dc:creator><pubDate>Fri, 08 Apr 2016 04:32:29 GMT</pubDate></item><item><title><![CDATA[Ubuntu 16.04 安装搜狗输入法]]></title><description><![CDATA[<p>&emsp;&emsp;在Ubuntu 14.04以上版本中安装搜狗输入法存在一些问题导致安装失败，这些问题主要是由依赖项和字体引起的。主要是fonts-droid这个字体，非常坑。</p><p>&emsp;&emsp;首先从官网下载搜狗输入法 For Linux的deb安装包。再<a href="http://pan.baidu.com/s/1miSwbBa" target="_blank">点击此处</a>下载fonts-droid字体deb安装包(密码: 1r2e)。</p>]]></description><link>https://www.wyr.me/post/385</link><guid isPermaLink="false">https://www.wyr.me/post/385</guid><dc:creator><![CDATA[轶哥]]></dc:creator><pubDate>Mon, 04 Apr 2016 18:56:11 GMT</pubDate></item><item><title><![CDATA[Node.js HTTP Web 静态资源服务器代码]]></title><description><![CDATA[<p>&emsp;&emsp;使用Node.js模拟一个Nginx/Apache静态文件服务器，可以直接运行HTML及JavaScript、各类图片。具体代码请点击下方阅读全文。</p>]]></description><link>https://www.wyr.me/post/370</link><guid isPermaLink="false">https://www.wyr.me/post/370</guid><dc:creator><![CDATA[轶哥]]></dc:creator><pubDate>Fri, 05 Feb 2016 13:40:13 GMT</pubDate></item><item><title><![CDATA[ASP.NET 5 MVC 6 Web API JSON序化]]></title><description><![CDATA[<p>&emsp;&emsp;ASP.NET 5 MVC 6 Web API （C#）默认支持自动序化XML和JSON格式数据。然而自动序化的JSON数据在很多方面是存在问题的，比如部分符号和JSON字符串数组的问题。</p><h3>输出符合JavaScript标准的JSON字符串</h3><p>&emsp;&emsp;目前比较适合正式生产场合的、不容易出现错误的解决方案是自行序化。尽管ASP.NET WEB API已经具备自动序化的能力，但序化出来的内容并不能完全符合JavaScript规范，比如中文不能够很好的进行unicode转换，部分数值未以字符串方式输出（没有引号，或者变成了单引号）。为了避免出现结果差异，我们默认将所有数据都转换为字符串或字符串数组，再由JavaScript自动将数据转换成对应的类型。</p>]]></description><link>https://www.wyr.me/post/362</link><guid isPermaLink="false">https://www.wyr.me/post/362</guid><dc:creator><![CDATA[轶哥]]></dc:creator><pubDate>Tue, 02 Feb 2016 06:00:34 GMT</pubDate></item><item><title><![CDATA[ASP.NET 5 MVC 6 Web API 上传图片]]></title><description><![CDATA[<p>&emsp;&emsp;使用ASP.NET 5 MVC 6 编写 Web API的代码和老版本的有很大区别。特别在连接数据库、图片上传下载等问题上非常难处理。主要原因是新版本中很多类的用法产生变更。</p><p>&emsp;&emsp;ASP.NET 5 及 EF7（Entity Framework 7）可以跨平台的新特性使得Linux服务器更能大展身手。但随之而来的便是运维难度的加大和编程人员的“再学习”成本。</p>]]></description><link>https://www.wyr.me/post/354</link><guid isPermaLink="false">https://www.wyr.me/post/354</guid><dc:creator><![CDATA[轶哥]]></dc:creator><pubDate>Wed, 27 Jan 2016 13:18:56 GMT</pubDate></item><item><title><![CDATA[平板电脑安装Ubuntu教程-以V975w为例，Z3735系列CPU通用]]></title><description><![CDATA[<p>  最近尝试在昂达V975w平板电脑和intel stick中安装ubuntu，经过分析，发现存在一个非常大的坑。但因为这个坑，此教程适合大部分平板电脑、电脑棒、intel nuc设备安装Ubuntu。</p>]]></description><link>https://www.wyr.me/post/316</link><guid isPermaLink="false">https://www.wyr.me/post/316</guid><dc:creator><![CDATA[轶哥]]></dc:creator><pubDate>Thu, 17 Dec 2015 15:30:34 GMT</pubDate></item><item><title><![CDATA[PHP连接数据库进行增删查改-PDO方法-以MySQL为例]]></title><description><![CDATA[<p>&emsp;&emsp;由于PHP6中将默认以PDO方法连接数据库，而PDO方法优点很多，因此此文仅介绍PDO方法连接数据库进行操作。需要注意，从 PHP 5.1 开始附带了 PDO，在 PHP 5.0 中是作为一个 PECL 扩展使用，在生产环境中强烈建议升级到PHP5.4+版本。</p><h5>PDO操作数据库的主要优点</h5><ul><li>支持多种数据库（只要提供正确的数据源，其它的数据库操作是一样的）。</li><li>开发效率更高，便于移植。</li><li>对事务处理支持更好，特别是事务回滚。</li><li>更为安全。</li></ul>]]></description><link>https://www.wyr.me/post/302</link><guid isPermaLink="false">https://www.wyr.me/post/302</guid><dc:creator><![CDATA[轶哥]]></dc:creator><pubDate>Sat, 28 Nov 2015 05:50:46 GMT</pubDate></item><item><title><![CDATA[C#扫描在线IP源代码-多媒体教室、公司内网管理IP搜索]]></title><description><![CDATA[<p>&emsp;&emsp;今天上C#课时机子IP地址冲突，就百度了一下在线IP扫描一类的代码，整理了一下分享给大家。</p><p>这是个非常实用的小程序，可以用于多媒体教室查询在线机子数量、公司内网在线用户管理。当然，查询机房在线IP也可以实现。</p>]]></description><link>https://www.wyr.me/post/283</link><guid isPermaLink="false">https://www.wyr.me/post/283</guid><dc:creator><![CDATA[轶哥]]></dc:creator><pubDate>Wed, 25 Nov 2015 15:19:26 GMT</pubDate></item><item><title><![CDATA[HTML5用户身份认证源代码：注册、登录、会话保持的解决方案]]></title><description><![CDATA[<p>&emsp;&emsp;本文是针对PHP新手的Session教程 —— 用户注册、登录、身份认证。以下代码均为伪代码。正式项目中需要修改完善强化其安全性。</p>]]></description><link>https://www.wyr.me/post/274</link><guid isPermaLink="false">https://www.wyr.me/post/274</guid><dc:creator><![CDATA[轶哥]]></dc:creator><pubDate>Fri, 20 Nov 2015 15:28:57 GMT</pubDate></item><item><title><![CDATA[发展中的云计算]]></title><description><![CDATA[<p>&emsp;&emsp;云计算是IT产业续PC、互联网之后的第三次革新浪潮，自2008年以来发展迅速。时至今日，云计算已发展了8年有余。在这个风起云涌的产业大潮中，很多中国企业很早就开始了在云计算方面的尝试，至今已取得了显著的成就。他们的付出使得云计算已经渗透到我国经济和社会各个领域。云计算所带来的第三次革新浪潮已经席卷全球，其巨大的影响力不仅仅推进了IT产业的变革，甚至已经改变到了大多数人的生活方式，不断推进着人类的生产和生活。</p>]]></description><link>https://www.wyr.me/post/1</link><guid isPermaLink="false">https://www.wyr.me/post/1</guid><dc:creator><![CDATA[轶哥]]></dc:creator><pubDate>Mon, 19 Oct 2015 15:24:44 GMT</pubDate></item></channel></rss>