HNHacker News
TopNewBestAskShowJobs

kjuulh

512 karma · joined March 22, 2021

submissionscomments
kjuulh··on Dotfiles: Unofficial Guide to Dotfiles on GitHub
This site seems much more like an some of the awesome-<insert tech here> repositories on github than a guide. Although it does give some extra information on the packages.

To not make it took negative. I personally use Chezmoi, which I've been super happy with. The ability to maintain files in a central repository and then pull them into the file system on an update is quite nice.

You can handle merge conflicts and whatnot between your local copy and the upstream dot files. You can opt your files into using go templates in your files which is useful when I need to maintain differences in configs between mac and linux, or in general for just storing secrets out of your dotfiles.

There are some small annoyances but overall it is the only dotfile manager, I've managed to stick with.

kjuulh··on 900 Sites, 125M accounts, 1 Vulnerability
The security rules where I fell off my love with Firebase, not that there is anything wrong with the security, but until the point of having to write those security rules, the product experience felt magical, so easy to use, only one app to maintain pretty much.

But with the firebase security rules, I now pretty much have half of a server implemented to get the rules working properly, especially for more complex lookups. And for those rules, the tooling simply wasn't as great as using typescript or the likes.

I haven't used firebase in years tho, so I don't know if it has gotten easier.

kjuulh··on GitHub Fuzzy Clone
This is simply a tool I built because I was tired of using the various git uis to navigate my, and others repos.

This way I can just fuzzy search repos, and it will switch between them.

kjuulh··on New IBM LinuxONE 4 Express – Rack-mounted pre-configured Linux mainframe
I've previously worked on mainframes (building business software, and worked quite low level with crypto libraries on them), and now do some of the same but for "cloud" based software instead.

Mainframes are such a weird subject to me, on one hand, the results we got out of the mainframes were pretty amazing, but the experience was painful, absolutely, painful. The tooling is some of the worst you've ever seen, official tools feel like something people dreamed up in winforms. I worked mostly with PL/1 which was a great language, stuck in the 80s but great nonetheless, I actually prefer it to C.

What killed it for me was the restrictions, you had to either dynamically or statically link programs, but do it in the IBM flavor and build system. Which made it extremely cumbersome to do, so files were 20k SoC with a single entry (main) and function calls, because creating files was a pain. Line limits of 72 characters, we even had to send in our programs to get syntax checks because the IDEs weren't capable enough (this was in 2018), now I could whip up something to emulate it in docker and neovim, but the people that taught me had no idea there was something better out there and neither did I. We had to release once a week on saturday mornings because the execution model used had to have downtime during the deployment.

Mainframes are cursed because of the lack of tooling, and the restrictions. I think Mainframes and the execution mode it uses could be useful in a bunch of other places, but IBMs business model just continuously tightness the screws and scared people away. It doesn't have wide spread appeal either, it is "Business machines" after all.

It should be said that I worked in IBMs version of Serverless (not what it was called but it was pretty much what it was), mainframes support Linux, Java, etc, etc. But you give up a lot of benefits and performance if you move off, of the native way of doing things.

I'd also argue that with todays tooling and hardware you can get comparable performance to a mainframe, the only reason that mainframes are as performant, and was so dominant, is because of the restrictions it places on the developer. You have to write low level C, PL/1 or Cobol, so often by proxy your software is just fast. Kind of like Rust or C++ is nearly always quite performant out of the box. Most business software just don't need that level of latency control and performance today.

kjuulh··on My 2024 AI Predictions
While yes, an engineer could build a slack clone. Probably initially quite poor and lacking features. If you're not in the business of building chat applications, having to actually maintain such an application becomes a burden. While you may save 500k for a few years. A few years down the road, when said engineer leaves, you will end up having to pay the cost either to exit said app, or spend a lot more engineering effort on it.

There definitely is room for such applications, but a chat application probably won't set the business apart.

kjuulh··on Happy New Year HN!
Happy new years everyone.

I started regularly browsing Hacker News around the start of corona when I graduated from university as well. It has been an amazing few years, and I look forward to the coming year.

A lot has changed these last years, but somehow Hacker News always remains a solid place to procrastinate and/or learn new things.

When I tell other developers that if they want to keep up to date with tech, I tell them about Hacker News, it always goes like this: Come for the articles stay for the community. Thanks to everyone making Hacker News both an interesting and welcoming space to hang out!

kjuulh··on Email addresses are not good 'permanent' identifiers for accounts
The only good identifier is a private one. Email, usernames, etc. They should all be changeable. You don't know what laws come unto function, which events occur, does a person change gender and now need a new social security number, did a person use a business email account for all their private stuff. Usernames change as we fancy, and the whole uniqueness around usernames are a little bit silly as well.

A private id is probably just the best, whether it is a UUID, or another type of sufficiently collision resistant id, kept away from the user for the most part.

Let said person have an email or username, and let other people tag or friend them, but only use said username/email when doing the initial connection. Base said connections off of, the private id

kjuulh··on Easy to use OpenID Connect client and server library written for Go
What about oidc and authn+z on their own? ;)

Failure galore

kjuulh··on Easy to use OpenID Connect client and server library written for Go
Fully agree if you need the session. Then yeah some kind of delegation/abstraction is required. Especially for social/3rd party login.

The missed I've seen is simple that oidc was used on multiple levels to facilitate a login flow and the sessions discarded afterwards

kjuulh··on Easy to use OpenID Connect client and server library written for Go
That is probably also the best path if you choose to use oidc as a login / identity solution etc. They do give a lot of stuff out of the box, as well as making it quite easy to integrate with. But at quite the price =D

From my point of view the dangers are implementing parts of this protocol yourself (i.e. becoming one of the parts in the login chain), it requires a surprising amount work to mature, which is why relying on Auth0 which already has been through that is quite nice.

kjuulh··on Easy to use OpenID Connect client and server library written for Go
It indeed isn't that hard to get something up and running with oidc or oauth.

However, what becomes problematic is handling inherent complexity of whatever the provider you use is. If the OIDC flow is only intended for you or in-house at a company then it is less problematic. But when used by all sorts of people and devices, it will break in all sorts of problematic ways.

But that isn't to say that you shouldn't use the technology it is fantastic at what it does. I.e. handle social identities in the case of oidc, and authorization in the case of oauth

kjuulh··on Easy to use OpenID Connect client and server library written for Go
It really is, in some of these flows the single sign on nature of oidc isn't even used, or hacked away. And only used for login. Which is absolutely wild.
kjuulh··on Easy to use OpenID Connect client and server library written for Go
Yep, this is why I say that oidc is vastly misused. There are much better options out there for implementing good solid, login, session flows. Using oidc as the only tool in the toolbox is a recipe for disaster.
kjuulh··on Easy to use OpenID Connect client and server library written for Go
Yep for normal apps it is rare. The debugging sessions I've been in trying to untangle some of these flows gives me the shivers. Oops someone had a huawei with this specific default browser, that doesn't handle url paths?!?, some android webviews versions not handling redirects properly, android apps not being able to handle redirects in a webview if the app is not active.

These are very app specific, but that is just the amount of complexity that is opened up for in some of these flows. Hopefully webauthn / passkey can help reduce some of these. But I doubt it.

kjuulh··on Easy to use OpenID Connect client and server library written for Go
MitID (national provider login) in Denmark, is about 2 layers of oidc in of itself (normal oidc and an oauth2). Plus whatever the consumers already have, which is often 1 or 2 as well. They're often used as a layer of abstraction which is a gross misuse of the technology.

As I mentioned previously using it for social logins by itself, is fine in most situations as they're quite mature. And IMO the best and probably intended use case of the technology and there it works quite well.

kjuulh··on Easy to use OpenID Connect client and server library written for Go
At the most basic yes, but the protocol doesn't describe what the login part is and how that works. Often it implements session using cookies, which given the state you were in previously. Maybe you wanted to embed the login page on your own site (iframe or webview), now the cookies are flagged as third party cookies and blocked in a variety of context.

Especially in an app context it becomes a minefield of half baked webview implementations, browser specific quirks, and limitations on how to call back to the host app which initiated the flow.

Other questions are how do we handle return urls, i.e. return to where we started the login flow from? there isn't a good answer in oidc, unless you use some of the more extreme flows. It becomes tricky to implement without opening yourself to open redirect attacks, which kind of voids the benefits of oidc (that you don't have to handle the complexity of the authentication).

Also there are endless variations of the oidc flow, the most common being code flow, which is pretty much what you describe. But it gets increasingly complex as you have to handle native app login (PKCE pronounced pixie). Using these flows you end up becoming as much an expert in the technology as you would've been just implementing authentication and identity yourself.

kjuulh··on Easy to use OpenID Connect client and server library written for Go
Having built and worked with a variety of oidc implementations. It is an incredibly misused technology, while it initially can be easy to integrate into your app. It increases the complexity of the app to a surprising degree. Now suddenly your little webapp have to handle how various devices handle redirects to external sites, receives callbacks. And all the weird ways oidc implementations uses cookies, handles return urls, logouts, profiles etc.

I am not so sure the model of using a central oidc solution as the primary login to your app is such a good idea. There are so many failure points in just getting to and fro the oidc portal that can break in all sorts of ways, with no good way of debugging, leaving users stranded in the middle of redirects. Especially as logs are split between 3 parties, the browser, the client (server) and the oidc server.

I ripped out our oidc primary login and implemented comparable features in my current company (this is probably not for everyone though), it has vastly reduced support tickets, and generally been a faster and more intuitive solution, but more expensive, and requires more domain knowledge. Still I'd rather have that than having a team spend years handling support tickets for endless social login issues.

If you choose to use oidc, please, please only use it for social logins, don't do oidc within oidc within oidc (I am not exaggerating, I've seen 5 levels of nested oidc and oauth2 flows). Like a lot of these solutions such as Zitadel, Auth0, etc. It becomes a nightmare to support and mature.

kjuulh··on The $55M saga of a Netflix series nobody will ever see
I rewatch it once a year or so. I haven't caved yet and read the books. But I still hope for a 3rd season even though it is probably never going to happen
kjuulh··on Committing to Rust for Kernel Code
To focus on the C/C++ comparison. Rust very much leans towards C++ side of things if you go the std library route. It does bake in some abstraction which would not be appropriate for low level systems development such as the Linux Kernel, which is also not what they're going for.

Rust gives you the option of opting out of that `#[no_std]`, which removes some basic tools, such as allocations, panics etc (I haven't used it much, so this may not be fully precise). As such with no_std you do move closer to what you'd consider C development.

That said rust will still have its restrictions, so some of the wild things you can do in C, isn't possible in rust, at least not without really violating the inner workings of it.

But with unsafe you can technically do most things on the level of C, without the overhead, that C++ would provide, via. its abstractions.

I'd expect the Linux Kernel to move in the direction of developing or using their own libraries and data structures, and that becoming its own bespoke part of their use of the rust language. Such that rust only really provides its safety guarantees and ergonomics. Compile times are also quite quick with no_std, as rust only really struggle with compile times, if you have lots of dependencies.

Circling back:

Rust is more like C++ with std library enabled (default) and C with `no_std`

kjuulh··on Streamlining CI/CD Pipelines with Code
Disclaimer: I build and maintain'ish the rust sdk of dagger.

If you've ever worked with a sufficiently large pipeline, or set of pipelines, you face the fact that stuff breaks and you have to spam commits to try to get the weird yaml dsl to do the thing you want. Not that dagger is that much different in that context. But you can actually test your pipeline locally, shortening the feedback loop from 10 minutes to 10 seconds.

We've even gone as far as integrating it into our developer tools, with caching we still have nice to use clis and apps. We just don't have to think too much about deployment as we're heavily invested in docker already.

From a platform engineering perspective. We'd like actual guarantees about our pipelines when we roll them out to thousands of repositories. With dagger, we can do traditional unit tests on parts of our pipeline, and full integration test (or whatever you'd like to call them) on whole example pipelines.

This is something that would suck to do, with github actions, bash and docker by itself. And as such isn't done often, and when done brittle. Been there done that.

Another example is doing programmatic builds in a more comfortable language than Docker or bash. Lets say I'd like to solve rusts build/caching issues. With dagger, or other programmatic build tools. I can now mix docker commands, with computation to solve my problem. I can for example rely on golangs hashing libraries etc. rather than installing a bunch of packages, I don't want to end up in my final images anyway.

Dagger shouldn't be used by developers directly. IMO the same as traditional pipelines, if the developers have to touch these files, then something is wrong. Instead it should be built and maintained by a platform team, with contributions by developers whom need specific features (which dagger allows, because you can just use a regular package manager).

This may sound a little fanboyish, but we've just felt the need for less friction in traditional CI systems on actually having modern software engineering tools and methodologies available. Something which Dagger enables for us.

kjuulh··on FFmpeg is getting multithreaded transcoding pipelines
Very nice.

Hopefully this will make my small transcoding needs faster for plex (as I don't have hardware transcoding support on my graphics card) =D

kjuulh··on Helix 23.10 Highlights
Yeah I've considered it. For now ranger in a pop up term works nice enough for me. Ranger is a bit slow so I should move to lf or some other alternative.
kjuulh··on Helix 23.10 Highlights
I mainly use ranger, or some conveniece scripts I've built around ripgrep, ripgrep replace and fd. When i find the file i want I either open it directly to do a small chance or use the fuzzy search in my long running session to open the file.

The only thing I haven't nailed yet is creating files in deeply nested directories.

In general most of the things I used in nvim have now moved back to the terminal which has its pros and cons.

kjuulh··on Helix 23.10 Highlights
I've been using Helix full time, professionally as a Rust/Golang engineer and it has been great. It took some getting used to not having a file explorer. But now I think I am better for it.

These looks to be fantastic updates, I especially dig the diagnostics (if that is part of the release as well).

kjuulh··on Dave Cutler on Windows [video]
I recently watched a video (2 years old video) of a guy documenting that he had participated in make a wish, and that the kid had left this world, etc. very sad video.

My recommendations have been filled with nothing but cancer stories, people on their deathbed, all kinds of ailments, etc. From that single video, which was not at all related to his regular videos. I haven't watched any of them, and they just keep pouring in.

kjuulh··on We migrated to SQL. Our biggest learning? Don't use Prisma
I've been burned by EF more times than I'd like, the most recent (it has been a few years), was the change in default to single queries, instead of split queries. Which absolutely destroyed our performance, until we figured we should turn single query off.

EF Core expression trees are nice, however, the change tracking behind the scenes are an absolute menace. I've gotten errors more times than I'd like, because EF Core had loaded a key in its store, and another query got the same key, resulting in an Exception because both touched the same record in the change tracker. Even if it was two separate requests.

I've become a purist sort of, using sqlc for golang, dapper for c# and sqlx for rust.

ORMs are 'fine' for simple crud apps, but once you go a bit deep in the sql, it becomes impossible to reason about. Telling an engineer that they can just run `explain analyze` on their query, and them having no idea how to actually reproduce their sql is not great.

This is also just my opinion, I've been in the same place, I used to love EF, but now I dread having to debug that stuff =D

Last time it was sending a non pointer to gorm in golang, panicing the application :,)

kjuulh··on Learning async Rust with entirely too many web servers
Loved the article =D

These runtimes seems heavily scewed towards being used by IO bound application.

While rayon can help with CPU bound tasks. I wonder if these mix at all, it may not be desired at all. But I think fairly interesting nonetheless.

I know that tokio doesn't like being blocked by anything. You will get a hard error, if you do a blocking operation when not being spawn_blocking via. tokio. Rayon, probably doesn't trigger this warning, as it is technically not doing any WouldBlock operations.

you would probably do a spawn_blocking for rayon as you would for IO bound operations.

Anyways, mixing CPU and IO bound operations on the same CPU/machine is probably the same as mixing oil and water, and would probably be a pain in the neck to maintain and get good utilization.

It is actually smack bang in the middle of the tokio docs.rs page: https://docs.rs/tokio/latest/tokio/index.html#cpu-bound-task...

It is also a bit interesting how these paradigms compare with Golang green threads, which also seems to yield without a lot of syntactic sugar. The same for elixir. These languages also seem to solve the IO bound problem quite well using this paradigm (you obviously doesn't get as much control as you do for rust), but powerful nonetheless.

kjuulh··on Pure Bash Bible (2018)
This seems to be a general problem for what I normally refer to orchestration software. I.e. calling a lot of external dependencies, io and in general very slim on business logic. You've simply got to deal with too many dependencies, which may or may not have different versions, flavors and whatnot. It becomes impossible to test every permutation, so instead you rely on brute force to weed out bugs, simply fix the things once a bug report comes in.

It helps having good integration/e2e tests, but they only go so far, customers/developers customize and mess up their systems all the time.

Which is why I've choose binaries instead, they are mostly self-contained (except for various things about gnu and musl), and in general just rely on a higher level of built in functionality (because of the statically linked nature).

kjuulh··on Pure Bash Bible (2018)
It is probably the closest we're gonna get to a universal language, until we get wasm deeper in the os' or something. It is kind of the javascript of operating systems, which is both good and bad.

It is also quite bad that we've got to vet bash installation scripts before running them, as you may be required to run them as root. IMO, this isn't a huge issue for me personally, as we already are doing this for a lot of stuff, homebrew, linux package managers etc. We generally run a lot of untrusted code on our machines.

> Dude. It's really not that hard a language. Is amateur shell script ugly? verbose? redundant? bug-riddled? Absolutely. But it works despite that, and has fewer dependencies than other solutions, so in practice, it's fine.

Bash, zsh whatever, depend heavily on what is installed on the os, and what type of flavor of base tools are provided. Need base64 in a certain way, don't forget that line wrapping is different between bsd and linux. (a pain in the butt to test too).

Need to download something, better hope you're not running on a busybox or something with curl, or only have wget installed, now you gotta build support for both.

A lot of scripts, especially installation scripts are a product of blood, sweat and tears, mostly tears tho. Each line can be interpreted in a multitude of ways, under different conditions and versions of bash, os and so on, and the script will have to be robust enough for that.

> That said, use whatever you know. Wanna use Python? Use it. Wanna use a compiled language? Do it. Just make something. The biggest difficulties you will have in producing a product will not be the language.

It may not be the biggest difficulty, but it certainly is something we should consider. We've chosen our values, and shell scripts doesn't align with those, I'd rather not fight my environment every step of our development journey.

I am not building a new product, I am maintaining and expanding a product, as such I am heavily biased towards getting as few support tickets as humanly possible, while building an awesome experience. We are also mostly software engineers, and not sysadmins, as such we prefer compiled binaries. We then choose to distribute them through curated and secure channels.

We get the benefit that we can actually test parts of our tools in isolation, benchmark them if necessary, and version our stuff in a nice concise way. If I want to run our onboarding installation, I can simply fetch our current list of binaries expected for developers and run it, because I know they don't depend on external tools from the environment. This is a lot of work, but in a large development organization, this means a lot.

> You don't have to avoid shell just because people on HN (who've probably never read the man page) keep repeating that it's terrible. With Shellcheck, almost anyone can write good scripts now. If you can write a concise, bug-free script that works, then do it.

Just to reiterate, I am not digging on shell scripts, and I don't necessarily think they're terrible, they have their time and place, and for us, it is customization and extensibility. We setup our tools such that they work awesome on the cli, and can be composed however, developers like, but that is up to them, and how they want to form their workflows.

We've seen that developers really struggle to maintain what was previously built (myself included), so now we've got a more homogeneous tech stack, which comes with its own trade offs, but whose values align more with our engineering culture.

kjuulh··on Pure Bash Bible (2018)
I like bash, zsh and other shell languages as well. However, unless you're really experienced, they shouldn't be the product you ship, whether that is internally or externally to you or your company.

Shell languages is the final layer of configuration and customization you apply to the setup, it should almost never be the foundation of what you build.

Especially for a company, unless you've got really, really skilled engineers on the scripts, it becomes a complete mess. And even then it can become almost impossible to grok.

The way we develop infrastructure automation, ci, and developer tools is binaries first and foremost, then plugins for our infrastructure (also binaries, or libraries) and then some zsh on top to provide a nice developer experience.

But we've had to heavily scale back our use of zsh, it simply turned into a ball of mud, like all software that isn't maintainable, upgrade-able, or simple enough to parse.

This isn't a dig on zsh, bash etc, we've just found out that we can't maintain zsh as a product to supply to our engineers, and as such have to correct.

← PreviousPage 4 of 6Next →