profile
viewpoint

jiongjionger/NeverLag 79

一个专注于优化我的世界服务端性能、减少延迟、修复服务端/其他常用插件BUG、限制或禁用破坏多人游戏平衡的游戏机制的插件(A plugin that focuses on optimizing minecraft server performance, reducing server lag, fix server and popular plugin bug, limiting or disabling the game mechanism that hurt multiplayer balances.)

andylizi/bc-haproxy-detector 11

A BungeeCord/Spigot plugin that enables proxied and direct connections both at the same time.

SSmJaE/MyUserScripts 11

所有个人油猴脚本收录

andylizi/LaserLib 3

A bukkit plugin.

andylizi/chemical-balancer 2

Chemical balancer with a user-friendly UI.

andylizi/Gobang 1

A multiplayer Gobang game.

andylizi/ImpossibleBreak 1

A Minecraft anti-cheat plugin.

andylizi/vite 1

Next generation frontend tooling. It's fast!

startedAnarios/return-youtube-dislike

started time in a day

issue openedSuwings/MCSManager

MD5 不安全 & `Math.random()` 不安全

关于 MD5

MD5 在 1996 年就已经暴露出了安全隐患,2004 年实现了第一个完整的碰撞,而现在随便一台家用电脑都能在几秒内做到,因此在许多年前就早已不建议将 MD5 用于任何用途了。

目前最推荐使用的密码散列算法是 Argon2id。

以及,像 md5(md5(md5(password) + salt) + salt) 这样的方式对提升安全并没有帮助

关于 Math.random()

https://github.com/Suwings/MCSManager/blob/f4114820dd26a968977b070bd5618724d3691496/core/User/CryptoMine.js#L17-L26

登录验证时生成随机令牌的算法用的是 Math.random(),而它生成的随机数不是 cryptographically secure 的,理论上可以被攻击者预测,实践中也有人做到了,因此不建议将其用于与安全有关的用途。MDN 中 Math.random() 的条目 写道:

Note: Math.random() does not provide cryptographically secure random numbers. Do not use them for anything related to security. Use the Web Crypto API instead

created time in 3 days

issue commentChion82/netfilter-full-cone-nat

not working on 5.10.77

Were the rules added successfully? It's possible that the kernel module wasn't loaded, causing the commands to fail.

And, are you sure the rules should be applied to pppoe0? It's not the same as the external interface itself, as far as I know.

debiansid

comment created time in 8 days

issue commentChion82/netfilter-full-cone-nat

not working on 5.10.77

Define "not working" please.

debiansid

comment created time in 9 days

startedllogiq/momo

started time in 12 days

startedGoogleChromeLabs/comlink

started time in a month

issue commentrust-lang/rust

Tracking Issue for RFC 3137: let-else statements

Is that something folks have discussed before?

It was mentioned in the RFC, yes.

joshtriplett

comment created time in a month

issue commentXIU2/UserScript

[知乎增强] 屏蔽首页活动

@Remonli 我在此 issue 开头写的代码是能实现你的要求的,但它的原理是在页面加载后立即点击那个关闭按钮,因此横条的颜色不可避免的会闪一下。如果实在想要默认样式并且不在乎闪的这半秒的话,用那个也可以。

andylizi

comment created time in a month

issue commentExodusMovement/schemasafe

False positive `requireValidation` check with `minProperties`

Personally I can't think of any situations where minProperties + additionalProperties: false behavior can be unintentional. The alternative way of doing this would be to use anyOf + required, which is much more verbose, has oblique error messages and presumably compiles to longer code. Numbers larger than one can't be expressed in this way either.

The workaround of require: [] is also not immediately obvious and confusing to future readers. My thoughts after submitting this issue were, "Oh, I guess I just have to disable this check in the mean time then". And since requireValidation can't be trivially overrided in strong mode, I'm sure some people will be lazy enough to disable stronge mode entirely (!).

andylizi

comment created time in a month

startedExodusMovement/schemasafe

started time in a month

issue openedExodusMovement/schemasafe

False positive `requireValidation` check with `minProperties`

Description

{
    "type": "object",
    "minProperties": 1,
    "properties": {
        "phoneNumber": { "type": "string" },
        "emailAddress": { "type": "string" }
    },
    "additionalProperties": false
}

This schema will fail with [requireValidation] if properties is used, required should be specified.

The requirement in this case is not necessary because minProperties is specified and additionalProperties is set to false, so at least one of phoneNumber and emailAddress is already required without explicitly using the required keyword.

Related code

https://github.com/ExodusMovement/schemasafe/blob/81459f3c7162137c19e19d9b869f9e41d0bf8dde/src/compile.js#L1158

created time in a month

startedoconnor663/duct.rs

started time in 2 months

issue commentnvzqz/static-assertions-rs

Consider using `const_panic` in the future.

It's stabilized today.

konsumlamm

comment created time in 2 months

issue commentrust-analyzer/rust-analyzer

Type inference not working for `Deref`

I'm not sure this is the same issue, but Deref inference is also failing on Cow<T>:

deref_cow

str.as_ref().find() works fine. Switching from std::borrow::Cow to a minimal version (copy-pasted from std and removed all but necessary) works fine.

sticnarf

comment created time in 2 months

delete branch andylizi/libavif-rs

delete branch : fix-msvc

delete time in 2 months

PR opened njaard/libavif-rs

Fix MSVC build failure with `libaom`

#24 has been fixed by upstream so the original workaround became unnecessary, and it's somehow not working on my machine:

running: "cmake" "libavif-rs/libavif-sys/libavif" "-G" "Visual Studio 16 2019" "-Thost=x64" "-Ax64" "-DBUILD_SHARED_LIBS=0" "-DAVIF_ENABLE_WERROR=0" "-DAVIF_CODEC_AOM=1" "-DAOM_INCLUDE_DIR=libavif-rs/libaom-sys/vendor" "-DCMAKE_PREFIX_PATH=" "-DCMAKE_INSTALL_PREFIX=libavif-rs/target/debug/build/libavif-sys-6d57f1058e9a9e31/out" "-DCMAKE_C_FLAGS= -nologo -MD -Brepro" "-DCMAKE_C_FLAGS_RELEASE= -nologo -MD -Brepro" "-DCMAKE_CXX_FLAGS= -nologo -MD -Brepro" "-DCMAKE_CXX_FLAGS_RELEASE= -nologo -MD -Brepro" "-DCMAKE_ASM_FLAGS= -nologo -MD -Brepro" "-DCMAKE_ASM_FLAGS_RELEASE= -nologo -MD -Brepro" "-DCMAKE_BUILD_TYPE=Release"
  -- Selecting Windows SDK version 10.0.19041.0 to target Windows 10.0.19042.
  -- The C compiler identification is MSVC 19.29.30133.0
  -- Detecting C compiler ABI info
  -- Detecting C compiler ABI info - done
  -- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.29.30133/bin/Hostx64/x64/cl.exe - skipped
  -- Detecting C compile features
  -- Detecting C compile features - done
  -- libavif: Enabling warnings for MSVC
  -- Checking for module 'libyuv'
  --
  -- libavif: libyuv not found; libyuv-based fast paths disabled.
  -- libavif: Codec enabled: aom (encode/decode)
  -- Checking for module 'aom'
  --
  -- Configuring incomplete, errors occurred!
  See also "libavif-rs/target/debug/build/libavif-sys-6d57f1058e9a9e31/out/build/CMakeFiles/CMakeOutput.log".

  --- stderr
  building libavif
  pc=""""; bp=""""
  CMake Error at C:/Users/andylizi/scoop/apps/cmake/3.21.3/share/cmake-3.21/Modules/FindPackageHandleStandardArgs.cmake:230 (message):
    Could NOT find aom (missing: AOM_LIBRARY AOM_LIBRARIES) (found version "")
  Call Stack (most recent call first):
    C:/Users/andylizi/scoop/apps/cmake/3.21.3/share/cmake-3.21/Modules/FindPackageHandleStandardArgs.cmake:594 (_FPHSA_FAILURE_MESSAGE)
    cmake/Modules/Findaom.cmake:40 (find_package_handle_standard_args)
    CMakeLists.txt:398 (find_package)


  thread 'main' panicked at '
  command did not execute successfully, got: exit code: 1

I'm not quite familiar with CMake, this PR is the cleanest solution that works after several hours of fiddling around.

+17 -52

0 comment

3 changed files

pr created time in 2 months

create barnchandylizi/libavif-rs

branch : fix-msvc

created branch time in 2 months

fork andylizi/libavif-rs

Rust AVIF Decoder and Encoder crate

fork in 2 months

issue commentXIU2/UserScript

[知乎增强] 屏蔽首页活动

光把 div 给隐藏了不会改变 appbar 的颜色啊

zhihu

andylizi

comment created time in 2 months

issue openedXIU2/UserScript

[知乎增强] 屏蔽首页活动

zhihu

目前我的解决方案是

function check() {
    const topstory = document.querySelector(".Topstory");
    if (!topstory || !topstory.children.length) return false;
    if (topstory.children[2]?.classList.contains("Topstory-container")) {
        const flexBox = topstory.children[1];
        const svg = flexBox?.querySelectorAll("svg");
        if (svg?.length === 1) {
            // SVGElement doesn't have a click() function
            const event = new MouseEvent("click", { view: window, bubbles: true })
            svg[0].dispatchEvent(event);
        }
    }
    return true;
}

const style = document.createElement("style");
style.appendChild(document.createTextNode(".Topstory > div:not(.Topstory-container) { display: none; } .AppHeader, .AppHeader * { transition: none !important; }"));
document.head.appendChild(style);

const timer = setInterval(() => {
    if (check()) {
        // Allow transition after animation has completed
        setTimeout(() => style.remove(), 500);
        clearInterval(timer);
    }
}, 1);
document.addEventListener("load", () => clearInterval(timer));

运行于 document-start 以避免 banner 一闪而过。header 的颜色还是会闪一下这个挺烦的,但一时找不到简单的解决方法……

created time in 2 months

push eventandylizi/libimagequant

andylizi

commit sha 0c3dbb9c852e0ae9101eb3c2f5a45a14a3b2cdcd

Fix custom allocator not being used in #60

view details

andylizi

commit sha 4863c905095f60aba22b1fe43a454116be1cdf28

Allow specifying custom allocator in Rust

view details

Kornel

commit sha 4f42cdab850a0be569915779fd78ed79038d9c1b

Merge pull request #62 from andylizi/rust-custom-alloc

view details

Kornel

commit sha 0214b7be11ccc19844435ec33e9a85f8e6d3d5c8

Merge pull request #61 from andylizi/fix-alloc

view details

push time in 2 months

delete branch andylizi/libimagequant

delete branch : fix-alloc

delete time in 2 months

delete branch andylizi/libimagequant

delete branch : rust-custom-alloc

delete time in 2 months

create barnchandylizi/libimagequant

branch : rust-custom-alloc

created branch time in 2 months

create barnchandylizi/libimagequant

branch : fix-alloc

created branch time in 2 months

fork andylizi/libimagequant

Palette quantization library that powers pngquant and other PNG optimizers

https://pngquant.org/lib

fork in 2 months

issue openedrust-shell-script/rust_cmd_lib

Stderr is unconditionally redirected

Description

Contents of stderr will always be sliently redirected and consumed.

Reproduction

cargo build outputs are printed to stderr, so we can use it as a demo:

run_cmd!(cargo build).unwrap();

Run it and nothing happens.

The Cause

In bd7837f5f1598ada36826391ae10db93215e83be, an attempt to fix logging for stderr:

https://github.com/rust-shell-script/rust_cmd_lib/blob/f125db860a67050f6f0c4d2c4b160ef32f8f0af2/src/process.rs#L464-L467

created time in 2 months

more