HNHacker News
TopNewBestAskShowJobs

qweqwe14

366 karma · joined July 5, 2023

submissionscomments
qweqwe14··on Fabrice Bellard Releases MicroQuickJS
This would never happen because there's zero incentive to do this.

Browsers are complex because they solve a complex problem: running arbitrary applications in a secure manner across a wide range of platforms. So any "simple" browser you can come up with just won't work in the real world (yes, that means being compatible with websites that normal people use).

qweqwe14··on Show HN: I built a system for active note-taking in regular meetings like 1-1s
There is a way: you have to make something that's better in a meaningful way, so that companies' management would want to SWITCH to it. And your new shiny thing also has to be compatible with all of the integrations, the ecosystem etc. that the current thing has.

I'm not even mentioning trust issues, when sensitive data is involved.

Doing anything less and hoping that companies would use your toy project is just wishful thinking. Sorry to be that guy, but please get real.

qweqwe14··on Linux Kernel Explorer
How is this different from https://elixir.bootlin.com/linux
qweqwe14··on Zlib-rs is faster than C
> Add a borrow checker to C++ and put rust to bed once and for all

Ah yes, C++ is just one safety feature away from replacing Rust, surely, any moment now. The bizzare world C++ fanboys live in.

Every single person that had been writing C++ for a while and isn't a victim of Stockholm syndrome would be happy when C++ is put to bed once and for all. It's a horrible language only genuinely enjoyed by bad programmers.

qweqwe14··on Zlib-rs is faster than C
The fact that it's faster than the C implementation that surely had more time and effort put into it doesn't look good for C here.
qweqwe14··on Zlib-rs is faster than C
"Barely" or not is completely irrelevant. The fact is that it's measurably faster than the C implementation with the more common parameters. So the point that you're trying to make isn't clear tbh.

Also I'm pretty sure that the C implementation had more man hours put into it than the Rust one.

qweqwe14··on Show HN: I built a memory-safe web server in Rust
What about Cloudflare's pengora?

Edit: or https://github.com/memorysafety/river

Edit 2: or https://github.com/sozu-proxy/sozu

qweqwe14··on Show HN: I built a memory-safe web server in Rust
Have you heard of axum[1] or actix-web[2]? What does this do that existing Rust web servers don't?

I think the "web server" ecosystem in Rust is pretty mature by now, so you should probably state in what way your project is novel on the website.

Edit: OK, I realized that this is supposed to be an nginx/caddy replacement, so a complete, configurable web server/proxy. Maybe check out https://github.com/memorysafety/river or https://github.com/sozu-proxy/sozu

[1] https://docs.rs/axum

[2] https://docs.rs/actix-web

qweqwe14··on Zelensky leaves White House after angry meeting
Are there actual, living people thinking that donating to Ukraine will influence anything? These donations might as well be a margin of error compared to government funding, aid packages and what not.

The Ukraine is simply too small of a country to actually win a war against Russia, all that these aid packages are doing is prolonging the war that Ukraine cannot win.

It's like saying "if only Germany had <insert Wunderwaffe> it would've won WWII". At some point they were going to run out of men anyway (they did). Sort of like how Ukraine will eventually run out of men if they continue.

qweqwe14··on Okay, I Like WezTerm
This, unironically, is entirely correct. Some people spend way too much time configuring stuff that doesn't matter.

"If you've never spent hours ricing your OS, you have no heart. If you still do, you have no brain."

qweqwe14··on Userland rootkits are lame (2022)
There's also TracerPid field in /proc/PID/status, which is non-zero when a process is being ptraced

> Sus tests for common indicators of compromise

There's a lot of stuff that Linux malware tends to do that almost no legitimate program does, this can be incorporated into the tool. Just off the top of my head, some botnet clients delete their executable after launch, in addition to being statically linked, which is an almost 100% guarantee that it's malware.

Check for deleted executables: ls -l /proc/*/task/*/exe 2>/dev/null | grep ' \(deleted\)$'

(not really reliable) check for statically linked running programs: wc -c $(grep -L libc /proc/*/task/*/maps 2>dev/null) 2>/dev/null | grep -v '^0 '

Although a malicious process can just mmap libc for giggles, and also theoretically libc can be named in a way that doesn't contain "libc". A more reliable method is parsing the ELF header in /proc/PID/exe to determine if there's an ELF interpreter defined.

You can also check for processes that trace themselves (TracerPid in status == process id), this is a common anti-debug tactic.

You can also hide the process by mounting a tmpfs on top of it's proc directory, tools like ps ignore empty proc directories due to the possibility that the process has terminated but it's proc directory is still around. This is obviously easily detectable by checking /proc/mounts or just listing empty directories with numeric names in /proc

Another heuristic can be checking /proc/PID/cmdline for two NUL bytes in a row, some malware tries to change it's process name and arguments by modifying the argv array, however they are unable to change the size of cmdline, hence having multiple NUL bytes is a viable detection mechanism. Legitimate programs do this too, but it's rather uncommon.

You can obviously combine these heuristics to make a decision whether the process is malicious, as by themselves they aren't very reliable

qweqwe14··on Userland rootkits are lame (2022)
The downside with kernel-level rootkits is you essentially have to compile it for many different kernel versions if you want it to work everywhere. I think I've read about some malware that literally contacted a server, sent the kernel version, and the server would compile the rootkit on demand.
qweqwe14··on Userland rootkits are lame (2022)
In case you're interested, it's usually done via ptrace by attaching to every process and modifiying the syscall arguments every time it makes one. There are performance issues associated with that (ptracing is rather expensive) and IMO it's more complex than LD_PRELOAD. Furthermore, ptrace may be disabled altogether on some installations, even for root. See yama_ptrace_scope

I wouldn't say it's a practical approach. Works for a cool demo, sure, but as an adversary I would be hesitant to use this widely.

qweqwe14··on Userland rootkits are lame (2022)
I'm of the opinion that all systems should at least have a static busybox, it's useful for more than just rootkit hunting, for example if you somehow break your installation because of glibc shenanigans (rare but happens)
qweqwe14··on Show HN: From dotenv to dotenvx – better config management
lmao so true
qweqwe14··on Show HN: From dotenv to dotenvx – better config management
Well, if there's an arbitrary file read, shouldn't the attacker be able to just read /proc/PID/environ anyway? It behaves like a regular file in that regard, unlike /proc/PID/mem, which requires seek operations to read data.
qweqwe14··on Show HN: From dotenv to dotenvx – better config management
Sorry but it is largely all-or-nothing in this case, if someone has access to the user the app runs as, you are screwed. It doesn't matter whether you use env vars or files.

I'm assuming the parent intended to say "if someone gained access to your user you are pwned anyways", which is true, unless you actually go to the effort of storing the secrets securely using OS-provided mechanisms. Env vars are not that.

> which isn't feasible in the real world

Well of course it isn't, how would you justify those sweet cybersecurity experts' paychecks otherwise? Not saying cybersecurity isn't important, but there's way too much snake oil in the industry nowadays (always has been?).

qweqwe14··on Show HN: From dotenv to dotenvx – better config management
There isn't a right answer. It's just that people don't understand that one doesn't provide any meaningful benefit over the other (in the context of storing secrets), but the security "experts" are always eager to claim "X is insecure, do Y instead, it's best practice btw"

Unless I'm missing something, there are three scenarios where this comes up:

1. You are using a .env file to store secrets that will then be passed to the program through env vars. There's literally no difference in this case, you end up storing secrets in the FS anyway.

2. You are manually setting an env var with the secret when launching a program, e.g. SECRET=foo ./bar. The secret can still be easily obtained by inspecting /proc/PID/environ. It can't be read by other users, but so are the files in your user's directory (.env/secrets.json/whatever)

3. A program obtains the secret via some other means (network, user input, etc). You can still access /proc/PID/mem and extract the secret from process memory.

So I'm assuming that what people really want is passing the secret to a program and having that secret not be readable by anything other than that program. The proper way to do this is using some OS-provided mechanism, like memfd_secret in Linux. The program can ask for the secret on startup via stdin, then store that secret in the special memory region designed for storing secrets.

qweqwe14··on Dan's the man: Why Chinese women are looking to ChatGPT for love
> Preferring screens over real humans is objectively not good.

Wow, this is just blatant misinformation! Wait till Snopes debunks this obviously false claim. I trust the "science"!

Imagine actually interacting with real human beings and having a real community around you in 2024. I'm so glad that we as humanity figured out that you don't really need this in your life. Who knew!

qweqwe14··on Let rand = main as usize (2022)
There's also the good old trick of measuring duration between two instants and using that as a (crude) randomness source.

Also on Linux there's the AT_RANDOM entry in the aux vector, which provides any program with 16 random bytes.

qweqwe14··on Garbage Collectors Are Scary
AFAIK you should only need 16-byte stack alignment if you use vector instructions, so Linux/x86-64 doesn't mandate it in all cases
qweqwe14··on How to Use the Foreign Function API in Java 22 to Call C Libraries
The answer is basically you don't. It's impossible to make a sane, stable FFI for a language unless you put it behind a C ABI, which is relatively basic, but this is exactly why it's most suitable for FFI: implementing support for calling C functions is way more trivial than figuring out how to call the latest C++/Rust/etc monstrosity.
qweqwe14··on So you want to scrape like the big boys (2021)
It's not clear if it's a joke specifically because of the addition of "ill-adjusted"
qweqwe14··on So you want to scrape like the big boys (2021)
> Those companies employ ill-adjusted individuals that do nothing else than look for the most recent techniques to fingerprint browsers [...] When normal people are out drinking beers in the pub on Friday night, these individuals invent increasingly bizarre ways to fingerprint browsers and detect bots ;)

What's the deal with "ill-adjusted" and "normal people"? I'm gonna say it right now, the reason why these individuals do this is because it's way more interesting and fun than building some bullshit React website for some boring business for the 20th time (this is just an example, not attacking React here, no need to freak out)

It's fun because you get to solve an actual real-world challenge and find new ways to do something. Same with things like developing exploits. Those who do this are not "ill-adjusted", they are in fact normal people that do what they are passionate about.

The whole mentality of "anyone who does something I don't like is ill-adjusted" is just absolutely insane.

qweqwe14··on Leaving Rust gamedev after 3 years
In other words, "shipping a product" is incompatible with decent code.

This is why virtually all proprietary codebases aimed at "shipping a product" are a clusterfuck.

qweqwe14··on Leaving Rust gamedev after 3 years
You do need memory safety for multiplayer games, though. Either that or you should use a GC language, which frankly is good enough for most indie games.
qweqwe14··on Leaving Rust gamedev after 3 years
Some software (other than games) can actually be fully finished, provided that it's scope is narrow enough.

It's really a question of differentiating between "finished" and "abandoned". Finished usually means that no new features are added, the only changes are bugfixes or minor improvements. Abandoned means no changes at all.

> And at that point any maintainability is absolutely irrelevant

This goes in line with my point though. The fact that Rust encourages writing maintainable code makes it unsuitable for gamedev, where speed of development and flexibility (even where it's bad) trumps everything else. That's why you need to have a scriptable layer on top of the core engine anyway.

qweqwe14··on Leaving Rust gamedev after 3 years
By "care about programming" I basically mean writing maintainable code.

By "inadequate code" I mean code that does what the author wants at this point in time, but is completely unmaintainable and just bad. Sloppy practices, etc

qweqwe14··on Leaving Rust gamedev after 3 years
This is a decent article, but although the points themselves are valid, I think there's a core "issue" with (indie) gamedev itself.

The vibe that I'm getting is that it's filled with people that don't particularly care about programming, they just want to get stuff done(TM), this is also highlighted by the fact that they are willing to write completely inadequate code just to see things working. Rust is not that, and that's a good thing.

More generally, I'd say that in gamedev anything goes, as long as it's fun and isn't too buggy. Rust is not, and never will be able to accomodate that mindset, which again, is a good thing if you think for 2 seconds and consider what Rust is actually aimed at, which is safe systems programming.

You can have the core engine written in Rust and have a scriptable language on top of it, there aren't any major pain points in this regard. The scriptable language will be able to provide all of this hot-reloading-anything-goes-yes-sir bullshit that we all know and love.

tl;dr: Use the right tool for the job. A language designed for safe systems programming can't do non-safe non-systems programming very well. Who knew!

Virtually all of the points outlined in the article stem from the above.

qweqwe14··on A BSD person tries Alpine Linux
Yeah, it's an unfortunate name collision. From Chimera Linux FAQ[1]:

The system also has no relation to ChimeraOS, besides the unfortunate name similarity. ChimeraOS used to be called GamerOS and renamed itself to ChimeraOS later; however, at this point Chimera Linux was already in public development with its name in place.

[1] https://chimera-linux.org/docs/faq#what-about-chimeraos

← PreviousPage 3 of 6Next →