作者: domain

  • Linksys MX4200 无线局域网下 Aqara M1S/P3 配网提示“WiFi 密码错误”

    最近买了个 M1S,配网总是失败,语音提示“WiFi 密码错误”后长亮白灯。想到家里有两个还在正常使用的 P3,于是尝试重置了一个,重新配网的时候也出现了一样的情况。

    联系客服后定位到问题可能与 Linksys MX4200 的 Apple Home 集成功能有关。于是到手机的家庭 App 右上角的家庭设置里,将无线局域网与路由器中的设备移除,然后在 Linksys App 中的左侧栏的 Apple Home 集成功能中,点按断开网状路由器的连接。重启路由器后,再次给 M1S/P3 配网成功。

    本文为个人解决上述情况下网关无法配网的思路分享,并非通用解决方案,仅供参考。

  • Windows 与 Internet 时间服务器同步

    最近发现电脑和 time.windows.com 的时间同步老是失败,有些时候 2FA 都用不了。

    前往控制面板->时钟和区域->设置时间和日期->Internet 时间->更改设置,直接手填 ntp.tencent.com 然后立即更新,确定保存。

    这个 NTP 服务器是这里抄的:云服务器 NTP 服务概述-最佳实践-文档中心-腾讯云

    如果爱改注册表的,可以直接前往 \HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\DateTime\Servers

  • Aqara P3 切换连接米家或 Aqara App

    现状

    早些时候(不太记得了,可能 1 年前左右)购买的 Aqara P3 空调伴侣默认连接的是 Aqara App,新买的却是默认连接米家 App。如果启动的时候,没有注意听语音,在错误的 App 上连接了之后会有各种奇怪的问题。Aqara App 上可能会提示错误代码 1。

    解决方案

    回去翻说明书(其实我是先在 M1S 的商品详情页看到的),上有写到:

    所以应该先连续短按 10 次按钮,然后听到语音后的 10 秒内,再连续短按 2 次按钮,即可完成切换。

    已在 Aqara P3,固件版本 3.4.0_0004.0616 上验证通过。

    Aqara M1S 商品详情页 FAQ 关于切换 App 的描述:

    Aqara P3 商品详情页 FAQ 关于短按 10 次和长按 10 秒的区别的描述:

  • Lens 安装 kube-state-metrics 超时

    使用 Lens 安装 kube-state-metrics 时发现,镜像是从 k8s.gcr.io/kube-state-metrics/kube-state-metrics:v2.0.0 拉取的,国内的 TKE 集群拉取会超时。可以直接修改 Deployment 的镜像为:ccr.ccs.tencentyun.com/tkeimages/kube-state-metrics:v2.0.0。

    也可以从 k8s-gcrio.azureedge.net/kube-state-metrics/kube-state-metrics:v2.0.0 拉取。

    如果只有单节点而且不想修改 Deployment 的话,可以在对应机器上拉取国内镜像,然后使用对应运行时的镜像工具修改镜像 Tag。以 containerd 为例:

    crictl pull ccr.ccs.tencentyun.com/tkeimages/kube-state-metrics:v2.0.0
    ctr -n k8s.io image tag ccr.ccs.tencentyun.com/tkeimages/kube-state-metrics:v2.0.0 k8s.gcr.io/kube-state-metrics/kube-state-metrics:v2.0.0

  • 修改 Kubernetes 默认 StorageClass

    今天部署一个应用的时候卡在新建 PVC,看到报错:

    Internal error occurred: 2 default StorageClasses were found

    编辑那个现在是默认,但是实际上不需要是默认的 sc,把:

    storageclass.kubernetes.io/is-default-class

    注解改为 false,或直接删除。

    引用

    https://kubernetes.io/docs/tasks/administer-cluster/change-default-storage-class/

  • 增加 Kubernetes CoreDNS Hosts 以自定义解析结果

    编辑 kube-system 中的 coredns 这个 ConfigMap,可以:

    kubectl edit configmap coredns -n kube-system

    在 Corefile 的:

    .:53 {
      ... ...
    }

    添加:

    hosts {
      127.0.0.1 localhost
      fallthrough
    }

    如果需要对单个 Pod 级别生效,可以设置 hostAliases。见:

    https://kubernetes.io/docs/tasks/network/customize-hosts-file-for-pods/#adding-additional-entries-with-hostaliases

    引用

    https://stackoverflow.com/a/65283959
    https://coredns.io/plugins/hosts/

    我还发现了什么好玩的

    由于不知道 Corefile 语法高亮应该用啥,于是看到了:

    https://coredns.io/2017/07/23/corefile-explained/

  • 下载“来自设备制造商的 HEVC 视频扩展”

    在浏览器中访问:

    ms-windows-store://pdp/?ProductId=9n4wgh0z6vhq

  • 修改 WordPress Twenty Fifteen 主题页脚以增加备案号

    感觉 Twenty Fifteen(2015)这个主题挺简洁,甚合我意。不过发现这个主题页脚没有提供可视化的设置,于是乎只能在主题编辑器上面看看页脚的源码(footer.php)怎么写的:

    <?php
    /**
     * The template for displaying the footer
     *
     * Contains the closing of the "site-content" div and all content after.
     *
     * @package WordPress
     * @subpackage Twenty_Fifteen
     * @since Twenty Fifteen 1.0
     */
    ?>
    
    	</div><!-- .site-content -->
    
    	<footer id="colophon" class="site-footer">
    		<div class="site-info">
    			<?php
    				/**
    				 * Fires before the Twenty Fifteen footer text for footer customization.
    				 *
    				 * @since Twenty Fifteen 1.0
    				 */
    				do_action( 'twentyfifteen_credits' );
    			?>
    			<?php
    			if ( function_exists( 'the_privacy_policy_link' ) ) {
    				the_privacy_policy_link( '', '<span role="separator" aria-hidden="true"></span>' );
    			}
    			?>
    			<a href="<?php echo esc_url( __( 'https://wordpress.org/', 'twentyfifteen' ) ); ?>" class="imprint">
    				<?php
    				/* translators: %s: WordPress */
    				printf( __( 'Proudly powered by %s', 'twentyfifteen' ), 'WordPress' );
    				?>
    			</a>
    		</div><!-- .site-info -->
    	</footer><!-- .site-footer -->
    
    </div><!-- .site -->
    
    <?php wp_footer(); ?>
    
    </body>
    </html>
    

    注意到第 23 行这里提供了一个钩子可以注入代码,如果在子主题里使用这个方法注入的话,就不需要修改原主题页脚的代码,这样的话代码量小,后期升级兼容性也更好。

    那么就新建一个子主题,在 functions.php 这里加载:

    add_action( 'twentyfifteen_credits', 'custom_footer_provider' );
    function custom_footer_provider() {
    	printf( '<a class="imprint" href="%s" target="_blank">%s</a>', 'https://beian.miit.gov.cn/', '粤ICP备XXX号-X' );
    }

    此时页脚已经可以显示备案号了,不过和原有的“自豪地采用WordPress”文字挤在一起,不太好看。注意到这两个元素其实是在一个 <div class="site-info"></div> 里的,那么只需要在 style.css 里面设置一下 flex 布局:

    .site-info {
    	display: flex;
    	justify-content: space-between;
    }

    此时两个文字已经贴靠两边显示了。

  • PowerShell Base64 编码与解码

    [System.Convert]::ToBase64String([System.Text.Encoding]::ASCII.GetBytes(''))
    [System.Text.Encoding]::UTF8.GetString([System.Convert]::FromBase64String(''))

  • JetBrains Quest (March 11, 2020) Write-Up

    第二波解谜,可以在 https://twitter.com/jetbrains/status/1237694815283879943 找到。

    给出了一段字符串:

    .spleh A+lrtC/dmC .thgis fo tuo si ti semitemos ,etihw si txet nehw sa drah kooL .tseretni wohs dluohs uoy ecalp a si ,dessecorp si xat hctuD erehw esac ehT .sedih tseuq fo txen eht erehw si ,deificeps era segaugnal cificeps-niamod tcudorp ehT

    仔细看一下就会发现是倒序

    比较明显是倒序的,先尝试复原:

    fun main() {
        val string = ".spleh A+lrtC/dmC .thgis fo tuo si ti semitemos ,etihw si txet nehw sa drah kooL .tseretni wohs dluohs uoy ecalp a si ,dessecorp si xat hctuD erehw esac ehT .sedih tseuq fo txen eht erehw si ,deificeps era segaugnal cificeps-niamod tcudorp ehT"
        print(string.reversed())
    }

    会得到:The product domain-specific languages are specified, is where the next of quest hides. The case where Dutch tax is processed, is a place you should show interest. Look hard as when text is white, sometimes it is out of sight. Cmd/Ctrl+A helps.

    比较明显:

    来到 MPS: The Domain-Specific Language Creator by JetBrains,能发现这里有个:

    打开报告,根据提示,全选来尝试看到白色的文字:

    复制出来可以得到:This is our 20th year as a company, we have shared numbers in our JetBrains Annual report, sharing the section with 18,650 numbers will progress your quest.

    所以前往 JetBrains 2019 Annual Highlights – Celebrating 20 Years!,找了半天没发现哪里有 18650,后面才发现原来是这个加起来刚好是 18650:

    进去后慢慢翻,有个图片:

    有一段火星文?可以慢慢看,也可以看看图片的 alt 属性:

    能勉强看出来是:Did you know JetBrains is always hiring? Check out the kareers(careers) page and see if there is a job for you or a quest challenge to go further at least.

    在招聘页面能找到这个 Fearless Quester 在 https://www.jetbrains.com/careers/jobs/fearless-quester-356/,但是忘记截图了,现在已经 404 了,有点尴尬。

    一直觉得自己执行力好差啊…还是要想办法做到今日事今日毕才行…

    根据提示后续要到 Game Development Tools by JetBrains,用科乐美秘技触发,有一个打砖块游戏,打完砖块就出现了: