I’ve been using a reverse proxy on a Hetzner VPS pointing at my home plex server for years without issue. Maybe this only applies to people running the actual Plex software on a Hetzner VPS?
Kogasa
- 0 Posts
- 167 Comments
Kogasa@programming.devto
Programmer Humor@programming.dev•Object oriented programming in Python be like:
1·6 months agoWhat I described isn’t necessarily functional. This is just a principle for ensuring objects represent clear and well-defined contracts. The idea is that to mutate something, you should own it; that means interfaces / public APIs, which can be called externally, should take immutable arguments. You can still mutate instance members internally because those are owned by the instance. If mutation is really necessary between two objects then it should be coordinated by an object owning them both.
Kogasa@programming.devto
Programmer Humor@programming.dev•Object oriented programming in Python be like:
2·6 months agoThat’s a footgun sure but at least you can avoid it once you’re aware of the problem.
I never write function signatures with mutable interfaces. It’s always IEnumerable, IReadOnlyCollection, or IReadOnlyList; otherwise, use a concrete type. The latter is typical for private/protected methods that are called with instance members of a concrete type rather than public interfaces. If you want to mutate an object, you should own it. Public methods are invoked with data not owned by the instance.
For example, a lot of extension methods in LINQ have a signature IEnumerable<T> --> IEnumerable<T>, and internally the first thing they do is call .ToList(). The interface makes minimal assumptions about the input data, then puts it into a concrete type you can manipulate efficiently. You can similarly define a method for IReadOnlyList and explicitly make it mutable via .ToList(), rather than use IList and check .IsReadOnly. Both ensure correctness but the former does it at the type level, at design time, instead of relying on runtime checks.
C# is old and full of oldness. But it’s also an excellent language that can be written beautifully if you know how. And there’s lots of great code to learn from in the open-source dotnet core runtime repo and related projects.
I dunno if you’re joking, but yeah there’s IDE plugins that do this. GitHub Copilot grabs context from files in your edit history and you can tell it to edit, refactor, “fix” etc. selections. The more complex actions, the less likely to succeed, though.
The direct connection is cool, I just wonder if a P2P connection is actually any better than going through a data center. There’s gonna be intermediate servers right?
Do you need to have Tailscale set up on any network you want to use this on? Because I’m a fan of being able to just throw my domain or IP into any TV and log in
I just use nginx on a tiny Hetzner vps acting as a reverse proxy for my home server. I dunno what the point of Tailscale is here, maybe better latency and fewer network hops in some cases if a p2p connection is possible? But I’ve never had any bandwidth or latency issues doing this
It gets around port forwarding/firewall issues that most people don’t know how to deal with. But putting it behind a paywall kinda kills any chance of it being a benevolent feature.
The standard .NET C# compiler and CLI run on and build for Windows, MacOS, and Linux. You can run your ASP.NET webapps in a Linux docker container, or write console apps and run them on Linux, it doesn’t matter anymore. As a .NET dev I have literally no reason to ever touch Windows, unless I’m touching legacy code from before .NET Core or building a Windows-exclusive app using a Windows app framework.
Ok, there’s no such thing as native Windows apps for Linux, but there are cross platform GUI frameworks like Avalonia and Uno that can produce apps with a polished identical experience across all platforms, no electron needed
It’s fully cross platform with .NET Core and later.
Kogasa@programming.devto
Selfhosted@lemmy.world•Plex is locking remote streaming behind a subscription in AprilEnglish
6·10 months agoIt depends on if you use the “relay” feature. If your server is accessible from the outside it shouldn’t be using this though.
The argument describes an algorithm that can be translated into code.
1/(1-x)^(2) at 0 is 1
(1/(1-x)^(2) - 1)/x = (1 - 1 + 2x - x^(2))/x = 2 - x at 0 is 2
(1/(1-x)^(2) - 1 - 2x)/x^(2) = ((1 - 1 + 2x - x^(2) - 2x + 4x^(2) - 2x(3))/x(2) = 3 - 2x at 0 is 3
and so on
Let f(x) = 1/((x-1)^(2)). Given an integer n, compute the nth derivative of f as f^((n))(x) = (-1)(n)(n+1)!/((x-1)(n+2)), which lets us write f as the Taylor series about x=0 whose nth coefficient is f^((n))(0)/n! = (-1)^(-2)(n+1)!/n! = n+1. We now compute the nth coefficient with a simple recursion. To show this process works, we make an inductive argument: the 0th coefficient is f(0) = 1, and the nth coefficient is (f(x) - (1 + 2x + 3x^(2) + … + nx(n-1)))/x(n) evaluated at x=0. Note that each coefficient appearing in the previous expression is an integer between 0 and n, so by inductive hypothesis we can represent it by incrementing 0 repeatedly. Unfortunately, the expression we’ve written isn’t well-defined at x=0 since we can’t divide by 0, but as we’d expect, the limit as x->0 is defined and equal to n+1 (exercise: prove this). To compute the limit, we can evaluate at a sufficiently small value of x and argue by monotonicity or squeezing that n+1 is the nearest integer. (exercise: determine an upper bound for |x| that makes this argument work and fill in the details). Finally, evaluate our expression at the appropriate value of x for each k from 1 to n, using each result to compute the next, until we are able to write each coefficient. Evaluate one more time and conclude by rounding to the value of n+1. This increments n.
Start with the goal to create something, be it a console app, website, web api, or game. It’s hard to just study a language abstractly and learn it. Use the Microsoft Learn documentation as reference, and look for open source .NET projects on GitHub to get different perspectives on how to build things with .NET. There is a free course on freecodecamp that will get you started by building an app, and I believe it was done in partnership with Microsoft
I don’t think you need permission to send someone an email directly addressed to and written for them. I don’t have context for the claims about Kagi being disputed, but I’d be frustrated if someone posted a misinformed rant about my work and then refused to talk to me about it. I might even write an email. Doesn’t sound crazy. If there’s more to the “harassment” that I don’t know about, obviously I’m not in favor.
Kogasa@programming.devto
Programming@programming.dev•Collection of insane and fun facts about SQLite
8·1 year agoSQLite is one of the best tested codebases in existence. Having only so many variables per line means nothing
But something has to be written on the birth certificate and social security card, and that’s what everything else will expect you to use. I think just due to technical limitations (e.g. of the printer/template for those things) it wouldn’t be allowed, but I dunno about legally
Kogasa@programming.devto
Programming@programming.dev•What is your preferred API error response and why?
4·1 year agoStatus 200 for errors is common for non-REST HTTP APIs. An application error isn’t an HTTP error, the request and response were both handled successfully.
Kogasa@programming.devto
Programming@programming.dev•What is your preferred API error response and why?
5·1 year agoThere may be a need for additional information, there just isn’t any in these responses. Using a basic JSON schema like the Problem Details RFC provides a standard way to add that information if necessary. Error codes are also often too general to have an application specific meaning. For example, is a “400 bad request” response caused by a malformed payload, a syntactically valid but semantically invalid payload, or what? Hence you put some data in the response body.


Not quadratic in the length of the input. Assuming replace is linear this is also linear