blashork

joined 2 years ago
[–] blashork@hexbear.net 5 points 1 year ago* (last edited 1 year ago) (3 children)

I have made a python script and ran it on a clone of your git repo to confirm it works, simply run it at the root directory of wherever the files are, it will walk through and find module.json and do the replace.

#!/usr/bin/env python3

import re
import os

import fileinput

pattern = re.compile(r'(?P<pre>.+)\"compatibility\":{\"minimum\":\"(?P\d+)\",\"verified\":\"(?P\d+)\"},(?P.+)')

def make11(match):
    if match.groupdict().get('min', None) and match.groupdict().get('ver', None):
        return f"{match.groupdict()['pre']}\"compatibility\":{{\"minimum\":\"11\",\"verified\":\"11\"}},{match.groupdict()['post']}"

for root, dirs, files in os.walk("."):
    for file in files:
        if file == "module.json":
            for line in fileinput.input(f"{root}/{file}", inplace=True):
                print(re.sub(pattern, make11, line))

[–] blashork@hexbear.net 11 points 1 year ago (6 children)

I also agree sed and some regex is your best bet

I recommend formatting the regex with regex101.com, I'm down to help you if you post some examples

Additionally there is a cli tool, I think jq or something like that, for processing json on the command line

I have foundry too, let me see if I can find the files that need to be updated

 

Meta post I've decided to make. I enjoyed the unixporn subreddit a lot when I used reddit more. I enjoy customizing my linux de as much as the next nerd.

But you definitely shouldn't use racist slang to refer to the process.

To be clear, I didn't know the origin of the term 'ricing' until fairly recently. I was chattimg with my friend and used it to describe my de setup. They informed me that apparently it's from car customization, and is a pejorative against generally asian men who customize their car to look like a racecar.

After learning this I was sad to realize just how engrained it is in linux de customization culture. I personally have stopped using the term, and I would ask everyone here stop as well.

[–] blashork@hexbear.net 3 points 1 year ago (3 children)

Every time I see a kitchen that's just soulless landlord white a piece of me dies. Living spaces should be nice, and have good color schemes. Not just the same white everywhere I go.

Sorry I've been in the process of a move and seeing so many places like this has driven me insane.

[–] blashork@hexbear.net 31 points 1 year ago (2 children)

I will not stand for this anti goblin propaganda >:(

[–] blashork@hexbear.net 2 points 1 year ago

Take this with a grain of salt, cause I did a rig upgrade not too long ago, and was accidentally shipped far more drives than I ordered, so my storage space is silly.

Instead of replacing the drive in your machine, maybe try getting a nas or something. You can store a lot of your files there and keep the drive in your rig for things that need to be fast, like games. Also, I usually base my storage increase purposes based on how much room I need for backups. If there isn't enough room for me to do a full compressed backup, it's time to add more. Besides that, I replace the drive with most of the other parts in one large upgrade.

[–] blashork@hexbear.net 19 points 1 year ago (2 children)

Bitcoin is for buying drugs, and there are better cryptos for it anyways. You shoulda drained that sucker and got so much research chemicals and fenty that any cop approaching you explodes into confetti.

[–] blashork@hexbear.net 1 points 1 year ago

tbh I always go with env variables, usually $SHELL or $zsh are set

[–] blashork@hexbear.net 9 points 1 year ago (1 children)

I'm glad it' working well for you, but I don't think it' true to say that btrfs gets beyond its fair share of flak. It gets the exactly correct amount of flak for what it is. Every place I have worked at that wanted to deploy a COW fs on like, a NAS or server, has always gone with zfs. btrfs is such a mess it never even enters the conversation. Even if it can have its bugs ironed out, the bcache dev was right in pointing out that its on disk formats are poorly designed for their job, and cannot be revised except in a new version of the entire fs. I hope bcachefs gets merged into the kernel next year, that's a filesystem I would actually trust with my data.