<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:blogger='http://schemas.google.com/blogger/2008' xmlns:georss='http://www.georss.org/georss' xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-1804640066725252559</id><updated>2026-03-28T14:52:25.279+11:00</updated><category term="Linux"/><category term="Windows"/><category term="vim"/><category term="Java"/><category term="Archlinux"/><category term="Editor"/><category term="Ubuntu"/><category term="Powershell"/><category term="docker"/><category term="DDD"/><category term="English"/><category term="Scala"/><category term="Hardy Heron"/><category term="Javascript"/><category term="NVIDIA"/><category term="Eclipse"/><category term="Fedora"/><category term="Hibernate"/><category term="Hyper-V"/><category term="JVM"/><category term="NAS"/><category term="TV"/><category term="ffmpeg"/><category term="housework"/><category term="xfce"/><category term="AMD"/><category term="ATI"/><category term="Android"/><category term="C++"/><category term="Google"/><category term="Gphone"/><category term="HTTP"/><category term="Java IDE"/><category term="JavaEE"/><category term="JavaME"/><category term="MySQL"/><category term="Plugin"/><category term="Proguard"/><category term="Router"/><category term="SQL"/><category term="SVN"/><category term="Shell"/><category term="SpaceVim"/><category term="Tooling"/><category term="Virtual Machine"/><category term="ctags"/><category term="fstab"/><category term="git"/><category term="golang"/><category term="kotlin"/><category term="markdown"/><category term="neovim"/><category term="pacman"/><category term="taglist"/><category term="tmux"/><category term="yay"/><category term="zsh"/><category term="随笔"/><category term="3C控"/><category term="3D Printing"/><category term="64-bit"/><category term="Actor"/><category term="Agile"/><category term="Akka"/><category term="Ant"/><category term="Antenna"/><category term="Blade"/><category term="CHM Windows"/><category term="CSS"/><category term="Category Theory"/><category term="Clojure"/><category term="Cmdlets"/><category term="Compiz"/><category term="Connection Timeout"/><category term="Design"/><category term="E680"/><category term="Eclipse Compliant"/><category term="Emerald"/><category term="Exadel"/><category term="FPS"/><category term="Flatten Class"/><category term="Font"/><category term="Freemarker"/><category term="GET"/><category term="Graphviz"/><category term="HTTP1.1"/><category term="Handyman"/><category term="Internet"/><category term="JAX"/><category term="JDBC"/><category term="JOIN"/><category term="JSON"/><category term="JTWI"/><category term="Java IPC"/><category term="Java anti-pattern constant interface"/><category term="Kubernetes"/><category term="LAN"/><category term="Links"/><category term="MIDP"/><category term="MVC"/><category term="Mark Zbikowski EXE"/><category term="Math"/><category term="Maven q4e Eclipse Ant"/><category term="Minikube"/><category term="Monad"/><category term="NBN"/><category term="Netty"/><category term="Notepad++"/><category term="POST"/><category term="Pipe"/><category term="Push"/><category term="RAID"/><category term="ROKR-E2"/><category term="ReactJS"/><category term="Reactive Programming"/><category term="Realtek"/><category term="Repackage"/><category term="SSD"/><category term="Saw"/><category term="SciTE"/><category term="Scintilla"/><category term="Semaphore"/><category term="Shared-memory"/><category term="Spring"/><category term="Symbian"/><category term="TDD"/><category term="TechSkills"/><category term="Thinkpad"/><category term="UEFI"/><category term="W3C"/><category term="WMA"/><category term="WMI"/><category term="WSL"/><category term="Windows Mobile"/><category term="angular"/><category term="argument initialization"/><category term="chmod"/><category term="deviceinfo"/><category term="diff"/><category term="escape quote"/><category term="gradle"/><category term="halogen"/><category term="iPhone"/><category term="ia32"/><category term="latex"/><category term="macports"/><category term="mount"/><category term="movies"/><category term="network"/><category term="nslookup"/><category term="object model"/><category term="openscad"/><category term="oracle"/><category term="pandoc"/><category term="pdf"/><category term="pliers"/><category term="pulseaudio"/><category term="python IDE"/><category term="readability"/><category term="setgid"/><category term="setuid"/><category term="sizeof"/><category term="source-code-reading"/><category term="spotify"/><category term="tracert"/><category term="vagrant"/><category term="virtual"/><category term="you-get"/><category term="华语歌曲"/><category term="开张"/><category term="戏剧"/><category term="智能手机"/><category term="朝花夕拾"/><category term="游戏"/><category term="茶"/><category term="音乐"/><title type='text'>懒的态度</title><subtitle type='html'>懒是一种态度，一种生活的态度。</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://jlazy.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1804640066725252559/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='http://jlazy.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><link rel='next' type='application/atom+xml' href='http://www.blogger.com/feeds/1804640066725252559/posts/default?start-index=26&amp;max-results=25&amp;redirect=false'/><author><name>懒人 J</name><uri>http://www.blogger.com/profile/14311605983580876556</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>161</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-1804640066725252559.post-4704436054999229434</id><published>2026-03-28T14:52:00.002+11:00</published><updated>2026-03-28T14:52:25.179+11:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="ffmpeg"/><category scheme="http://www.blogger.com/atom/ns#" term="NVIDIA"/><category scheme="http://www.blogger.com/atom/ns#" term="Windows"/><title type='text'>Windows 调优 ffmpeg 转换视频</title><content type='html'>&lt;div data-markdown&gt;
Windows 上给老掉牙的显卡更新了驱动，然后在 Gemini 的帮助下解决了一堆问题，总算是可以高效地处理视频文件的转换了。
  
以下命令用于将一个输入视频按照时间区块分段截取，并利用 CUDA 高效地转换尺寸为 720p 大小。老硬件上也效果飞起~

```powershell
Measure-Command -Expression {
$ins=&quot;INPUT_FHD.mp4&quot;;
$ousprefix=&quot;output_720p&quot;;
ffmpeg -hwaccel cuda -hwaccel_output_format cuda -ss 00:01:02 -to 00:40:00 -i $ins -vf &quot;scale_cuda=720:-2&quot; -c:v hevc_nvenc -preset p4 -tune hq -rc vbr -cq 28 -b:v 0 -c:a copy &quot;$ousprefix-part1.mp4&quot;;
ffmpeg -hwaccel cuda -hwaccel_output_format cuda -ss 01:08:56 -to 02:00:00 -i $ins -vf &quot;scale_cuda=720:-2&quot; -c:v hevc_nvenc -preset p4 -tune hq -rc vbr -cq 28 -b:v 0 -c:a copy &quot;$ousprefix-part2.mp4&quot;;
}

```

&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jlazy.blogspot.com/feeds/4704436054999229434/comments/default' title='博文评论'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/1804640066725252559/4704436054999229434' title='0 条评论'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1804640066725252559/posts/default/4704436054999229434'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1804640066725252559/posts/default/4704436054999229434'/><link rel='alternate' type='text/html' href='http://jlazy.blogspot.com/2026/03/windows-ffmpeg.html' title='Windows 调优 ffmpeg 转换视频'/><author><name>懒人 J</name><uri>http://www.blogger.com/profile/14311605983580876556</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1804640066725252559.post-6935550075603841336</id><published>2025-06-09T15:00:00.002+10:00</published><updated>2025-06-09T15:00:32.153+10:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="3D Printing"/><category scheme="http://www.blogger.com/atom/ns#" term="openscad"/><title type='text'>程序员友好的 3D 建模工具 OpenSCAD</title><content type='html'>&lt;div data-markdown&gt;
  
看到油管的一个博主介绍了他使用 OpenSCAD 来[定义模型](https://makerworld.com/en/models/1478585-fully-customizable-ikea-components-parametric#profileId-1543526)，颇感兴趣。
  
[OpenSCAD](https://openscad.org/index.html) 是一款免费的工具，支持包括 Linux、Windows 和 MacOS 在内的主要操作系统。不同于常见的 3D 建模工具，它的侧重点在于 CAD 方面。更为有趣的事，它使用了[一种语言](https://en.wikibooks.org/wiki/OpenSCAD_Tutorial)来定义组件。

以下是 Google search 的 AI summary，总结了 OpenSCAD 使用的编程语言的特点——函数式编程，允许用户方便的定义几何形状并对其进行变换。

OpenSCAD uses a functional programming language that is used to define 2D and 3D models through a script. This script is a free-format list of action statements, allowing users to create and manipulate geometric primitives to build complex objects. While the syntax resembles JavaScript or C, it&#39;s not a general-purpose programming language but rather a declarative language focused on geometric descriptions. 

Key characteristics of the OpenSCAD language:

- Functional Programming:

    OpenSCAD&#39;s syntax is influenced by functional programming principles, where each &quot;variable&quot; within a scope is treated as a constant, immutable with one value. 

   - Declarative:

      It&#39;s a declarative language, meaning the focus is on what to create rather than how to create it. 

      OpenSCAD doesn&#39;t have iterative assignment like `x = x + 1`, as it&#39;s designed to be stateless and declarative.

   - For Loops:

      C-style for loops are available for list comprehensions, but they are designed to maintain the declarative nature of the language by updating values within the iteration, rather than introducing mutable states. 

  
- Modules and Functions:

    OpenSCAD allows for defining modules and functions to create reusable components, but these are also evaluated in a stateless manner, with no side effects. 

- Geometric Descriptions:

    OpenSCAD code defines models through textual descriptions, which are then compiled and rendered into 3D mesh. 

- Operators and Transformations:

    Operators are used to modify the location, color, and other properties of objects, and are evaluated right to left. 


In essence, OpenSCAD&#39;s language is a powerful tool for defining 3D models programmatically, leveraging functional and declarative principles to create complex geometries. 

&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jlazy.blogspot.com/feeds/6935550075603841336/comments/default' title='博文评论'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/1804640066725252559/6935550075603841336' title='0 条评论'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1804640066725252559/posts/default/6935550075603841336'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1804640066725252559/posts/default/6935550075603841336'/><link rel='alternate' type='text/html' href='http://jlazy.blogspot.com/2025/06/3d-openscad.html' title='程序员友好的 3D 建模工具 OpenSCAD'/><author><name>懒人 J</name><uri>http://www.blogger.com/profile/14311605983580876556</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1804640066725252559.post-7269790893703699563</id><published>2024-06-09T15:42:00.002+10:00</published><updated>2024-06-09T15:42:22.997+10:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Fedora"/><category scheme="http://www.blogger.com/atom/ns#" term="git"/><category scheme="http://www.blogger.com/atom/ns#" term="Linux"/><title type='text'>Fedora 40 on my old laptop</title><content type='html'>&lt;div data-markdown&gt;
由于去年CentOS RIP的事情，很多企业都改用了另一种发行版。自用的一台老旧的MBP (2012年)已经很久没有更新了，干脆装了Fedora Linux。

时隔多年又安装Fedora，实际上是去年底就用了38，中间升级到了39但是年初的时候不知为何kernel出了问题，grub也没法回退到可用的状态。前几周有时间干脆完全重装了Fedora 40。还刚好试了试 [Ventoy](https://www.ventoy.net/) 的 Multi ISO files 特性，挺好。

## 已解决的配置

1. Yakuake terminal

	习惯了使用快捷键来触发下拉式命令窗口，参考[搜索结果](https://fedoramagazine.org/use-a-drop-down-terminal-for-fast-commands-in-fedora/)试了试 Yakuake 还不错。它还是基于 Kconsole 的，用户不需要做太多改动，直接就可以上手。

2. 倒腾 Git Repo 遇到了小问题

	为了速度转移一些 Git Projects，没有逐个 clone，而是直接从另一台笔记本弄了 tar.gz 过去。不知道是不是 MacOS 自带的 tar 命令与 GNU 的水土不服，过去之后，除了一致的额外隐藏文件 (ie .DS_Store) 居然Git还报了另一种问题 “index file is too small”！

	仔细查找后总算是找到了[解决方法](https://joemaller.com/1283/git-error-index-file-is-too-small/)。

	```
	git config repack.usedeletabaoffset false
	git repack -a -d
	```

3. 安装一些趁手的工具

	`dnf install exa bat ripgrep fzf pass` 配上已有的 dot files 基本解决了问题。这套配置在 MacOS 和 Linux 差别度不大。

4. 外接显示器分辨率的设置

	不知为何，外接显示器居然找不到应有的 ratio。参考[一篇博客文章](https://www.wenjinyu.me/solve-the-problem-of-gnome-desktop-resolution-error-when-using-notebook-external-HDMI/)使用 `cvt` 和 `xrandr` 加了一个新的分辨率，总算是解决。

	```bash
	cvt 2560 2880

	xrandr --newmode &quot;2560x2880_60.00&quot;  638.25 \
	  2560 2784 3064 3568 \
          2880 2883 2893 2982 \
          -hsync +vsync

	xrandr --addmode &quot;2560x2880_60.00&quot;
	```

5. 通过 flatpak 安装了其他的一些 GUI apps

	包括 Spotify、 Edge 等。


## 未解决的问题

刚刚重装完的系统WIFI可用，不过audio貌似只能识别出MBP自己的，HDMI外接显示器的声音完全没有。

看到 Reddit 有人建议用

```bash
sudo dnf swap wireplumber pipewire-media-session
```

但是尝试无效……


&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jlazy.blogspot.com/feeds/7269790893703699563/comments/default' title='博文评论'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/1804640066725252559/7269790893703699563' title='0 条评论'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1804640066725252559/posts/default/7269790893703699563'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1804640066725252559/posts/default/7269790893703699563'/><link rel='alternate' type='text/html' href='http://jlazy.blogspot.com/2024/06/fedora-40-on-my-old-laptop.html' title='Fedora 40 on my old laptop'/><author><name>懒人 J</name><uri>http://www.blogger.com/profile/14311605983580876556</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1804640066725252559.post-963879546091539454</id><published>2024-05-19T15:26:00.005+10:00</published><updated>2024-05-19T15:26:56.954+10:00</updated><title type='text'>不可言说的知识</title><content type='html'>&lt;div data-markdown&gt;
在看八叉老师的一门课，他引用了『庄子』 【外篇 天道】[末尾的一个故事](https://ctext.org/dictionary.pl?if=gb&amp;id=42076&amp;remap=gb)来解释什么是不可言说的知识。

&gt; 桓公读书于堂上，
&gt; 轮扁斲轮于堂下，
&gt; 释椎凿而上，
&gt; 问桓公曰：
&gt; “敢问：公之所读者何言邪？”
&gt; 公曰：“圣人之言也。
&gt; ”曰：“圣人在乎？”
&gt; 公曰：“已死矣。”
&gt; 曰：“然则君之所读者，
&gt; 古人之糟魄已夫！”
&gt;
&gt; 桓公曰：“寡人读书，轮人安得议乎？
&gt; 有说则可，无说则死。”
&gt;
&gt; 轮扁曰：“臣也以臣之事观之。
&gt; 斲轮，徐则甘而不固，
&gt; 疾则苦而不入，
&gt; 不徐不疾，得之于手而应于心，
&gt; 口不能言，有数存焉于其间。
&gt; 臣不能以喻臣之子，
&gt; 臣之子亦不能受之于臣，
&gt; 是以行年七十而老斲轮。
&gt; 古之人与其不可传也死矣，
&gt; 然则君之所读者，
&gt; 古人之糟魄已夫！”

这段古文的意思大致如下：

&gt; 齐桓公在堂上读书，轮扁在堂下砍削车轮。他问齐桓公在读什么书。齐桓公说是圣人的书。轮扁说，那全是古人的糟粕！齐桓公就很不高兴，非要让他说出个道理。

&gt; 轮扁说：我所从事的工作是砍削车轮。榫头做得过于宽缓，就会松动而不牢固，而做得太紧了，又会涩滞而难以使用。不宽不紧才可以。这个道理是我从工作中学会的，虽然能讲出来，但是没有办法教给徒弟或儿子。于是这么大岁数了我也只能自己削车轮。不可言传的道理跟随圣人一起死了，所以您读的书只能是古人的糟粕。

轮扁讲出的道理需要他的徒弟或儿子亲身在工作中学习，通过经验的增长，才能学会——这就是所谓的【不可言说的知识】。
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jlazy.blogspot.com/feeds/963879546091539454/comments/default' title='博文评论'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/1804640066725252559/963879546091539454' title='0 条评论'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1804640066725252559/posts/default/963879546091539454'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1804640066725252559/posts/default/963879546091539454'/><link rel='alternate' type='text/html' href='http://jlazy.blogspot.com/2024/05/blog-post.html' title='不可言说的知识'/><author><name>懒人 J</name><uri>http://www.blogger.com/profile/14311605983580876556</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1804640066725252559.post-6661015327957423484</id><published>2022-06-19T16:57:00.001+10:00</published><updated>2022-06-19T16:57:13.115+10:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="gradle"/><category scheme="http://www.blogger.com/atom/ns#" term="kotlin"/><title type='text'>顺手拷贝的一个 build.gradle.kts</title><content type='html'>&lt;div data-markdown&gt;
  
Gradle 的 `build.gradle` 通常都是用 Groovy DSL 来编写的。随着 Kotlin 流行，Gradle 也慢慢开始支持 `build.gradle.kts`。
  
刚好看见一个简单的 sample，顺手放在这里
  
```kotlin
plugins {
    `java-library`
    &quot;jacoco&quot;
}
repositories {
    mavenCentral()
}
dependencies {
    implementation(&quot;jakarta.inject:jakarta.inject-api:2.0.1.MR&quot;)
    implementation(&quot;jakarta.ws.rs:jakarta.ws.rs-api:3.1.0&quot;)
    implementation(&quot;jakarta.servlet:jakarta.servlet-api:5.0.0&quot;)
    implementation(project(&quot;:home-made-lib&quot;))
    testImplementation(&quot;org.junit.jupiter:junit-jupiter:5.8.2&quot;)
    testImplementation(&quot;org.mockito:mockito-core:4.5.1&quot;)
    testImplementation(&quot;org.eclipse.jetty:jetty-server:11.0.9&quot;)
    testImplementation(&quot;org.eclipse.jetty:jetty-servlet:11.0.9&quot;)
}
tasks.withType&lt;Test&gt;() {
    useJUnitPlatform()
}
java {
    sourceCompatibility = JavaVersion.VERSION_17
    targetCompatibility = JavaVersion.VERSION_17
}
```
  
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jlazy.blogspot.com/feeds/6661015327957423484/comments/default' title='博文评论'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/1804640066725252559/6661015327957423484' title='0 条评论'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1804640066725252559/posts/default/6661015327957423484'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1804640066725252559/posts/default/6661015327957423484'/><link rel='alternate' type='text/html' href='http://jlazy.blogspot.com/2022/06/buildgradlekts.html' title='顺手拷贝的一个 build.gradle.kts'/><author><name>懒人 J</name><uri>http://www.blogger.com/profile/14311605983580876556</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1804640066725252559.post-5705495545050489220</id><published>2022-06-12T21:27:00.002+10:00</published><updated>2022-06-12T21:27:33.464+10:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="neovim"/><category scheme="http://www.blogger.com/atom/ns#" term="vim"/><title type='text'>Ubuntu 安装和配置 NeoVim</title><content type='html'>&lt;div data-markdown&gt;

最近想试试 NeoVim，在 Windows 10 WSL 的 Ubuntu (20.04) 里安装 neovim 是非常方便的，[用 Snap](https://askubuntu.com/questions/430008/how-to-install-neovim-on-ubuntu) 就可以了。

	sudo apt install neovim

如果需要将 Neovim 设置为常用的编辑器，最好[利用系统的 Alternatives 设定](https://blog.aktsbot.in/vim-to-neovim.html)，以取代常见的默认程序 （如 `/usr/bin/vim.basic`）。

```bash
$ sudo update-alternatives --install /usr/bin/vi vi /usr/bin/nvim 60
$ sudo update-alternatives --install /usr/bin/vim vim /usr/bin/nvim 60
$ sudo update-alternatives --install /usr/bin/editor editor /usr/bin/nvim 60
```

[除了以上这几个命令之外，还有 ex, vi, vim, editor, view, vimdiff 等等](https://stackoverflow.com/questions/65889273/how-do-i-add-nvim-to-update-alternatives-when-using-snap-under-ubuntu)，都可以使用类似的命令来替换。
  
值得一提的是，不像 `vim`，`neovim` 不再支持各种 alias commands，而是推荐直接调用 `nvim` 时传入相应的 args 来进入需要的模式，例如 `nvim -R` 就类似于 `view`；`nvim -d` 类似于 `vimdiff`。可以参考这两个 GitHub Issues：
- https://github.com/neovim/neovim/pull/2008
- https://github.com/neovim/neovim/issues/1646

&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jlazy.blogspot.com/feeds/5705495545050489220/comments/default' title='博文评论'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/1804640066725252559/5705495545050489220' title='0 条评论'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1804640066725252559/posts/default/5705495545050489220'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1804640066725252559/posts/default/5705495545050489220'/><link rel='alternate' type='text/html' href='http://jlazy.blogspot.com/2022/06/ubuntu-neovim.html' title='Ubuntu 安装和配置 NeoVim'/><author><name>懒人 J</name><uri>http://www.blogger.com/profile/14311605983580876556</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1804640066725252559.post-6690363911334584774</id><published>2022-06-12T21:20:00.001+10:00</published><updated>2022-06-12T21:20:12.127+10:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="golang"/><category scheme="http://www.blogger.com/atom/ns#" term="Javascript"/><category scheme="http://www.blogger.com/atom/ns#" term="kotlin"/><title type='text'>[Resources] Golang, Kotlin, JS and Misc</title><content type='html'>&lt;div data-markdown&gt;

周末看的几篇文章提到了一些有用的资源，记录一下：

- Golang
    1. [awesome-go](https://github.com/avelino/awesome-go)
    2. [Effective Go](https://go.dev/doc/effective_go)
- Kotlin
    1. [Coding Conventions](https://kotlinlang.org/docs/coding-conventions.html)
- JavaScript
    1. [Prototype Chain](https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Inheritance_and_the_prototype_chain)
- Web
    1. [MS Restful API Guideline](https://github.com/microsoft/api-guidelines/blob/vNext/Guidelines.md)
    2. [Hardening Your HTTP Security Headers](https://www.keycdn.com/blog/http-security-headers)

&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://jlazy.blogspot.com/feeds/6690363911334584774/comments/default' title='博文评论'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/1804640066725252559/6690363911334584774' title='0 条评论'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1804640066725252559/posts/default/6690363911334584774'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1804640066725252559/posts/default/6690363911334584774'/><link rel='alternate' type='text/html' href='http://jlazy.blogspot.com/2022/06/resources-golang-kotlin-js-and-misc.html' title='[Resources] Golang, Kotlin, JS and Misc'/><author><name>懒人 J</name><uri>http://www.blogger.com/profile/14311605983580876556</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1804640066725252559.post-786540260243696868</id><published>2022-04-10T11:14:00.006+10:00</published><updated>2022-04-10T11:14:56.176+10:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Clojure"/><category scheme="http://www.blogger.com/atom/ns#" term="Java"/><category scheme="http://www.blogger.com/atom/ns#" term="Netty"/><title type='text'>Requests Pipelining and Size Estimation</title><content type='html'>&lt;div data-markdown&gt;
这两周刚好在看和 requests pipelining 有关的 Netty 代码，找到了挺有意思的文章：

1. [Pipelining requests](https://aphyr.com/posts/267-pipelining-requests)
2. [Estimate size of objects in OrderedMemoryAwareThreadPoolExecutor](https://aphyr.com/posts/269-reaching-200k-events-sec)

这里提到的 [Riemann](https://riemann.io/) 是一个分布式监控软件，用 Clojure 语言开发的（GitHub 代码库[地址](https://github.com/riemann)）。

&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://jlazy.blogspot.com/feeds/786540260243696868/comments/default' title='博文评论'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/1804640066725252559/786540260243696868' title='0 条评论'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1804640066725252559/posts/default/786540260243696868'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1804640066725252559/posts/default/786540260243696868'/><link rel='alternate' type='text/html' href='http://jlazy.blogspot.com/2022/04/requests-pipelining-and-size-estimation.html' title='Requests Pipelining and Size Estimation'/><author><name>懒人 J</name><uri>http://www.blogger.com/profile/14311605983580876556</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1804640066725252559.post-7835512026705096778</id><published>2022-02-27T16:09:00.002+11:00</published><updated>2022-02-27T16:09:14.473+11:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Powershell"/><title type='text'>Create Symbolic Link using PowerShell</title><content type='html'>&lt;div data-markdown&gt;
类似于 Linux 的 `ln -s` 命令，Windows PowerShell 也支持在文件系统中创建 SymbolicLink。

例如，为了方便在 Visual Studio Code中预览 Markdown 的图片，就可以建立软链接：

  ```PowerShell
   cd src\main
   New-Item -Path .\markdown\frontend\img \
     -ItemType SymbolicLink \
     -Value .\resources\frontend\images\
```
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jlazy.blogspot.com/feeds/7835512026705096778/comments/default' title='博文评论'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/1804640066725252559/7835512026705096778' title='0 条评论'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1804640066725252559/posts/default/7835512026705096778'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1804640066725252559/posts/default/7835512026705096778'/><link rel='alternate' type='text/html' href='http://jlazy.blogspot.com/2022/02/create-symbolic-link-using-powershell.html' title='Create Symbolic Link using PowerShell'/><author><name>懒人 J</name><uri>http://www.blogger.com/profile/14311605983580876556</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1804640066725252559.post-199599345675089230</id><published>2022-02-19T16:34:00.000+11:00</published><updated>2022-02-19T16:34:10.926+11:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Shell"/><category scheme="http://www.blogger.com/atom/ns#" term="WSL"/><title type='text'>WSL invalid option when executing shell script</title><content type='html'>&lt;div data-markdown&gt;
有一个 bash script，在MacOS里执行的顺利无比，但是一到 WSL 里头就总是出问题。

	: invalid option

一开始怀疑是 shebang 哪里写错了，后来发现不对，貌似和 &#39;^M&#39; 有关。最后在[这里](https://newbedev.com/bad-interpreter-bin-bash-m-code-example)看到了类似的提示，果然是linefeed要替换！

	sed -i -e &#39;s/\r$//&#39; $FILE.sh

&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jlazy.blogspot.com/feeds/199599345675089230/comments/default' title='博文评论'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/1804640066725252559/199599345675089230' title='0 条评论'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1804640066725252559/posts/default/199599345675089230'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1804640066725252559/posts/default/199599345675089230'/><link rel='alternate' type='text/html' href='http://jlazy.blogspot.com/2022/02/wsl-invalid-option-when-executing-shell.html' title='WSL invalid option when executing shell script'/><author><name>懒人 J</name><uri>http://www.blogger.com/profile/14311605983580876556</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1804640066725252559.post-1933270345662045778</id><published>2022-01-02T11:32:00.001+11:00</published><updated>2022-01-02T11:32:13.472+11:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Java"/><title type='text'>&quot;The Java Version Almanac&quot;</title><content type='html'>&lt;div data-markdown&gt;
看了看从 Java 8 到 17 的 changes。
  
从 [这篇文章](https://ondro.inginea.eu/index.php/new-features-in-java-versions-since-java-8/) 发现了个有意思的 [Java 年鉴](https://javaalmanac.io/)，非常用心地将历代 API 的变化都标注了出来。

仔细看了看，该网站的作者之一 Cay Horstmann 就是当年俺初学 Java 时读的 Core Java 的作者。

&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jlazy.blogspot.com/feeds/1933270345662045778/comments/default' title='博文评论'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/1804640066725252559/1933270345662045778' title='0 条评论'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1804640066725252559/posts/default/1933270345662045778'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1804640066725252559/posts/default/1933270345662045778'/><link rel='alternate' type='text/html' href='http://jlazy.blogspot.com/2022/01/the-java-version-almanac.html' title='&quot;The Java Version Almanac&quot;'/><author><name>懒人 J</name><uri>http://www.blogger.com/profile/14311605983580876556</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1804640066725252559.post-3323990137295133974</id><published>2021-12-29T21:04:00.001+11:00</published><updated>2021-12-29T21:04:02.467+11:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Editor"/><category scheme="http://www.blogger.com/atom/ns#" term="neovim"/><category scheme="http://www.blogger.com/atom/ns#" term="SpaceVim"/><category scheme="http://www.blogger.com/atom/ns#" term="vim"/><title type='text'>SpaceVim with NeoVim in Docker</title><content type='html'>&lt;div data-markdown&gt;
在Docker里玩了会儿neovim+spacevim。

```
docker run --name nvim -it --rm spacevim/spacevim nvim
```

版本是最新的
```
NVIM v0.7.0-dev+792-gc46f7caad
Build type: RelWithDebInfo
LuaJIT 2.1.0-beta3
Compilation: /usr/bin/cc -DNVIM_TS_HAS_SET_MATCH_LIMIT -O2 -g -Og -g -Wall -Wextra -pedantic -Wno-unused-parameter -Wst
rict-prototypes -std=gnu99 -Wshadow -Wconversion -Wmissing-prototypes -Wimplicit-fallthrough -Wvla -fstack-protector-st
rong -fno-common -fdiagnostics-color=always -DINCLUDE_GENERATED_DECLARATIONS -D_GNU_SOURCE -DNVIM_MSGPACK_HAS_FLOAT32 -
DNVIM_UNIBI_HAS_VAR_FROM -DMIN_LOG_LEVEL=3 -I/usr/src/neovim/build/config -I/usr/src/neovim/src -I/usr/src/neovim/.deps
/usr/include -I/usr/include -I/usr/src/neovim/build/src/nvim/auto -I/usr/src/neovim/build/include
Compiled by root@buildkitsandbox
```

不过启动后老报错：
```
Error detected while processing BufEnter Autocommands for &quot;*&quot;:
E117: Unknown function: LaTeXtoUnicode#Refresh
startify: Can&#39;t read viminfo file. Read :help startify-faq-02
```

Dockerfile build的时候所用的[init.toml](https://raw.githubusercontent.com/SpaceVim/SpaceVim/master/docker/init.toml) 囊括了不少编程语言，前两个错误貌似和 Julia 有关。

`SpaceVim/autoload/SpaceVim/layers/lang/julia.vim` 在启动的时候针对 Julia language 会自动加载 [julia-vim](https://github.com/JuliaEditorSupport/julia-vim/blob/master/autoload/LaTeXtoUnicode.vim)。

根据Spacevim的文档，这个 julia-vim 插件是做不到按需加载的。

```
==============================================================================
LANG#JULIA                                         *SpaceVim-layer-lang-julia*
The layer provides synatax highlight and linting for julia.  The completeion
only works in nvim with deoplete. However, the julia-vim could not be load
on-demanding  due to its LaTeXToUnicode feature.
```

后来又找到了这篇 [【Vim for Julia】](https://medium.com/coffee-in-a-klein-bottle/vim-for-julia-18eba071c654) 貌似还是和那个函数（及其控制变量有关），不过还是没有找到解决方案（因为不想pollute本地的环境也懒得重新bake Docker Image）……

  
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jlazy.blogspot.com/feeds/3323990137295133974/comments/default' title='博文评论'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/1804640066725252559/3323990137295133974' title='0 条评论'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1804640066725252559/posts/default/3323990137295133974'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1804640066725252559/posts/default/3323990137295133974'/><link rel='alternate' type='text/html' href='http://jlazy.blogspot.com/2021/12/spacevim-with-neovim-in-docker.html' title='SpaceVim with NeoVim in Docker'/><author><name>懒人 J</name><uri>http://www.blogger.com/profile/14311605983580876556</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1804640066725252559.post-3724738282618741418</id><published>2021-12-19T20:34:00.003+11:00</published><updated>2022-01-16T16:57:13.504+11:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="ffmpeg"/><category scheme="http://www.blogger.com/atom/ns#" term="Powershell"/><title type='text'>Powershell 批量抽取视频中的声音</title><content type='html'>&lt;div data-markdown&gt;
  
是不是会从油管载几个音乐视频，为了方便转换为MP3，在Win10试了PowerShell,尚未完全批处理，分为步骤如下：
  
1. 搜集目录下近期下载的MV文件列表
  ```
	# List input file name
	Get-ChildItem -Path I:\YOUGET\MusicVideos\*.mp4 |
	Where-Object { $_.LastWriteTime -gt (Get-Date).AddDays(-30) } |
	Select Name
  ```
2. 自定义输出的MP3文件名，将其与对应的输入文件名一起存放到一个字符串中，稍后转换为一个Hashtable结构。
  ```
	# Construct a hashtable, using Output MP3 name as key, and input file name as Value.
	$nmapping=@&quot;
	mp3-file1 = ...
	mp3-file2 = ...
	mp3-file3 = ...
	&quot;@
	$hash = ConvertFrom-StringData $nmapping
  ```
3. 遍历Hashtable的元素，执行 ffmpeg 命令来转换为MP3。
  ```
	# Loop the hash table, and run ffmpeg
	foreach ($h in $hash.GetEnumerator()) {
	  $InputFileName = &quot;I:\YOUGET\MusicVideos\&quot; + &quot;$($h.Value)&quot;
	  $OutputFileName = &quot;I:\YOUGET\MP3\&quot; + &quot;$($h.Name)&quot; + &quot;.MP3&quot;
	  Write-Host &quot;Convertign $InputFileName to $OutputFileName ...&quot;
	  ffmpeg -i &quot;$InputFileName&quot; -vn -ab 256k &quot;$OutputFileName&quot;
	}
  ```
 
参考了以下文档：
1. [The PowerShell Foreach Loop](https://adamtheautomator.com/powershell-foreach/) and a similar discussion in [StackOverflow](https://stackoverflow.com/questions/9015138/looping-through-a-hash-or-using-an-array-in-powershell)
2. [Use Get-ChildItem to Find Files by Date and Time](https://www.pdq.com/blog/using-get-childitem-find-files/)
3. [PowerShell: About HashTable](https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_hash_tables?view=powershell-7.2#displaying-hash-tables)
4. [ffmpeg之常用音频转换](https://dangger.github.io/2015/10/30/index.html)
  
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jlazy.blogspot.com/feeds/3724738282618741418/comments/default' title='博文评论'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/1804640066725252559/3724738282618741418' title='0 条评论'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1804640066725252559/posts/default/3724738282618741418'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1804640066725252559/posts/default/3724738282618741418'/><link rel='alternate' type='text/html' href='http://jlazy.blogspot.com/2021/12/powershell.html' title='Powershell 批量抽取视频中的声音'/><author><name>懒人 J</name><uri>http://www.blogger.com/profile/14311605983580876556</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1804640066725252559.post-8896987543270117585</id><published>2021-12-19T17:03:00.002+11:00</published><updated>2021-12-19T17:37:48.875+11:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="TV"/><title type='text'>年末的剧集忽然多了起来</title><content type='html'>&lt;div data-markdown&gt;
最近发现值得看的电视剧忽然多了起来。
  
先是『风起洛阳』，去年看了『长安十二时辰』后被马亲王的作品圈了粉，于是开始follow这一部。

昨晚发现『雪中悍刀行』居然也出了剧集，也是要看起来啊啊啊～
  
&lt;/div&gt;

&lt;iframe width=&quot;560&quot; height=&quot;315&quot; src=&quot;https://www.youtube-nocookie.com/embed/fOsba_v6TeM&quot; title=&quot;YouTube video player&quot; frameborder=&quot;0&quot; allow=&quot;accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture&quot; allowfullscreen&gt;&lt;/iframe&gt;
  </content><link rel='replies' type='application/atom+xml' href='http://jlazy.blogspot.com/feeds/8896987543270117585/comments/default' title='博文评论'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/1804640066725252559/8896987543270117585' title='0 条评论'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1804640066725252559/posts/default/8896987543270117585'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1804640066725252559/posts/default/8896987543270117585'/><link rel='alternate' type='text/html' href='http://jlazy.blogspot.com/2021/12/blog-post_19.html' title='年末的剧集忽然多了起来'/><author><name>懒人 J</name><uri>http://www.blogger.com/profile/14311605983580876556</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1804640066725252559.post-2494364659538446221</id><published>2021-12-05T16:04:00.005+11:00</published><updated>2021-12-05T16:06:32.548+11:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="angular"/><category scheme="http://www.blogger.com/atom/ns#" term="Javascript"/><category scheme="http://www.blogger.com/atom/ns#" term="markdown"/><title type='text'>定制 Blogger 的页面模板以支持 Markdown 内容</title><content type='html'>&lt;div data-markdown&gt;
换了一个新的页面模板，于是需要重新配置HTML template，否则博文中使用的markdown无法被正确显示在页面上。

幸亏谷歌的cached page还可以找到原本的解决方案，

	&amp;lt;!-- 2016.03: customize the page to use
	  showdown.js (for markdown) and highlight.js (for code highlight),
	  also utilise AngularJS directive for parsing &amp;lt;div data-markdown&amp;gt;
	  --&amp;gt;
	&amp;lt;script src=&#39;https://ajax.googleapis.com/ajax/libs/angularjs/1.4.9/angular.min.js&#39;&amp;gt;&amp;lt;/script&amp;gt;
	&amp;lt;script src=&#39;https://cdnjs.cloudflare.com/ajax/libs/showdown/1.3.0/showdown.min.js&#39;&amp;gt;&amp;lt;/script&amp;gt;
	&amp;lt;link href=&#39;//cdnjs.cloudflare.com/ajax/libs/highlight.js/9.2.0/styles/default.min.css&#39; rel=&#39;stylesheet&#39;/&amp;gt;
	&amp;lt;script src=&#39;//cdnjs.cloudflare.com/ajax/libs/highlight.js/9.2.0/highlight.min.js&#39;&amp;gt;&amp;lt;/script&amp;gt;

  
首先要添加几个脚本，包括

1. Showdown

	用来将 Markdown 的脚本转换为 HTML。

2. Hightlight

	用于高亮显示代码，不过这个功能貌似还没有怎么用到。

3. Angular (1.x)

	如果不想要用像是 jQuer 这样的脚本来操作 DOM，可以依赖 Ng 的directive来自动识别 `markdown` attribute 直接替换 DOM 内的文本。



然后在末尾添加一段 `script` 脚本定义一个 Angular direcctive 来处理 `data-markdown`：

```javascript
	hljs.configure({
	  tabReplace: &#39;  &#39;, // two spaces
	  languages: [&#39;Java&#39;, &#39;Scala&#39;, &#39;Javascript&#39;]
	  });

	angular.
	  module(&#39;mkdApp&#39;, []).
	  directive(&#39;markdown&#39;, function () {
	    var converter = new showdown.Converter();
	    return {
	      restrict: &#39;A&#39;,
	      link: function (scope, element, attrs) {
	        var htmlText = converter.makeHtml(element.text());
	        element.html(htmlText).find(&#39;pre code&#39;, function(codeElem) {
	          hljs.highlightBlock(codeElem);
	        });
	      }
	    };
	  });
```

最后，在页面的 container 节点，加上一个 `ng-app` attribute 以启用 Angular：

	&amp;lt;div class=&#39;column-center-inner&#39; ng-app=&#39;mkdApp&#39;&amp;gt;

今天更新的时候换了 CDN 并用了较新版本的 JS/CSS，但是整体的 solution 还是一致的。

&lt;div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://jlazy.blogspot.com/feeds/2494364659538446221/comments/default' title='博文评论'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/1804640066725252559/2494364659538446221' title='0 条评论'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1804640066725252559/posts/default/2494364659538446221'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1804640066725252559/posts/default/2494364659538446221'/><link rel='alternate' type='text/html' href='http://jlazy.blogspot.com/2021/12/blogger-markdown.html' title='定制 Blogger 的页面模板以支持 Markdown 内容'/><author><name>懒人 J</name><uri>http://www.blogger.com/profile/14311605983580876556</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1804640066725252559.post-5981682176594724656</id><published>2021-12-05T12:15:00.006+11:00</published><updated>2021-12-05T14:38:41.515+11:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="movies"/><title type='text'>裁缝·高粱</title><content type='html'>&lt;div&gt;
  &lt;img src=&quot;https://pyxis.nymag.com/v1/imgs/919/26b/9228f3d0d21606075946b891e1e3890689-the-dressmaker-10.w710.jpg&quot; width=&quot;480&quot; height=&quot;320&quot;/&gt;
&lt;/div&gt;

&lt;div data-markdown&gt;
在Netflix上看了一部2015年的电影，[The Dressmaker](https://www.imdb.com/title/tt2910904/)。剧情起伏挺巧妙，不错的黑色喜剧。

Tilly 一袭红衣霸气地站在小镇的 &quot;Grand Final&quot; 那尘土飞扬的赛场前，画面风格让人印象深刻。

谷歌了一下为什么Teddy第二次跳入谷仓会和前一次结果不同，原来“高粱结构不均匀，粒大，堆起来占地方，很虚，从高处跳进去会陷很深，造成压迫胸腔无法呼吸-------引用豆瓣解释的”。

&gt; It&#39;s not wheat, Barney. It&#39;s sorghum.

新单词get —— **sorghum**

&lt;div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jlazy.blogspot.com/feeds/5981682176594724656/comments/default' title='博文评论'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/1804640066725252559/5981682176594724656' title='0 条评论'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1804640066725252559/posts/default/5981682176594724656'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1804640066725252559/posts/default/5981682176594724656'/><link rel='alternate' type='text/html' href='http://jlazy.blogspot.com/2021/12/blog-post.html' title='裁缝·高粱'/><author><name>懒人 J</name><uri>http://www.blogger.com/profile/14311605983580876556</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1804640066725252559.post-158661046236215405</id><published>2021-08-15T15:28:00.000+10:00</published><updated>2021-08-15T15:28:46.965+10:00</updated><title type='text'>追剧【暑期】</title><content type='html'>&lt;div data-markdown&gt;

一个项目从2020年头上开始一直忙到七月初，终于结束了初始阶段，在TSA结束前部署到了AWS。虽然不能说是「多亏了疫情导致的WFH」，但这一年多的工作时间明显是要比 COVID 之前多的……好在学到的东西也不少。

七月下旬借着「暑期」的名义（虽然实际的天气并非酷暑……）又开始了追剧，先是把去年攒下来的「半泽直树2」给看了，然后又看了今年出品的「龙樱2」。虽然没有看过第一部的龙樱，不过听说口碑还不错，看下来剧情也还行，中间穿插了他们备战高考的各种技巧，挺有意思的。

本打算看看国内有啥好看的剧集，暂无发现，反倒是LD居然对耽美剧「山河令」产生了兴趣……

上周刚开始看「短剧开始啦」，熬过了第一集之后慢慢觉得有趣了起来。

另外，在油管下了几段小视频，结果意外的发现you-get将视频和音频分开来保存。貌似以前一直都是直接单文件保存的啊？研究后发现是因为格式化的macOS没有安装ffmepg导致的。参考了[这篇文章的命令](https://iitii.github.io/2019/05/01/1/)合并了一下就解决了。而且重新安装了 ffmpeg 之后you-get也恢复了正常。

&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://jlazy.blogspot.com/feeds/158661046236215405/comments/default' title='博文评论'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/1804640066725252559/158661046236215405' title='0 条评论'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1804640066725252559/posts/default/158661046236215405'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1804640066725252559/posts/default/158661046236215405'/><link rel='alternate' type='text/html' href='http://jlazy.blogspot.com/2021/08/blog-post.html' title='追剧【暑期】'/><author><name>懒人 J</name><uri>http://www.blogger.com/profile/14311605983580876556</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1804640066725252559.post-6349583600470368924</id><published>2020-12-31T22:46:00.002+11:00</published><updated>2020-12-31T22:46:17.435+11:00</updated><title type='text'>写在 2020 的最后一天</title><content type='html'>&lt;p&gt;今年无疑是难以令人忘记的一个年份……&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;因为疫情的关系，从三月份开始WFH。&lt;/p&gt;&lt;p&gt;升降桌的使用率大幅提升，显示器支架也派上了大用场。&lt;/p&gt;&lt;p&gt;慢慢的把客厅的一角变为了“工作空间”，发现了部分家具布局的问题，逐渐开始调整。&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;网购了很多东西，也订阅了很多服务，&lt;/p&gt;&lt;p&gt;年末的时候找ISP解决宽带掉线的问题，NBN的技术人员上门换了新的Connection Box，接线口也都给换了，再配上新入手的无线路由器，嗯嗯，上网的稳定性带来了莫名的安全感。&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;再过不到100分钟就是新的一年了，&lt;/p&gt;&lt;p&gt;2021 新的希望～祝所有的人都身体健康&lt;/p&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jlazy.blogspot.com/feeds/6349583600470368924/comments/default' title='博文评论'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/1804640066725252559/6349583600470368924' title='0 条评论'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1804640066725252559/posts/default/6349583600470368924'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1804640066725252559/posts/default/6349583600470368924'/><link rel='alternate' type='text/html' href='http://jlazy.blogspot.com/2020/12/2020.html' title='写在 2020 的最后一天'/><author><name>懒人 J</name><uri>http://www.blogger.com/profile/14311605983580876556</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1804640066725252559.post-7496037985360077613</id><published>2020-12-29T12:55:00.002+11:00</published><updated>2020-12-29T12:55:18.178+11:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="housework"/><category scheme="http://www.blogger.com/atom/ns#" term="pliers"/><title type='text'>Roller Shutter 电路控制器需要的绝缘垫片</title><content type='html'>&lt;div data-markdown&gt;
电动卷帘窗最近一直有问题，盘查下来应该不是电池本身的问题，因为另一扇窗户开关正常，而且更换了wall plate之后仍旧如此。

于是开始寻思是否是wall plate背后那根电线的接触不好，唯一可能的只有接头处的垫片，但如果需要重做的话需要有一个Wire Stripper Plier，而且还要找到对应的垫片型号。

上网搜索了一圈，发现大概是名为 Insulated Terminal 或是 Crimp Terminal 之类的东西，根据垫片的具体形状还分为很多类：

* RV (Ring Terminal)
* SV (Spade Terminal)
* BV (Butt Connector)
* FDD (Female Disconnector)
* MDD (Male Disconnector)

我所需要的类型大概是 `fdd1.25-250` 之类的吧。

&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jlazy.blogspot.com/feeds/7496037985360077613/comments/default' title='博文评论'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/1804640066725252559/7496037985360077613' title='0 条评论'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1804640066725252559/posts/default/7496037985360077613'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1804640066725252559/posts/default/7496037985360077613'/><link rel='alternate' type='text/html' href='http://jlazy.blogspot.com/2020/12/roller-shutter.html' title='Roller Shutter 电路控制器需要的绝缘垫片'/><author><name>懒人 J</name><uri>http://www.blogger.com/profile/14311605983580876556</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1804640066725252559.post-4414322579028396357</id><published>2020-12-25T16:48:00.003+11:00</published><updated>2020-12-25T16:48:49.637+11:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Powershell"/><category scheme="http://www.blogger.com/atom/ns#" term="Windows"/><title type='text'>调整网络适配器的优先级</title><content type='html'>&lt;div data-markdown&gt;

参考[这篇文章](https://www.windowscentral.com/how-change-priority-order-network-adapters-windows-10) 重置了几个网络适配器的优先顺序。

Powershell命令：

```
&gt; Get-NetIPInterface

&gt; Set-NetIPInterface -InterfaceIndex 30 -AutomaticMetric enabled
```

根据文章描述，也可以手动修改每个网络适配器对应的Metrics （跃点数），数值越低则优先级越高。

  
  
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jlazy.blogspot.com/feeds/4414322579028396357/comments/default' title='博文评论'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/1804640066725252559/4414322579028396357' title='0 条评论'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1804640066725252559/posts/default/4414322579028396357'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1804640066725252559/posts/default/4414322579028396357'/><link rel='alternate' type='text/html' href='http://jlazy.blogspot.com/2020/12/blog-post.html' title='调整网络适配器的优先级'/><author><name>懒人 J</name><uri>http://www.blogger.com/profile/14311605983580876556</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1804640066725252559.post-750716538571806044</id><published>2020-09-10T21:36:00.003+10:00</published><updated>2020-09-10T21:36:20.967+10:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="docker"/><category scheme="http://www.blogger.com/atom/ns#" term="Hyper-V"/><category scheme="http://www.blogger.com/atom/ns#" term="Windows"/><title type='text'>Update Docker Desktop to use WSL2</title><content type='html'>&lt;div data-markdown&gt;
  
PC 总算吃到了 Windows 10 的 2004 版本更新。
  
重启完毕之后 Docker Desktop 提示说可以将后端从 HyperV 虚拟机改为 WSL2，效能更佳。
  
听信了“广告”，下载了一个微软的内核更新程序，安装顺利，然后重启 Docker Desktop 就给跪了……错误信息说是

&gt; &#39;C:\Users\john.doe\AppData\Local\Docker\vm-config\config.iso&#39; 正由另一进程使用

搜索万能的 Google 后找到了这篇讨论： https://github.com/docker/for-win/issues/6822
  
简单来说就是 HyperV 仍旧在用，要么是到 HyperV 的管理器里头 shutdown 为 Docker 服务的那台虚拟机，并设置为不再随操作系统自动启动，然后重启一下 Docker Service；要么跑几个命令行分别关闭 Docker Desktop 和 WSL 再逆序启动。依据第一个方法速度解决了这个问题。
 
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jlazy.blogspot.com/feeds/750716538571806044/comments/default' title='博文评论'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/1804640066725252559/750716538571806044' title='0 条评论'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1804640066725252559/posts/default/750716538571806044'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1804640066725252559/posts/default/750716538571806044'/><link rel='alternate' type='text/html' href='http://jlazy.blogspot.com/2020/09/update-docker-desktop-to-use-wsl2.html' title='Update Docker Desktop to use WSL2'/><author><name>懒人 J</name><uri>http://www.blogger.com/profile/14311605983580876556</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1804640066725252559.post-7893070108421275912</id><published>2020-06-14T22:34:00.003+10:00</published><updated>2020-06-14T22:34:50.380+10:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="TV"/><title type='text'>换电视记（二）</title><content type='html'>&lt;div data-markdown&gt;
恶补了现在的电视知识。第一部分是关于画质的，Youtube 上看了几个视频：

1. [画质的秘密](https://www.youtube.com/watch?v=fHoKrUfHCvk)
2. [神仙打架](https://www.youtube.com/watch?v=8lI70URJuDk)

简单来说，电视机的“画质”也就是亮度、对比度和色彩管理的关系。

* 亮度

    CRT电视由于技术限制，亮度的最高峰值在 150 nit，因此，早期的 SDR 规定，影视视频的亮度不能超过 100 nit。

    但是，人眼的适应范围在 3000 nit 左右，而且可以感知的范围在 0.001 - 1,000,000 nit。这意味着在 SDR 标准显示范围内，会有大量的细节丢失。

    现在的液晶电视普遍可以达到 400 nit 左右，于是，影视工业的 HDR 标准将亮度的最大值从 100 nit 提升到了 1000 nit。

* 对比度

    但是随着亮度的提升，带来了另一个问题——如果屏幕上需要显示黑色的部分刚好靠在明亮的部分，那么，由于LED的发光原理会导致明亮部分附近一整片的亮度提升，也就是无法显示“纯粹的”黑色。OLED就没有这个问题。

    为了解决这个问题，三星开始发力 [QD-OLED](https://tech.sina.com.cn/e/2018-11-28/doc-ihpevhcm0590873.shtml)，这也是一种自发光的平板电视技术，不过该技术 2019 刚刚发布，当下尚未实现量产。

    而有的 LED 厂商选择了不同的思路，例如使用直下阵列式背光，就可以做到小区域的光暗控制。不过，在某些情况下，例如夜空中的一颗星星，由于星星所在的那一块还是要发光，所以仍旧会有光晕的存在。

    如果愿意堆料，将LED光珠做的足够小，就可以既满足微小区域的高亮度，又实现接近 OLED 的暗场效果。例如苹果，就在自家的显示器里使用了 mini-LED 技术，在 32 英寸的小显示器里实现了 576 个分区背光，当然，这块屏幕，还不算支架，就需要4万块大洋！

    不仅如此，为了更好的控制对比度，电视机的芯片还可以使用算法对画面进行扫描，识别出哪些区域需要高亮，而哪些需要控制暗场。这一技术甚至在 OLED 电视上也被使用。在索尼的黑科技树里，这被称为 Pixel Contrast Bootster （像素级对比增强），而最近刚发布的华为智慧屏也有类似的 Local DCI：

    &gt; LDCI 也是通过逐帧提取画面亮度和数据量信息与 OLED 的极限性能实时匹配，将整幅画面分割为超过10万个单元格，对每个单元进行独立的对比度优化。

* 色彩管理

    最后一部分是色彩——人眼可以感知到的色彩范围远远比屏幕所能渲染的范围大。

    颜色过渡，也就是色阶控制，可以反映电视机的色彩范围。以前的影视工业所用的 100% SRGB 最多也就只能显示肉眼可见的 30% 的颜色范围。近年来 Apple 主推的 DCI-P3 色域，将这一范围提高到了肉眼可见的 45%。可以支持 P3 色域的电视也被称为广色域电视。

    除了色域要广，颜色的还原也要准。高端电视通常在出厂前都会有色准的调教测试，也就是常见的 DeltaE 的值。

    为了还原真实世界的清晰度，还需要影视片源的解码——目前大部分的视频来源，包括电视信号和网络视频，很多都仍旧是基于 SRGB 来制作，所以电视机需要可以将颜色映射到更为广阔的色彩范围。

    色彩调教需要大量的片源进行测试，不同厂家的调色倾向也各有侧重。不过，电影和普通的电视不同，大多数电影本身就经过了工业级的调色，被加上了一层非常细致的“滤镜”，融入了导演对于画面氛围的理解，和剧情本身需要传达的情绪，所以，通常在电视机设置里，从“标准”模式改为“电影”模式，是在减少调色倾向的，电视机会更加忠实的还原片源的色彩。

    因此，使用高端电视来观看电影的时候，尽量要使用低压缩率的片源。但是，在网络视频大行其道的今天，即便VIP会员可以选择“蓝光画质”也依旧是压缩到只有几个 GB 的数据量。因此，这就需要画质芯片的加入——先对画面降噪，再对每一帧画面分析，与内部的数据库对比，再对画面进行“修复”。

    因此，电视机的参数看起来够漂亮，不表示实际观看的时候就可以媲美高端机型。魔鬼总是在细节——在颜色映射的时候，并不是简单的线性函数。例如，影视作品中极为常见的人物肤色，就不应该过于鲜艳。另外，像是天空、草地、海洋这样的“记忆色”也不宜被映射的过于浓烈。

    在智能手机时代，华为的 AI 技术也非常强劲，它的相机拍摄出来的照片经过 AI 调教之后非常漂亮。同样道理，索尼在调教颜色的时候具有先天优势——算法可以买，但是数据库要依靠长期大量数据的积累。索尼的产品遍及广播电视系统的上下游，无论是传感器、相机，还是摄像机，从拍摄到播放处处可见 Sony。因此，在需要从被压缩劣化过的素材中还原出“真实”的图像时，索尼的TRILUMINOS Display（特丽魅彩）充分显示了大法的色彩管理水平。

    在体育列节目中，经常会有高速运动的物体，画质补偿就是芯片的另一个重要作用。技术上通常会通过插入帧来提高帧率，减少色阶，使用超分算法等。


&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jlazy.blogspot.com/feeds/7893070108421275912/comments/default' title='博文评论'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/1804640066725252559/7893070108421275912' title='0 条评论'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1804640066725252559/posts/default/7893070108421275912'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1804640066725252559/posts/default/7893070108421275912'/><link rel='alternate' type='text/html' href='http://jlazy.blogspot.com/2020/06/blog-post_14.html' title='换电视记（二）'/><author><name>懒人 J</name><uri>http://www.blogger.com/profile/14311605983580876556</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1804640066725252559.post-1764589381637954658</id><published>2020-06-14T21:02:00.001+10:00</published><updated>2020-06-14T21:02:59.016+10:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="TV"/><title type='text'>换电视记（一）</title><content type='html'>&lt;div data-markdown&gt;
现在用的三星40寸总是感觉太小，不过由于现有的电视柜的尺寸也不大，长宽高分别是 120cm x 40 cm x 58 cm，搁在上面倒是合适的。由于电视柜和沙发的摆放角度，看电视的时候基本上必须要坐在沙发的左侧，否则视角就很糟糕。

在这个周末先把L形的沙发给转了90度，准备将电视机安放在落地窗前，这样可以充分利用落地窗前的开阔空间。在没有购买新的长电视柜之前，先把茶几临时当电视柜给布置了起来——不出所料，立马享受到了更佳的电视观看角度。

于是就有了新的想法——买一张更长的（预计 180cm 或是 200cm）电视柜，配上大屏幕的电视才爽嘛～

花了不少时间做了一下研究，决定搜索符合以下条件的电视机：

1. 4K

    8K的机型虽然现在各个品牌都有，不过考虑到技术成熟性、资源丰富程度，以及价格，暂时不做考虑。

    4K的电视机现在基本上都支持HDR，这样XBOX 1x 就可以发挥显卡的威力了。

2. 55 寸或是 65 寸

    小于 50 寸的不考虑，太大（超过65寸）的话领导不批准……

    早年有关于买电视的尺寸和看电视的距离成正比的说法，印象中需要3m-4m的距离，否则容易损害视力。仔细查了查知乎，发现那些都是基于老式显像管技术的算法，现在都是平板电视，基本上距离2.5m看65寸的没问题，甚至有回答说只取决于钱包的深度。

3. OLED 或是支持整列式背光

    早期LED的背光都是一整块屏幕同时控制的，所以显示全黑的时候总是会漏光。OLED由于其发光原理的不同，基本上是像素级别的控制。

    好在近年来有了阵列式背光这样的技术，简单来说就是将整块屏幕切割为几十块甚至是成百上千块的分区来控制，使得 LED 的控光效果有了突破性的改善。舍得堆料的机型甚至可以媲美 OLED 的黑色效果。


&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jlazy.blogspot.com/feeds/1764589381637954658/comments/default' title='博文评论'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/1804640066725252559/1764589381637954658' title='0 条评论'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1804640066725252559/posts/default/1764589381637954658'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1804640066725252559/posts/default/1764589381637954658'/><link rel='alternate' type='text/html' href='http://jlazy.blogspot.com/2020/06/blog-post.html' title='换电视记（一）'/><author><name>懒人 J</name><uri>http://www.blogger.com/profile/14311605983580876556</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1804640066725252559.post-1953897433331479344</id><published>2020-06-07T15:36:00.000+10:00</published><updated>2020-06-07T15:36:44.108+10:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Router"/><title type='text'>如何拯救变砖的荣耀路由Pro</title><content type='html'>&lt;div data-markdown&gt;
昨晚XBox打开后发现连不上网络，无论是有线还是无线都连不上。按着Hi键貌似也没反应，怒拔电源重开，结果杯具了——电源插回去之后，发现Hi键背光灯一直是橙色的，等了一会儿也是没有用，后来试着按Hi键超过十秒，希望重置为出厂模式来解决，也是无效……

好在家里还有一台备用的无线路由，启用了SSID后救急。

今天上午干脆把荣耀路由Pro接到笔记本上，花了一个多小时翻来覆去地倒腾Hi键，发现有时候会响应，灯灭了之后感觉上是“重置”，ping 默认的IP地址也可以通，但无法访问到web interface。

上网看了一圈，猜测有可能是刚好路由器在更新，结果被我拔了电源……于是集中精力研究固件是否可以再刷入。

搜索中看到了有的大牛[通过购买编程器来重新刷入固件]( https://post.smzdm.com/p/ar08wxl7/)，大开眼界。
华为[自己的产品页面]( https://www.honor.cn/support/products/home-internet-media/honor-router-pro/)上居然没有提供固件的下载链接！
好在通过搜索“华为荣耀路由pro固件”还有其型号“WS851”之类的关键字，找到了一个很老的版本 1.1.22，先在本地放了这个bin文件以备不时之需。

看到[花粉俱乐部的帖子](https://club.huawei.com/thread-7158236-1-1.html)介绍了其他型号的华为路由如何进入紧急恢复页面，抱着死马当活马医的想法尝试了一下，居然有用！

心中默念了N遍“楼主好人”，把具体步骤记录如下：
1. 将路由器断电，WAN入口仍旧是接着互联网，笔记本通过网线连到路由器
2. 笔记本上准备好事先下载好的固件
3. 笔记本手动设置IP地址为 `192.168.0.X`，（`X`可以是除了1-254之间，除了100之外的任何整数）。子网掩码自然还是 `255.255.255.0`，网关无所谓，随便写`192.168.0.1`。
4. 一直按住Hi键，然后给路由通电，然后浏览器打开 `192.168.0.100` 这个地址，如果看到页面显示文本和按钮允许上传固件，就可以松开Hi键了。
5. 上传固件后等待三五分钟左右，然后切换回DHCP地址，重新访问 `192.168.3.1` 应该可以看到web interface了。


恢复到这个老版本的固件后，自然还需要慢慢地升级到最新的版本。顺手将自动更新给禁用了，以后还是由我自己操作比较合适！
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://jlazy.blogspot.com/feeds/1953897433331479344/comments/default' title='博文评论'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/1804640066725252559/1953897433331479344' title='0 条评论'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1804640066725252559/posts/default/1953897433331479344'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1804640066725252559/posts/default/1953897433331479344'/><link rel='alternate' type='text/html' href='http://jlazy.blogspot.com/2020/06/pro.html' title='如何拯救变砖的荣耀路由Pro'/><author><name>懒人 J</name><uri>http://www.blogger.com/profile/14311605983580876556</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1804640066725252559.post-7476300686226436294</id><published>2020-06-06T15:48:00.000+10:00</published><updated>2020-06-06T15:48:43.987+10:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Archlinux"/><category scheme="http://www.blogger.com/atom/ns#" term="Linux"/><category scheme="http://www.blogger.com/atom/ns#" term="NVIDIA"/><category scheme="http://www.blogger.com/atom/ns#" term="yay"/><title type='text'>Archlinux Desktop Setup - Bumblebee issue caused by NVIDIA driver</title><content type='html'>&lt;div data-markdown&gt;
不知道何时起，我的老 Dell 笔记本上的 Bumblebee service 就停止工作了。想要跑个 `optirun glxgears -info` 居然提示说 Bumblebee 服务没有启动……

找到以前的blog以及Arch的wiki仔细研究了一下，发现大概是曾经安装的nvidia驱动在某次系统更新后就出问题了。按照 [这个人的说法](https://www.reddit.com/r/archlinux/comments/a5nw93/cant_find_nvidia_module_when_doing_modprobe_nvidia/)，我又回到wiki里面仔细对比了自己的设备型号，发现貌似不应该安装 `nvidia-390xx`：

&gt; For GeForce 400/500/600 series cards [NVCx and NVDx] from around 2010-2011,
&gt; install the nvidia-390xx-dkmsAUR package.

于是抱着试一试的心态，重新安装了这个包，中间自然将原本的那个 package 给删除了：

    ➜  ~ yay -S nvidia-390xx-dkms
    :: Checking for conflicts...
    :: Checking for inner conflicts...

    ==&gt; Package conflicts found:
     -&gt; Installing nvidia-390xx-dkms will remove: nvidia-390xx

    ==&gt; Conflicting packages will have to be confirmed manually

    [Repo: 1]  dkms-2.8.1-3
    [Aur: 1]  nvidia-390xx-390.132-37 (nvidia-390xx-dkms)

    :: Downloaded PKGBUILD (1/1): nvidia-390xx (nvidia-390xx-dkms)
      1 nvidia-390xx (nvidia-390xx-dkms)         (Build Files Exist)
    ==&gt; Diffs to show?
    ==&gt; [N]one [A]ll [Ab]ort [I]nstalled [No]tInstalled or (1 2 3, 1-3, ^4)
    ==&gt; I
    :: Parsing SRCINFO (1/1): nvidia-390xx (nvidia-390xx-dkms)

    .......

    (1/3) Arming ConditionNeedsUpdate...
    (2/3) Updating module dependencies...
    (3/3) Install DKMS modules
    ==&gt; dkms install nvidia/390.132 -k 5.6.15-arch1-1

重启系统后一试，dkms 果然有效：

    ➜  ~ sudo dkms status
    nvidia, 390.132, 5.6.15-arch1-1, x86_64: installed

Bumblebee 服务也回来了！

    ➜  ~ sudo systemctl status bumblebeed.service
    ● bumblebeed.service - Bumblebee C Daemon
         Loaded: loaded (/usr/lib/systemd/system/bumblebeed.service; enabled; vendor preset&gt;
         Active: active (running) since Sat 2020-06-06 14:43:55 AEST; 1h 1min ago
       Main PID: 430 (bumblebeed)
          Tasks: 1 (limit: 9472)
         Memory: 34.3M
         CGroup: /system.slice/bumblebeed.service
                 └─430 /usr/bin/bumblebeed

测试渲染帧率的程序也可以在独显下面跑了：

    ➜  ~ optirun glxgears -info
    GL_RENDERER   = GeForce GT 520M/PCIe/SSE2
    GL_VERSION    = 4.6.0 NVIDIA 390.132
    GL_VENDOR     = NVIDIA Corporation
    GL_EXTENSIONS = GL_AMD_multi_draw_indirect GL_ARB_arrays_of_arrays ...

    7397 frames in 5.0 seconds = 1479.394 FPS
    7270 frames in 5.0 seconds = 1453.818 FPS

之后参考 Wiki 又添加了[一个 hook 文件](https://wiki.archlinux.org/index.php/NVIDIA#Pacman_hook)，以确保今后 NVIDIA driver 更新或是 Linux 更新都会正确的更新 `initramfs` 。

还需要继续研究的问题是，为什么外界显示器之可以接在 HDMI 口上，如果换到 Display Port 就一点都没有反应。
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://jlazy.blogspot.com/feeds/7476300686226436294/comments/default' title='博文评论'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/1804640066725252559/7476300686226436294' title='0 条评论'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1804640066725252559/posts/default/7476300686226436294'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1804640066725252559/posts/default/7476300686226436294'/><link rel='alternate' type='text/html' href='http://jlazy.blogspot.com/2020/06/archlinux-desktop-setup-bumblebee-issue.html' title='Archlinux Desktop Setup - Bumblebee issue caused by NVIDIA driver'/><author><name>懒人 J</name><uri>http://www.blogger.com/profile/14311605983580876556</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>