ntzyz's space

∠( ᐛ 」∠)_

Category

  • Algorithm
  • Figures
  • Gameplay
  • Linux
  • Network
  • Other
  • Photos
  • Web

Tags

  • Linux
  • JavaScript
  • PS4
  • A6300
  • A7M3
  • FE55
  • HTML5
  • OpenWrt
  • AudioContext
  • PowerShell
  • 雪
  • Network
  • systemd
  • 狗
  • iptables
  • VPN
  • Arcaea
  • node
  • 手办
  • 猫
  • Tunnel
  • Web
  • Sekiro
  • MySQL
  • NAT
  • Minecraft
  • Node
  • WebAssembly
  • USB
  • CAPCOM
  • Gaming
  • Highcharts.js
  • Arch Linux
  • HTML
  • UEFI
  • GitHub
  • iSCSI
  • HDOJ
  • MediaSource
  • MPV
  • FromSoftware
  • FE24105G
  • Highlight.js
  • CI
  • IPv6
  • SDL
  • Algorithm
  • WireGuard
  • SVP
  • MHW
  • PPTP
  • UglifyJS
  • NVMe
  • SQLite
  • CSharp
  • Routing
  • LeetCode
  • PHP
  • Surface

Recent replies

  • spinmry 发表于「CoreMark WebAssembly」
  • spinmry 发表于「CoreMark WebAssembly」
  • ntzyz 发表于「CoreMark WebAssembly」
  • Hatsuroku 发表于「CoreMark WebAssembly」
  • Kyle 发表于「用 Elastic Stack 拯救 Telegram 的中文搜索」
  • ShellBin 发表于「Cinebench」
  • ntzyz 发表于「Windows 10 网络连接共享重启失效的临时解决方案」
  • Hughton 发表于「Windows 10 网络连接共享重启失效的临时解决方案」
  • Gaein nidb 发表于「使用 UEFI Shell 加载 NVMe 驱动」
  • ShellBin 发表于「DSC01764」

Links

About me
WordPress 存档
Cinebench 跑分记录
Coremark WebAssembly 跑分记录
Hpoi 手办维基 个人页
ZephRay
>Lithia's Core
业余无线电台 BD4SUR
Ferrets 家的 Wordpress
spinmry实验室
Yuno's Wonderland
notonokodds
春上冰月的博客
kasora's blog
徐靖峰 | 个人博客
蒋炜成 | 个人博客
Test2g
447f.Misaka
Project RC
Shell Bin
分类:Other

[4K] 快乐的农夫(可爱的钢琴古典名曲)

2021 年 2 月 14 日分类:Other

The Merry Farmer, Op. 68, No. 10, by Robert Schumann

不过我这个不是完整版,简化过,反正能力有限,不丢人(

这首曲子不难,但是很奇怪的是让人觉得很快乐(正如其名),就录了一段视频,平时我只录音的 _(:з」∠)_ (毕竟三脚架相机声卡啥的全都要摆起来还要调试)

虽然说刚开始挺快乐的,但是录的过程中经常出小错误反复重试到最后也不快乐了(死

MORE

用 Elastic Stack 拯救 Telegram 的中文搜索

2020 年 9 月 3 日分类:Other
Telegram 的中文搜索是出了名的难用,只要涉及到中文、或者中英文混杂,就原地暴毙:

就比如遇到这种想找黑历史的时候,搜索功能摆在这里却用不了,只能原地感叹一句要你何用。忍忍总也有个限度,当我第 n 次想找历史记录但是无论如何也找不到的时候,一拍脑袋:

MORE

Load NVMe Driver in UEFI Shell

2019 年 11 月 27 日分类:Other#NVMe#UEFI
Hint: this post is also available in Chinese.

Four months ago I brought an HP Z620 workstation to run virtual machines at home with Hyper-V Server. Some days later I planned to replace the SSD in the workstation from Samsung 860EVO 500G to Intel DC P4510 2TB for more capacity and better performance. But after hardware upgrade I found that P4510 just didn't get recognize by the boot loader. It seemed that I need to do some more work to boot ESXi from this NVMe SSD.

The simplest solution is using Clover Boot Loader as secondary boot loader. But the automatic OS scans provided by Clover does not support VMware ESXi, meanwhile creating a custom entry is quite bother job as writing XML manually by human is just another disaster.

After some simple research I reached out that unified extensible firmware interface itself dose support load driver before OS boot, so EFI Shell with a customized startup script may solve this problem for me. Firstly create a ESP partition on one disk with GUID partition table which is recognizable by the stock firmware, copy UEFI Shell binary as well as the NVMe driver binary to that partition, then create startup.nsh in that partition with following script:

load -nc fs0:\NvmExpressDxe-64.efi
connect -r
map -u
fs1:\EFI\BOOT\BOOTX64.EFI

The script is quite easy to understand. But remember to change the locations and names of these binaries to your own.

After that, use efibootmgr under Linux or some utilities under Windows PE to create a new EFI boot entry with EFI shell as the loader, and then set it to default entry. Note that the disk alias may be different on each machine, to find out your own aliases just boot into the efi shell, load the NVMe driver and use the map command to show partition aliases.

May be the simplest solution is just install ESXi to one HDD and place all virtual disks in the NVMe SSD?

References

  1. [Guide] NVMe-boot without modding your UEFI/BIOS (Clover-EFI bootloader method)
  2. UEFI Shell Specification
  3. Error-handling in EFI startup shell scripts - Super User

尝试使用 Github Actions

2019 年 11 月 14 日分类:Other#GitHub#CI

其实这个叫 GitHub Actions 的持续集成已经上线很久了,在刚刚公开测试时我就尝试去使用,结果翻来翻去没找到 MongoDB 数据库的项目应该如何配置基础环境 不要问我当时为什么用了 MongoDB,我现在非常后悔(雾)。今天摸鱼的时候突然想到 Actions 支持 Docker,Docker 又能快速的启动一个 MongoDB 官方提供的容器,那么这就好办了,直接对着自己的博客下手,来试一试这个工具。

在仓库首页里点击 Actions 标签进入配置页面,并直接创建一个新的 Node CI 类型的 Workflow,这样就能获得一个适用于 node.js 项目的配置模版。和 Travis 一样,Actions 的模版配置也是使用 YAML 格式,写起来比 JSON 舒服多了。之后只需要在 steps 中添加以下内容即可启动一个 MongoDB 容器:

- name: Launch MongoDB
  run: |
    sudo docker container run --name mongo -v $PWD:/src -p 27017:27017 -d mongo
    sleep 4s
- name: Import initial database
  run: |
    sudo docker container ls --all
    sudo docker container exec mongo mongo localhost/newBlog /src/db.default.js
MORE

Temporary workaround for Windows 10 network connection sharing failure after reboot

2018 年 9 月 9 日分类:Other#PowerShell
Hint: this post is also available in Chinese.

The house I rented in Shanghai only provides wireless network (802.11n) to access the Internet, but I personally hope that I can get a faster wireless intranet and hide my network device from the outside, so I purchased a NETGEAR A6210 wireless network card featuring 802.11AC support and USB 3.0 interface, ready to make such a network connection:

+--------------------+       +-----------------------+
| LAN(802.11AC + GbE)| CAT5E |  HP ProLiant MS Gen8  |
| (PS4, Kindle, etc) +-------+  eth0: 192.168.137.1  |
|  192.168.137.0/24  |       | wlan0: 192.168.0.x/24 |
+--------------------+       +---+-------------------+
                                 | 802.11n
                             +---+------------+
                             | TP-LINK Router |
                             +----------------+

Implenemting this kind of structure is quiet simple for Linux PCs. You only need to enable ip_forward and execute iptables -t nat -A POSTROUTING -j MASQUERADE with root privilege. But unfortunately this USB3.0 wireless NIC has no driver in the mainline kernel. The open source driver provided by MTK has very bad performance under OpenWrt. In conclusion, it seems that the only choice of operating system is Windows.

Configuring such a network for Windows is very simple too. Right-clicking on the adapter of the wireless network card. Then select the Sharing tab, check Allow other network users to connect etc. Then choose the Ethernet Network Connection option from the dropdown. However, Microsoft has buried a bug in the implementation of network sharing in Windows 10: the network sharing will be broken after restarting the computer. Shared interface still providing DHCP service, but IP Forward is completely unavailable. After reactivate the network connection shareing, the problem can be solved.

So, we only need to prepare a scheduled task running the following PowerShell script to make the OS repeat this operation every time when it is booted:

$NetShare = New-Object -ComObject HNetCfg.HNetShare
$wlan = $null
$ethernet = $null

foreach ($int in $NetShare.EnumEveryConnection) {
  $props = $NetShare.NetConnectionProps.Invoke($int)
  if ($props.Name -eq "WLAN") {
    $wlan = $int;
  }
  if ($props.Name -eq "网桥") {
    $ethernet = $int;
  }
}

$wlanConfig = $NetShare.INetSharingConfigurationForINetConnection.Invoke($wlan);
$ethernetConfig = $NetShare.INetSharingConfigurationForINetConnection.Invoke($ethernet);

$wlanConfig.DisableSharing();
$ethernetConfig.DisableSharing();

$wlanConfig.EnableSharing(0);
$ethernetConfig.EnableSharing(1);

References

  1. NetConnectionSharing (PowerShell Module)
  • «
  • 1
  • 2
  • 3
  • »
Copyright © 2016-2019 ntzyz. All rights reserved.
Except where otherwise noted, content on this blog is licensed under CC-BY 2.0.