Anduin

let today = new Beginning();

All Posts in 2021.12


Auto backup for Minecraft on Linux

Recently, I was addicted to Minecraft. And I hosted a server. In order to backup the server automatically, I have tried many solutions. Git solution Git solution requires a lot of CPU when compressing the objects. And may impact the game performance since Java itself requires a lot of CPU. So I finally gave up Git.   Copy solution Copy the world folder to anther place is super simple. Before try  …

bash Linux Minecraft Backup

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

在一秒钟内打开苏康码

之前每次进公司,为了打开苏康码,都得翻半天支付宝和微信的小程序,非常痛苦。 尤其是手机卡住了,网不稳了,小程序框架本身就加载半天,弄得我经常尴尬的卡在门外,迟到,难受。 不过,我怎么看怎么感觉,这个苏康码好像就是个网页呀,如果能抠出来URL,自己用浏览器打开,岂不是相当方便快捷? 还可以省去天天翻各种小程序了。   获取苏康码 在下面地址获取苏康码: https://scm.szgaj.cn/wjw/health_skm.html (这并不需要你有任何App例如微信、支付宝,可以在PC上操作)   (防钓鱼:         这个URL的意思,看起来是 https://苏城码.苏州公安局.中国/微警务/健康_苏康码.html。经过检查备案信息,确实属于苏州公安局。再加上有HTTPS,应该不是钓鱼链接,可以放心输入个人信息)     加速这个过程 在你通过浏览器获取到苏康码后,可以复制  …

Web China Health Code

C# Play with GZip.

A extension class for string to add GZip features. Copy the following code to your project first. using System; using System.IO; using System.IO.Compression; using System.Text; public static class GZipExtensions { private static byte[] Zip(string str) { var bytes = Encoding.UTF8.GetBytes(str); using (var msi = new MemoryStream(  …

C# .NET Compress GZip Base64