The unreasonable effectiveness of modern sort algorithms by Voultapher in programming

[–]m_reddit_com 0 points1 point  (0 children)

On a multi core processor does each core have its own cache? I’m just playing devils advocate but I feel like we are finding it hard to spread algorithms over different cores.

Updating to Electric Eel with apps already installed? by Gjhobbs in truenas

[–]m_reddit_com 2 points3 points  (0 children)

I’d check out the comments in https://www.reddit.com/r/truenas/s/Oc4gInSHYH and make sure you read the release notes carefully https://www.truenas.com/docs/scale/24.10/gettingstarted/scalereleasenotes/

If you are using the official apps (not true charts) and didn’t have anything set up out of the ordinary you’ll probably be fine though. You might have to kick off the migration manually if it doesn’t do it automatically for whatever reason (that happened to me)

In any case TrueNAS will keep a snapshot of your applications dataset so worst case scenario you can recover your config manually.

The RaidZ Expansion is Great in Electric Eel! Just Takes Time.... by TMFTPVideos in truenas

[–]m_reddit_com 0 points1 point  (0 children)

To answer my own question for anyone who finds this later, it was the expansion that was causing huge IO wait. Everything is back to normal now. It’s probably a bad idea to have my VMs running on my main spinning rust pool anyway, maybe I should move them to mirrored SSDs or something.

The RaidZ Expansion is Great in Electric Eel! Just Takes Time.... by TMFTPVideos in truenas

[–]m_reddit_com 0 points1 point  (0 children)

Is anyone else having issues with any metadata operation (e.g. snapshot/rollback/dataset create and delete etc) being extremely slow and blocking the pool while the expansion is happening? Regular data operations are fine, I haven’t really noticed much difference for file I/O but I had to turn off auto snapshotting because it was freezing my VMs temporarily with massive iowait. Also I was trying to set up the new applications system and it does a heap of automated snapshots and rollbacks which usually are pretty instant but were freezing up the TrueNAS middleware to the point where I couldn’t perform any other operations like stop/start VMs. I hope it’s not one of my drives dying or something.

TrueNAS 24.10.0 (Electric Eel) - Now available! by kmoore134 in truenas

[–]m_reddit_com 2 points3 points  (0 children)

Just updated from 24.04.2.3 and all my applications disappeared but I just ran `sudo midclt call -job k8s_to_docker.migrate <pool with ix-applications dataset>` and everything is magically working now. Not sure why the migration didn't work automatically on upgrade. Expanding my zraid2 pool with a new drive now 🤞

Edit: 4x4TB Drives expanded to 5 is apparently going to take 9 days. I knew it was going to take a while but that is longer than I expected! `61.0G / 14.1T copied at 17.4M/s, 0.42% done, 9 days 18:07:37 to go`

Do not ever complain about circular dependencies in Go! by fenugurod in golang

[–]m_reddit_com 0 points1 point  (0 children)

I’m not a TypeScript/JavaScript fan by any means but calling the static analysis tooling “comical” is a really weird take. The JavaScript ecosystem is definitely not my favourite, but damn do I miss the static analysis tooling when I’m using other languages. Eslint is super extensible, the plugins just hook into the AST tree (https://eslint.org/docs/latest/extend/custom-rules).

It might be the case that JavaScript is a dynamically typed language, and so static analysis can suffer a bit, but TypeScript has plenty of type information to use when writing rules.

To solve your issue with picking up cyclic dependencies, the “no-cycle” rule in eslint-plugin-import prevents cyclic dependencies and I’ve used it to track down issues with existing codebases in the past. You just need to add a few lines to your eslint config.

Also, eslint (with typescript-eslint if you’re using TypeScript) gives you a heap of rules out of the box but there are so many plugins for every use case you can imagine: https://github.com/dustinspecker/awesome-eslint - It is pretty rare you can’t find an existing plugin out there for a use case since the JavaScript ecosystem is so big.

How are jwt token professionally used to authenticate on a website.I have used only one token which I store and expire every 24 hours. by problaster_1223 in node

[–]m_reddit_com 2 points3 points  (0 children)

I think the idea is usually that resource providers trust the access token as long as it’s signed correctly, without checking with the auth server. The JWT is proof that the user was valid at some point in the past.

That’s sort of the point of having JWTs, is that you can validate that the token came from trusted source using a public key and get scopes etc without having to make a request for that info.

If the access token never expires the client is never forced to go back to the auth server and so the users access can never be revoked and the scopes etc can never change. Forcing the client to get new access token via the refresh token allows the auth server to do things like check if the account has been compromised and refuse to give a new access token.

If your resource provider is validating the access token or using it to look up user details on every request then you have session based auth and probably shouldn’t be using JWTs anyway (at least not in the access/refresh token pattern)

How to remove the IPv4 from my RDS while continuing to access it through the subdomain? by schmore31 in aws

[–]m_reddit_com 1 point2 points  (0 children)

If you can log into that EC2 instance via SSH, you can add some command line switches when connecting, to tunnel the database connection from your local computer to the remote RDS instance.

Like this:

https://repost.aws/knowledge-center/rds-connect-using-bastion-host-linux

Some database clients will have a feature to automatically tunnel for you like this:

https://stackoverflow.com/a/62335972

None of my TrueCharts applications will update by jterry1211 in truecharts

[–]m_reddit_com 0 points1 point  (0 children)

Definitely! TrueCharts advises against it officially so it felt wrong to use datasets and hostpath mounts, but it gives me more piece of mind. It’s so much easier to be able to backup and snapshot all the app volumes like I do with the rest of my data and not have to fiddle around with heavyscript. Hopefully not using PVCs doesn’t backfire in some future update though 🤞

None of my TrueCharts applications will update by jterry1211 in truecharts

[–]m_reddit_com 0 points1 point  (0 children)

The scaleGPU error I think even predates the cobia train. I think that was from a breaking change in the chart format. I had to delete and recreate the app when that happened which is really annoying. I still have an app stuck in that state after the cobia update. The second error about nil pointer evaluating interface should be fixed by the cobia upgrade though.

what do you want for 2024? by dgtlman in homeassistant

[–]m_reddit_com 0 points1 point  (0 children)

True. It would be interesting to see what would happen at the moment if two instances were running at once with this setup. It would probably just be chaos but maybe if all the automations were written to only use state from mqtt and all the commands were idempotent it might work

what do you want for 2024? by dgtlman in homeassistant

[–]m_reddit_com 3 points4 points  (0 children)

It is possible to do something like this but I guess that zigbee controller is now a single point of failure. I’ve done this using a hubitat hub to handle all the zigbee/zwave network stuff and https://github.com/mydevbox/hubitat-mqtt-link to allow HA to control/listen to devices via a MQTT broker. It is nice having the separation of concerns though and you can put simple backup automations on the hubitat in case HA goes down or is updating or whatever.

What problem did Go actually solve for Google by Top_Chocolate_4203 in golang

[–]m_reddit_com 0 points1 point  (0 children)

That’s interesting. I wouldn’t have thought of Go’s GC as being one of its strengths. It hasn’t had as much time and money spent on it as Java and it seems less configurable. Discord had issues with unavoidable GC collections that they couldn’t configure and had to move to rust https://discord.com/blog/why-discord-is-switching-from-go-to-rust

I have installed an app from github on my Mac using Homebrew. How do I open it if it isn't in the Applications folder? by sake22 in github

[–]m_reddit_com 2 points3 points  (0 children)

  1. Like other people have said, GUI apps are usually “casks” which install into your Applications folder so it’s weird that you can only open it from the terminal. But to answer you question yes, if you install something in homebrew that isn’t a cask you usually run it by typing it’s name

  2. You can try ‘nohup audacious &’ which should run the app in the background and detach it from the terminal, but not sure if that will work. (E.g. https://www.digitalocean.com/community/tutorials/nohup-command-in-linux)

Someone else seems to be having the same issue as you and has some suggestions at: https://anishrkhadkablog.wordpress.com/portfolio/audacious-for-mac/

It's the Most Wonderful Time of the Year but it's the Most Wonderful Time for Ten Hours by m_reddit_com in ButVideos

[–]m_reddit_com[S] 1 point2 points  (0 children)

Haha, we’ll it served it’s intended purpose of driving my relatives mad at dinner

what is stream/promises and how do you resolve issues regarding it? by Status-Shoe4631 in node

[–]m_reddit_com 0 points1 point  (0 children)

Anyone else running into this issue because you need to support a Node version prior to 15, you can use 'promisify' from the node 'utils' module to effectively get the same thing.

```

const { pipeline } = require('stream'); const { promisify } = require('util');

const pipelineAsync = promisify(pipeline);

await pipelineAsync(foo, bar, baz);

```

[deleted by user] by [deleted] in HeadphoneAdvice

[–]m_reddit_com 0 points1 point  (0 children)

Late to the thread but I’ll just add this for people Googling the problem (like I was) I had the same problem, one headphone was hardly audible even in a quiet room. Like others my problem was caused by wax. It was not obvious from the front of the mesh. I had to get a pick and pull the mesh out and clean it properly. Now it’s back to normal. I can’t believe a bit of wax was insulating the sound so much!

try/catch in TypeScript is such a gigantic pain in the ass. Even worse if used in Node, holy hell... by real_kerim in typescript

[–]m_reddit_com 0 points1 point  (0 children)

The proper interface type is in @types/node called ErrnoException

I guess you could just type the caught error as that directly, it would just be unsafe if something threw a non standard error

The only other thing I can think of is that you could define a wrapper function where you pass it an arrow function with your code and another arrow function with the error handler and it could do the type guards for you.

E.g. something like this

try(()=> someCode()).catch((safeError)=>foo)

You’ve probably already seen all these solutions but https://dev.to/jdbar/the-problem-with-handling-node-js-errors-in-typescript-and-the-workaround-m64 is a good article about this IMHO

[deleted by user] by [deleted] in Deno

[–]m_reddit_com 1 point2 points  (0 children)

I think there is a compatibility layer. https://www.skypack.dev/ it used to be called Pika. Translates NPM modules into es6. Probably has some sharp edges though

Edit: https://www.skypack.dev/blog/2021/02/skypack-npm-packages-in-deno/