Anduin

let today = new Beginning();

Featured Posts


Install Nextcloud on a Ubuntu 20.04 server

Step 1 - Buy a server and basic configuration You can buy a pure server at Vultr. After you installing a pure Ubuntu, or buying a new cloud Ubuntu server, you need to first finish the basic authentication configuration. Follow instructions here to: Delete other accounts. Create your own account instead of root. Disable password login and force to use SSH key to log in. Disable root account.  …

Web Linux Ubuntu IT Apache2 PHP MySQL Certbot Nextcloud Storage

Install Windows 11 on Vultr cloud machine

In this blog, I gonna draft a solution for you to install any Windows OS on the Vultr cloud server.   Before starting Before starting, there are several points about why I choose Vultr and why you need to build a Windows 11 image on Vultr. Vultr is cheap Compared with other cloud service providers, Vultr is cheap. A 4GB RAM, 80GB SSD machine, costs about 24USD per month. While other platforms  …

PowerShell Windows Server Cloud Windows Windows 11 DISM Bcdedit Vultr Cloud PC

Validate an object in any C# projects

Sometimes, we need to check if the input is valid. Usually, we may do this: if (string.IsNullOrWhiteSpace(InputArgument.TargetMachine) || string.IsNullOrWhiteSpace(InputArgument.PatchId)) { throw new ArgumentException($"Invalid input argument! Patch ID: '{InputArgument.PatchId}', Target Machine: '{InputArgument.TargetMachine}'!");  …

ASP.NET Core C# .NET Validation

Install Windows 11 side-by-side without a USB drive

This tutorial only for existing Windows users which needs to install the second Windows along-side it without USB disk or CD. How When you have the Windows installer, you can directly unzip the install.wim to a new partition. This process does not need to restart or enter the PE environment, so no USB storage disk nor CD is required.   After the decompression is complete, directly boot the new  …

Windows 10 PowerShell Windows Windows 11 Install DISM Bcdedit Boot BCD

FFmpeg 用法概览

背景 最近买了个4K,144Hz的 HDR 显示器。新的显示器很不错,于是我想先进行测试一下。 于是我下载了非常多 4K 视频,准备观赏观赏。但是很快发现,怎么得到最优质的播放体验还是一个深坑。而衡量视频质量,除了看分辨率,还要看编码格式,码率,色彩,HDR等信息。 显然,现在折腾视频,最方便的工具就是 ffmpeg 了。FFmpeg 是一个开放源代码的自由软件,可以执行音频和视频多种格式的录影、转换、串流功能,非常适合快速、批量的修改视频。 开始之前 安装ffmpeg ffmpeg 的最新版下载地址始终都是: https://www.gyan.dev/ffmpeg/builds/ffmpeg-git-full.7z 直接将其下载,解压,放到一个地方,将 exe 文件所在路径加入环境变量 PATH 即可。 了解视频的编码格式 开始之前,需要先了解平时经常使用的编码格式和平台支持情况,以及什 …

bash FFmpeg

C# run tasks in a threads pool with fixed size

Imagine I have 100 tasks to run. But my machine has only 16 core. So I expect that every core will run one task in parallel. And once a core is idle, assign a new task to it. That will be very easy for C# with Task. But before starting, we gonna create a thread-safe queue for saving our tasks. public class SafeQueue<T> { private readonly Queue<T> queue = new Queue&  …

C# Async Task Multi-Threading

Fire and forget in ASP.NET Core with dependency alive

C# fire and forget might not be suitable in ASP.NET Core To fire and forget in C#, it is really simple: Task.Run(() => FireAway()); But the same approach might not be suitable in ASP.NET Core Controller. Consider the following example: public class MyController : Controller { private readonly MyHeavyDependency _hd; public MyController(MyHeavyDependency hd) { _hd  …

ASP.NET Core C# Async Fire and forget

Best-practice for authentication after creating a new Linux server

This article helps you change the following items if your cloud provider didn't do that for you. Create your own account instead of root. Disable password login and force to use SSH key to log in. Disable root account. Enable sudo without password. Before starting the process, make sure you have a valid SSH key-pair locally. Fist, connect to the server. (With root password). you@local  …

bash Linux Ubuntu SSH

微信的架构是如何实现分布式消息分发?

我们每天的生活都离不开微信。微信基本上已经成了在中国生活的一部分。 但是,微信有些方面的功能总是看起来令人觉得有些奇怪。例如: 微信几乎是第一款需要手机扫码才能登录PC端的 微信群和微信聊天记录在切换设备后会完全无法同步 你无法得知自己是否被一个微信好友拉黑了 你不能同时在多个移动设备上同时登录微信 从产品的角度来看,这些设定看起来彷佛是在给用户制造障碍,也成了大家普遍对微信的槽点。那么,微信的团队为什么要这么设计,而为什么又不改良它的体验呢?我想或许问题并不只是产品和需求分析这么简单,而是还需要进一步探寻架构上的本质。 在我生活在澳大利亚期间,我发现一件很有趣的事情:在澳大利亚,我使用微信给同样在澳大利亚的好友发送微信消息,他也可以几乎瞬间收到。假想微信在国内建立单点的服务器,那么这种性能一定不足以支撑澳大利亚内的通信。数据从澳洲抵达中国再从中国推送到澳洲至少需要500ms。而表现来看 …

Web WeChat Distributed Messging IM

EF second layer cache to enhance your SQL database performance based on Redis

Entity-Framework Core is a lightweight, extensible, open-source, and cross-platform version of the popular Entity Framework data access technology. It really helps the developer to build applications which access database easily. But in most cases, we may cache some results which do not change frequently, to reduce access to our database. For example, the home page of a blog may not change  …

ASP.NET Core C# SQL Server SQL Entity Framework Core Azure Redis Caching Cache


Get an ideal flight simulator free based on X-Plane 11 (Free plugins)

Video: https://www.youtube.com/watch?v=nRMQn8rdZ-4 Or(China edition):   https://www.bilibili.com/video/BV1Tg4y1z7UP Before reading this, you need to have X-Plane 11 installed. Buy X-Plane 11 here: https://www.x-plane.com/ Every time I install X-Plane 11, I gonna install many plugins to get better fly experience. And I will try to list all the plugins I use free which helps me to get perfect fly  …

X-Plane Flight simulation Flight Plugins Plane Configuration Free