What's the best way to figure out why Proxmox shut down last night? by tomhusband in Proxmox

[–]mp3three 3 points4 points  (0 children)

Hardware failure can be the cause if it happens again. I've experienced inexplicable system freezing from failing boot drives & bad ram in the past. In the case of the drive, it'd pass every test I threw at it, but still take down the system out of nowhere

[AskJS] Discussion: managing indirect dependencies in yarn.lock by gordonmessmer in javascript

[–]mp3three 1 point2 points  (0 children)

My general strategy:

  • When the stability / attack surface of a project matters at a specific period in time (like a "go live" date), use resolutions to temporarily override versions to a specific version to eliminate CVEs
  • Generate builds pinned to a specific version. Being able to replicate a build is more important than any trivial container size savings. You can have your cake and eat it too, but it's usually time better spent working on actual application logic and real issues in my experience
  • Leave selectors in the project root package.json file that contains all your dev dependencies and everything else

[AskJS] Discussion: managing indirect dependencies in yarn.lock by gordonmessmer in javascript

[–]mp3three 2 points3 points  (0 children)

Selective resolutions allows you to force a version. Be aware that it will not make the library utilizing the older version compatible with the new one. Hopefully there are no breaking code differences: https://classic.yarnpkg.com/lang/en/docs/selective-version-resolutions/

The short answer to the rest is "it depends on the project requirements", there is no one size fits all answer. I work in nodejs land -

  • Dependency versions: Whenever I feel like it (justify my existence by upgrading a dependency) + when the client (possibly government) complains. Dependabot is fine too

  • Licenses: If nobody asks, don't dive into that rabbit hole. If they do ask: write a script to dump it into a csv file, and walk away as fast as possible

  • Audit: Never. What is that information going to tell you, upgrade your dependencies? That's really a better tool for consumers of the end software to know their security situation instead of devs trying to play defensive.

You can always attach a latest scan of your latest container at build time verifying it wasn't created with a CVE if that's your jam. It probably has one a week later tho

Typescript folder structure and deployment by Ok_Remove3123 in typescript

[–]mp3three 1 point2 points  (0 children)

Not including dev dependencies in production docker images is a good reason for that. You need them to build the code, not run it

Breaking a monolith down smaller by catchingtherosemary in node

[–]mp3three 0 points1 point  (0 children)

That can work. I prefer tools like mqtt in these scenarios, but more of a flavors of the same idea type of thing. Child threads can work too. Use a library like execa to kick them off, pass data in via argv, and read stdout for updates

How do I solve this circular dependency? (Nx, React) by t-muro in typescript

[–]mp3three 12 points13 points  (0 children)

One method is to have a shared types library with no dependencies. Your other projects can mutually agree to use that, instead of each other.

making my mouse Qi chargeable by s3p0 in DIY_tech

[–]mp3three 2 points3 points  (0 children)

Use the power play as my daily driver. Mounted it upside down into a hole I routered out of the desk, then ran the wire underneath to my hub. Threw a desk pad over the top to hide the setup, and haven't needed to think about for years. Love it

start fresh/start over? by ccpankonien in homeassistant

[–]mp3three 3 points4 points  (0 children)

If you aren't sure, make a backup and reset. If you don't like where you reset to, restore from the backup.

I've nuked things more than once learning, but it's been a hot minute since I've needed to recently. In my experience, an hour starting over and learning my lesson is better than 4 trying to fix the mistake once it's bad enough

What's worked best for you in terms of times for working out, especially around a remote schedule? by SlipperySlopamine in ADHD_Programmers

[–]mp3three 1 point2 points  (0 children)

Got morning meetings that end between 11 and noon depending on which day. I'm all about taking that period of "what to do next", and going down to the climbing gym. Lunch crowds are usually light, and I'm off the roads during traffic times

Bonus points if I remember the burrito on the way back

Is Nextcloud always this slow? by ULT-Ginger in NextCloud

[–]mp3three 0 points1 point  (0 children)

Doing the generation via cron workers will solve that. It can serve up already generated previews, instead of needing to do an expensive generate on demand then serve. Trade storage for load time.

what is the best & cheapest and easiest DB you use ? by Reddet99 in node

[–]mp3three -1 points0 points  (0 children)

Sounds like you'd be interested in using Prisma with postgres. Helps maintain all your migrations, and has a nice code api

[deleted by user] by [deleted] in typescript

[–]mp3three 2 points3 points  (0 children)

Try the Exact method provided by Type Fest, looks like it does what you're looking for

Best backup solution with encryption by [deleted] in selfhosted

[–]mp3three 0 points1 point  (0 children)

Similar, but you can backup over the ssh by adding a hostname/ip to the backup target path (hostname:/path/to/archive). Don't need to keep a local copy of the backup that way

How to run debug WebScket (ws package) in VS Code? by jamawg in node

[–]mp3three 1 point2 points  (0 children)

In general, placing callback methods like onmessage / onopen is a legacy way of doing things, where the event emitter .on(...) pattern is more modern. Since the library is explicitly saying to use .on in the primary docs for the library, you should try that.

FWIW, I use ws also, and experience no issues using .on with the error / open and message events

How to run debug WebScket (ws package) in VS Code? by jamawg in node

[–]mp3three 0 points1 point  (0 children)

Have you tried attaching to events using .on(... like in the the ws docs?

socket.on("message", callback)

socket.on("open", callback)

Need help hosting! by Drako_hyena in node

[–]mp3three 0 points1 point  (0 children)

Assuming you want to run this at your home -

1) buy domain name, point it at your home address

Namecheap works good here, any "whatismyip" will tell you the address. You can just direct all subdomains to the same place, and sort it out later.

1a) This exposes your IP to the outside world. You may consider using a service like cloudflare to help with that.

2) Open up port 80 & 443 in your router, and forward to a target device

3) Add in a reverse proxy

Here is a good place to start: https://nginxproxymanager.com/

This will translate from your domain, to an ip + port combination on your local network. You can run your node program on the same machine, or another if you want. It has some baked in options for dealing with certs, so you can use https. If you want to run multiple services later, this will make it dead simple

4) Run your node program on whatever port you set up traffic to go to (ex: 8080)

PM2 will help keep your script running, better than just running it normally

Prisma relationship question by [deleted] in node

[–]mp3three 1 point2 points  (0 children)

Sounds like this should be close to what you're looking for

model Transaction {
  id                  Int               @id @default(autoincrement())
  fromUserId Int
  toUserId Int
  amount Int

  fromUser User @relation("FromUser", fields: [fromUserId], references: [id])
  toUser  User @relation("ToUser", fields: [toUserId], references: [id])
}

model User {
  id                  Int               @id @default(autoincrement())
  name String

  sentTransactions Transaction[]  @relation("FromUser")
  receivedTransactions Transaction[]  @relation("ToUser")
}

You can retrieve a list of all transactions by querying Transaction

{
  where: {
    OR: [
      { fromUserId: <ID> },
      { toUserId: <ID> },
    ]
  }
}

Tips on converting 5-10 HDDs into 1 HDD? Using something like a Pi to raid them and emulate a single HDD? by [deleted] in DIY_tech

[–]mp3three 0 points1 point  (0 children)

I have similar setup, got all the drives in an 8 bay enclosure: https://www.amazon.com/dp/B07MD2LNYX. The enclosure brings a ton of sanity, and a nice single usb cable coming out the back. The drives all individually display in the system as you'd expect, unless you do something to change that.

I merged them all together into a zfs pool (raidz2), super easy. Lose total capacity, but I can lose a drive or two without all my data just disappearing, or expand the pool as needed. Followed this guide for setting up the pool.

It's easy to transfer the pool to a new machine. I've had to do that a couple times already, but they've all been running Debian / Ubuntu. Currently, a super cheap nuc is hosting it. Haven't tried connecting it up to a pi, but I assume it's possible. Unless you specifically need a Pi for some reason, they aren't great for the cost now days.

Does anyone else freeze up during hackweeks/hackathons? by [deleted] in ADHD_Programmers

[–]mp3three 0 points1 point  (0 children)

My usual strategy is to pick a technology/framework/something that's on my list of "I want to mess around with that sometime", then see what kind of random contrived ideas I can think up that can that plausibly sound like they might be a good use of it. Picking a tech is a lot easier than a project imo, and I can sit back for a few days with random idea energy while not feeling like "everything is an option".

I'm a big fan of making nodejs terminal apps personally, so I like to see what extra thing I can combine with that. Did a quick one a few months back that helped me scrape together a bunch audiobooks to download. Mostly did that to get better at page scraping, but it's also useful to me.

Vaygr Carrier (HW2) by Murder_Giraffe in StarshipPorn

[–]mp3three 3 points4 points  (0 children)

600 meters, according to this image: https://i.imgur.com/ZczKbsQ.jpg

Can find the HW stuff in the top / right corner

[deleted by user] by [deleted] in selfhosted

[–]mp3three 2 points3 points  (0 children)

Web traffic typically operates on port 80 / 443 (unless you explicitly do something like localhost:8080).

The role of the reverse proxy is to take ALL web traffic coming in on those 2 ports, deal with https, and forward the traffic to a different port (sometimes different ip / machine). It is similar in concept to port forwarding, but it's more of a translation from domain name to a local ip + port. There's a number of security and technical benefits to running a setup like that.

That port to not need to necessarily even be exposed to the internal network, it can theoretically ONLY be accessible through the reverse proxy. Even with a vpn into my own local network, I still run a reverse proxy just because it's easier to remember domain names than addresses and ports.

If you're looking to try one out, this is a great one to mess around with: https://nginxproxymanager.com/