HN user

alex3305

245 karma

https://alxx.nl

Posts1
Comments114
View on HN

I am currently using Brave after switching from Chrome. Chrome changed the way accessibility worked last year which didn't work for me. Instead of scaling text it zooms in on pages which results in an undesirable scrollfest.

Once in a while I retry Firefox but text scaling is a hot mess. On some sites it simply doesn't work, on others content will go outside of the bounding box and on some sites it just clips text. For me it is barely usable in its current form leaving me at Brave.

Is this the reason that Chromium based browsers always change font sizes for me on here? Since I'm visually impaired and have set my text sizing pretty large, I have that issue on multiple sites, including Hacker News. It's a bit of a gamble how large text will be when I refresh the page.

Do they?

Probably not. In my experience most standards are pretty broadly defined with hardly any technical requirements.

For instance in ISO 27001 it states that you should create awareness in your organisation about information security. A very minimal way is to send a mass email to everyone in the organisation or hang up posters in the office. But I also spoke to someone that was determined that a half day security awareness training was minimally required.

Brave browser recently also introduced buttons. I was a tad annoyed with it, but accepted it. Until my wife recently saw the new look while I was working and asked how I could even put up with this. She argued that tabs should look like tabs and not buttons.

Fortunately for Brave the rollback is quite easy with a flag in `brave://flags` where you can disable the `brave-horizontal-tabs-update` feature.

Great addition. I remember that I also looked at Obligator and saved it to my bookmarks. But I decided against it because IMHO the project was just a bit too young. Normally I tend to ignore that, but I really didn't want to switch auth/SSO solutions in a couple of months time because of a lack of maintenance or something like that.

Recently I looked into having a relatively simple SSO setup for my homelab. My main objective is that I could easily login with Google or GitHub auth. At my previous job I used both JetBrains Hub [1] and Keycloak but I found both of them a bit of a PITA to setup.

JetBrains Hub was really, really easy to get going. As was my previous experience with them. The only thing that annoyed me was the lack of a latest tag on their Docker registry. Don't get me wrong, pinned versions are great, but for my personal use I mostly just want to update all my Docker containers in one go.

On the other hand I found Keycloak very cumbersome to get going. It was pretty easy in dev mode, but I stumbled to get it going in production. AFAIK it had something to do with the wildcard Let's Encrypt cert that I tried to use. But after a couple of hours, I just gave up.

I finally went with Dex [2]. I had previously put it off because of the lack of documentation, but in the end it was extremely easy to setup. It just required some basic YAML, a SQLite database and a (sub)domain. I combined Dex with the excellent OAuth2 Proxy and a custom Nginx (Proxy Manager) template for an easy two line SSO configuration on all of my internal services. I also created an Dex Docker template for unRAID [4].

In addition to this setup, I also added Cloudflare Access and WAF outside of my home to add some security. I only want to add some CrowdSec to get a little more insights.

1. https://www.jetbrains.com/hub/

2. https://dexidp.io/

3. https://github.com/oauth2-proxy/oauth2-proxy

4. https://github.com/alex3305/unraid-docker-templates

At university we were tasked with making an Android application for a real client. This was part of our course and was really fun to do. Especially because we did this in two groups competing with each other. The app was some sort of geocaching mixed with a quiz to discover a city in groups. We also built a server side app that accompanied the clients. This app was targeting Android 2.3 and ran on some sort of old Xperia device.

Building the app was a lot of fun and it worked pretty well most of the time. During beta testing however, we were given all the resources that were crreated by a third party. This mostly included UI elements and other images that made up the UI. Testing it out, again, it worked pretty good. Until one time it didn't...

After about an hour or so of playing, the app would consistently crash. After some OS troubleshooting, we came to the conclusion that apparently Android (at the time) had the habit of not putting images in managed memory, but separately. And whenever this space overflowed, an app would simply crash. To resolve this you would need to manage this space yourself and clear out memory.

However we only discovered this a week or so before the deadline. And implementing memory management would be nigh impossible to do. So I came up with the hackiest solution that I ever built. I added a crash handler to the app, which would start another instance. I also added a serializer / deserializer to the app and whenever you reached the main menu all play progress was serialized to storage. Whenever the app crashed and restarted, this was read again and letting the users resume play. The only side effected was some weird app flickering because of the crash and restart.

A week later when we delivered the app to our clients, they wanted to try it out and play test it. So we did, along with the other group. And lo and behold, after an hour or so the app crashed. And restarted. Unlike the other group, were the app crashed and had to be restarted manually.

In the end the client was really happy with the result. Because it just worked. AFAIK the app is still in production the same way it was about 10 years ago.

I'm unsure what a 'TrueCharts' is, but if it's anything Docker based you probably need to mount the Intel GPU device. You can do this pretty easily with a device mount: `--device=/dev/dri`. Another issues that may occur is that `/dev/dri` has insufficient permissions for Docker or that the device driver hasn't initialized.

Maybe it's not really up your alley. But I learned Java with the Java in Action with BlueJ [1]. Although it's pretty basic, the text book really explains all the Java (and OOM) basics in a pretty clear way. The book is called Objects First [2].

In addition I really enjoyed exploring the JDK documentation. Especially Java <1.7 is extremely manageable. Java 8 introduced NIO and lambda's which make Java way more fun, but also a tad harder to learn.

It's not exactly JVM, but just wanted to share anyway :).

1. https://www.java.com/en/java_in_action/bluej.jsp

2. https://www.bluej.org/objects-first/

I cringe every single time I see a for loop for what System.arraycopy () has been providing since early days.

The worst thing is, that System.arraycopy() is an optimized JNI call which is much faster than copying it by hand [1].

For better or worse, it shows me that the author isn't that into Java.

The thing is though, most of the time arrays in Java are used because of performance. Or maybe ignorance. Because why would anyone voluntarily give up all the comforts of a List<T>? It's not that Collections are very hard to find in the documentation. And most of the IntelliJ suggest switching to a Collection anyway.

1. https://www.javaspecialists.eu/archive/Issue124-Copying-Arra...

It's really a tricky balance. Over-allocating collections "just in case" can quite often be very expensive as well

It is sometimes really tricky. When I worked with streaming XML documents that were gigabytes in size, there is a really fine margin you have to work with.

However some general knowledge can be pretty useful. I saw colleagues just do "= new ArrayList<?>(1000);" without considering the collection type or possible size. And besides being a bit ignorant, it can also be really confusing for other developers that take first look at such code.

In my experience, just a little bit of insider knowledge goes a long ways to making better code. Arrays are fun things, especially when you do a deep dive into the System.arraycopy() function. But the same goes for all Collections in Java. For instance, most of them have a default size (mostly 10), and growing them is a costly operation. So knowing beforehand how large your collection can or may be, can benefit code. I could use this effectively when working with large document XML parsing.

I recommend everyone that uses a managed language (Java, C# or others) to at least get a basic understanding of these fundamentals. And also know which collection type to use when.

Isn't 48 kWh/month = ~1.6 kWh/day? That seems impossible. Even 4kWh / day seems impossible for me. I exclusively use electricity, except for heating. My water heater alone consumes about 2kWh/day. Not even talking about cooking, using my computer or watching tv.

How hard is this to configure?

Not at all. Just ensure that you have WoL enabled on the host machine and than proceed to send a magic packet. You could even do this with Home Assistant [1] if you are into that. I did this with a script that used tcpdump to monitor for incoming traffic [2] for Plex with an additional (dummy) Plex server on the Pi. I also remember faintly that I had to add 1 library and 1 video file to make this work though.

Powering down - or sleep - is a bit harder. I built a 'Sleep on LAN' app [3] for myself years ago that could power down (or sleep) a system on demand using a REST API. I used this and Tautulli [3] with Home Assistant that would check if there were any active streams and if there wasn't any activity for a specified amount of time I would send a SoL request to my service.

As you can see it isn't super hard or complicated, but a bit cumbersome to find all the moving bits and make it work. But when it does, it's IMHO fantastic.

1. https://www.home-assistant.io/integrations/wake_on_lan/

2. https://gist.github.com/alex3305/8cc73ddd2c8ca6328f20235480a...

2. https://github.com/alex3305/sleep-on-lan

3. https://tautulli.com/

I used their trial for a bit to test it out with Vorta [1] in a container. Vorta (and Borg) seemed to work fine, until I wanted to restore an archive and I noticed that my recent snapshots were completely empty. Probably because of a misconfiguration on my end though. But it made me look elsewhere. For me backups should be a fire, test and forget solution.

Recently I made the switch to Kopia [2] which seems to have feature parity with Borg (and Restic [3]). It also has a web UI which is way easier to work with than Vorta. And I can easily view, extract and restore individual files or folders from there. This gave me way more confidence about this solution. The only thing I really miss is that I cannot chose different targets for different paths. For instance, with Borg I was able to backup a partial of my Docker appdata to an external source. And I haven't found a way to do this with Kopia. Besides that I'm pretty happy with this solution and I would recommend it.

1. https://vorta.borgbase.com/

2. https://kopia.io/

3. https://restic.net/

5-10 years ago I would think this is perfectly fine. I believe I was not alone in this, but maybe I was. The energy would have cost pennies too and why whine about it?

When I moved into my own home (8 years ago) I brought my 'homeserver' with me. Which was just a simple i5-2600 build with some shucked drives in it. I never thought about electricity prices when I lived with my parents. But that changed rather fast. With the server gobbling up a constant 90W, I quickly realized that, even back than, it would cost me 15 euro's a month on electricity alone.

I than proceeded to put a Pi next to it, that would listen to incoming Plex requests and would start up and shut down the server with WoL. That only reduced costs by about a third. The next couple of years I would move on to a NUC with a NAS that would only consume about 29W/h on average. Which was decent, but not great considering the poor performance of both machines (J4105 and J1800).

Last month I have gone back to the DIY route. Now with a i5-13500. I'm still in the process of optimizing it for power efficiency. Although much more stressful than the prebuilts, I love the hunt for the last watt.

Anyway, what I wanted to say is that I notice that family and friends don't really care about saving power in general. They mostly just pay for it and there's that. While my house runs 100% on electricity and I'm really proud if I can get 9kWh/day on average. Even when I see that (for example) the 8-bit guy uses 100kWh/day on average [1]. Which seems out of this world for me.

1. https://www.youtube.com/watch?v=bXd-aP06lug&t=45s

Which has even been “weaponised” before; there were stories some years ago about stores blasting high-frequency noise outside to deter loitering teenagers without affecting desirable adult shopper

Yeah, they should only work for teenagers. Except for when you are visually impaired like me. I'm almost 35 now and still hear those high frequency noise. It is extremely annoying and even borderline painful. Last year I even got the cops involved when a parked car in front of my apartment constantly emitted a high frequency noise for deterring stone marten and I didn't know who the car belonged to. It was a pretty funny interaction in the end because none of the parties involved (except for me) could even hear the noise. But the car owner admitted they had such a device installed. Resulting in them just moving their car.

What you are saying makes sense. If you are running other valuable apps, then it isn't a waste.

'Valuable' is pretty subjective though. Most of the services are for entertainment purposes. But I also host quite a few useful things such as Bitwarden and CouchDB for Obsidian Sync.

I calculated 20.9kg / user / year.

You are right. I forgot the 24 hours in my calculation:

    (0,0191 * 250 * 365,25 * 24) / 1000
I also noticed that my comment was incorrectly formatted. I've since edited my original comment. If I factor in my complete homelab I use about 40Wh, which corresponds with about 90kg of CO₂ yearly. Which doesn't sound all that bad to me.

I appreciate the intent of this project, but it is not a sustainable approach.

Self-hosting anything isn't sustainable. Even your modem or router isn't sustainable. But having additional backups and privacy is worth something for me. However since I'm in Europe, electricity prices here are through the roof and I try to minimize power where possible. I self host Immich on my Intel Celeron J1800 NAS that uses 19.1Wh on average. I cannot run any ML stuff that it comes with though. But for me the carbon intensity should be about 250 gCO₂eq/kWh [1]. So running my NAS produces about 42 Kg of CO₂ per year for 2 users [2]. Including 10 or so additional applications besides Immich. That sounds pretty reasonable to me.

1. https://www.eea.europa.eu/ims/greenhouse-gas-emission-intens...

2. ((0,0191 * 250 * 365,25 * 24) / 1000)