tapdattl

joined 3 years ago
[–] tapdattl@lemmy.world 13 points 2 days ago

Because she's setting the ground work for a false flag attack

[–] tapdattl@lemmy.world 7 points 2 months ago (1 children)

Maybe do some deduplication first? https://github.com/qarmin/czkawka

[–] tapdattl@lemmy.world 5 points 2 months ago (1 children)

They can both be self hosted, I self-host Seaweedfs personally as part of my backup strategy.

As far as rustfs's "The fast data foundation for the AI era." I believe that's just marketing to illustrate how capable their product is. Looking at their github contributors history the main contributors all appear human

[–] tapdattl@lemmy.world 4 points 2 months ago (3 children)

Are you intent in programming it yourself? Does it have to be in PHP? There are several open source file server projects, SeaweedFS and RustFS to name a couple

[–] tapdattl@lemmy.world 2 points 3 months ago (1 children)

Yup this fixed it -- adding GOPRIVATE=code.mydomain.com as an environment variable allowed go get and go mod tidy to work with my private repos.

Is there a way to set this globally, or to configure Go to always treat any references to code.mydomain.com as a private URL?

[–] tapdattl@lemmy.world 2 points 3 months ago (3 children)

Looking at it again, I'm guessing the part where sum.golang.org/lookup tries to query my behind-netbird server is why the lookup is failing. But is there a way to gave Go not rely on an external service like that? Or have it run the query locally instead of from the sum.golang.org server?

 

Bit of a newbie question here, but I've set up a local Forgejo server in my homelab that I'm using for personal projects. I've created some modules that I want to be able to reference in other local projects.

Trying to run

go get code.mydomainname.com/tapdattl/test

returns

go: downloading code.mydomainname.com/tapdattl/test v1.0.0
go: code.mydomainname.com/tapdattl/test@v1.0.0: verifying module: code.mydomainname.com/tapdattl/test@v1.0.0: reading https://sum.golang.org/lookup/code.mydomainname.com/tapdattl/test@v1.0.0: 404 Not Found
        server response: not found: code.mydomainname.com/tapdattl/test@v1.0.0: unrecognized import path "code.mydomainname.com/tapdattl/test": https fetch: Get "https://code.mydomainname.com/tapdattl/test?go-get=1": dial tcp <my netbird ip address>:443: connect: connection refused

However I know my Forgejo server is up, and I can push to it and clone from it and do all the normal Git workflows. But Go apparently can't talk to it.

Can anyone explain what's going on?

Thanks!!

 

Solved So turns out I need to store the original response and return clones. I've updated the code below to reflect that change. But feel free to use the below to deduplicate requests.

Hello,

I'm working on a small class to deduplicate API request calls. The basic function being a map of request path -> request promise. The issue I am running into is that on sequential calls I get a "response body has already been consumed" error.

From what I've read, I need to use response: (await res).clone() in the call to this.queryMap.set, however when I do that the map doesn't get updated in time to cache the calls (I think) and all 10 queries get sent to the API endpoint without being cached.

Any ideas on what I need to do?

class Deduplicator {
    queryMap = null;

    constructor() {
        this.queryMap = new Map();
    }

    async get(query, ttl = 10) {
        let now = Temporal.Now.instant();
        let cacheCheck = this.queryMap.get(query);
        if (cacheCheck == undefined || now.since(Temporal.Instant.from(cacheCheck.at)).seconds > ttl) {
            console.log("Cache miss on ", query)
            const res = fetch(query, {
                method: "GET",
            });
            this.queryMap.set(query, {
                at: now,
                response: res,
            })
            return (await res).clone(); //Previously just returned res
        } else {
            console.log("Cached response of ", query);
            return (await cacheCheck.response).clone(); //Previously just returned cacheCheck.response
        }
    }
}

Example:

let deduplicator = new Deduplicator();
for( let i = 0; i < 10; i++){
   let a = (await deduplicator.get("https://jsonplaceholder.typicode.com/todos/3", 10)).json();
   console.log('res: ', a);
}
[–] tapdattl@lemmy.world 22 points 3 months ago (1 children)

Best we can do is paid leave

 

Given the following short function

func example(foo string) error {
    if bar, err := doSomething(foo); err != nil {
        return err
    } else {
        doSomethingElse(bar)
    }
    return nil
}

Why does the linter recommend I change the if block to

    var bar whateverType
    if bar, err = doSomething(foo); err != nil {
        return err
    }
    doSomethingElse(bar)
    return nil
}

In my mind the former example restricts the bar variable to the smallest scope that is needed, and more clearly identifies doSomethingElse as something that should only happen if err != nil.

I know it's redundant, but now if I want to change it to an else if ... chain I don't have to worry about accidentally including or excluding code from that block, I already know exactly what's supposed to be in it. I just feel like it's a safer programming practice.

But looking forward to other opinions and discussion. Thanks!

[–] tapdattl@lemmy.world 2 points 4 months ago

Soldering sounds exciting, I think I get some definite nerd street cred for that -- "soldered own laptop" has a nice ring to it.

Be prepared for a "I tried soldering an RTC battery and magic smoke started escaping from my laptop" post soon!

[–] tapdattl@lemmy.world 2 points 4 months ago (3 children)

Checked the BIOS and I couldn't see anything in there about power requirements for booting. I also haven't made any changes to my BIOS recently. I will go ahead see if I can update the BIOS just for redundancy, thank you!

[–] tapdattl@lemmy.world 2 points 4 months ago

Milled out of a solid block of 6063 aluminum, so I'm assuming more robust compared to the plastic

[–] tapdattl@lemmy.world 4 points 4 months ago (2 children)

I've had a Framework 13 for coming up on 5 years now, and I've only had to replace the screen once: I over stuffed a laptop bag with 3 laptops through a cross country flight and when I pulled it back out the screen was dead. That was after about 2 years of daily use. I got a laptop sleeve to protect the laptop and haven't had any issues since.

I am thinking about getting the CNC lid, though, just to make it a little more robust.

 

Hello all, hoping to get a little assistance on a hardware issue I'm having. I've got an older framework laptop (Batch 5, ~Nov. 2021), and recently it's been having issues powering on. Regardless of the laptop's charge, it will not power on unless it's plugged in. As soon as I past the POST, I can unplug it and it will continue on battery, but in order to get it to actually power on it needs to be plugged in.

Not sure what could be causing this, maybe just a weak battery? Battery health is at 84%. Looking forward to ya'lls thoughts. Thanks!

[–] tapdattl@lemmy.world 3 points 6 months ago

Naw dude, the takeaway here is that you're a pendantic prick.

12
submitted 7 months ago* (last edited 7 months ago) by tapdattl@lemmy.world to c/programming@programming.dev
 

Task

I'm working on my final project for school, we are supposed to make a web app of our choosing and there has to be specific features in it. One of it is all data must be encrypted, and the other is that we have to have a search functionality. My app (A customer support framework) has a ticket functionality where customers can submit help request tickets, the contents of these tickets need to be encrypted at rest, at the same time admins need to be able to search contents of tickets.

Current Plan

My current plan is to store an AES-256 encrypted copy of the message message.content to meet the encrypted requirement, and also store a tokenized and hashed version of the message message.hashed to meet the searchability requirement.

The tokenization/hashing method will be:

  • strip the message to alphanumeric + whitespace ([a-zA-Z0-9 ])
  • tokenize by splitting the message by whitespace,
  • SHA-256 each token,
  • rejoin all the hashed tokens into a space seperated string and stored in the message.hashed field.

Thus this is a test string becomes <hash of this> <hash of is> <hash of a> <hash of test> <hash of string>

When the user searches their search string goes through all of the steps in the tokenization/hashing method, then we query the message table for message.hashed LIKE %%<hashed string>%% and if my thinking is right, we should be able to find it.

Concerns

  • Statistical analysis of hashed tokens
    • I really don't see a way around this, to make the string searchable the hashing needs to be predictable.
  • message.hashed field could potentially be huge, if each word is getting a SHA256 hash, a large message could result in a very large hash string
    • maybe we just store the last 4 of the hash?
      • This would increase collisions, but the likelihood of multiple last 4's colliding in a given search string should be pretty dang small, and any collisions would likely not be valid language.
      • Would this help with the statistical analysis concern? Increasing collisions would decrease the effectiveness of statistical analysis. It would be a performance hit, but after returning all matches against the hashes I could decrypt the message.content data and search the raw search query against the unencrypted text and remove any incorrect returns caused by collisions.

I'm interested in hearing everyone's thoughts, am I being logical in my reasoning?

177
submitted 2 years ago* (last edited 2 years ago) by tapdattl@lemmy.world to c/linux@lemmy.ml
 

Hey all,

My father's business requires him to work a lot with PDF forms, combine PDF files, convert scanned pictures to files, etc.

I've found Master PDF editor, but I've found it to be buggy -- specifically when trying to create a new PDF from multiple files the program errors out saying it can't create the file.

I've also tried running Foxxit PDF editor through WINE but that's abysmal.

Any recommendations on Linux native software paid or FOSS, that can fill forms, create/combine PDFs, and do basic edition (rotating pages, etc) that my 70 year old dad can learn to use?

I moved him away from Windows with the Windows 11 debacle, and he's liked Linux so far except for this one issue

Thanks all for your help?

***** EDIT *****

Thanks all for your responses, I'll be trying out StirlingpPDF, PDFSam, OnlyOffice, and re-trying MasterPDF editor over the holidays while I have some 1:1 time with my dad. Tl;Dr: playing family IT and switching your parents to Linux is rough 😂

 

I'm assuming they're mass sending these to people in a specific area code and hoping to steal credit card info.

Obviously don't go to the URL in the picture

 

I'm re-setting up my HomeLab and one of the things I'm trying to learn about on this go-around is Zero Trust networking. To accomplish this I am planning on using NetBird's mesh overlay network. I would like all of my services to use the NetBird mesh network at all times, whether they are communicating within my homelab's LAN or I am accessing them from outside via the greater internet.

I have successfully set up the NetBird management interface on a Hetzner VPS, however the issue I run into is if I lose internet access at home, none of my services are able to function as they can no longer reach the management interface. However, if I self host the management interface in my homelab, I am unable to access it from outside my home LAN.

I've identified 2 solutions that could solve this:

  1. Self host the management interface and set up a Cloudflare tunnel to the management interface, which would allow access from outside my home network.

  2. Self host the management interface, then set up a wireguard proxy/tunnel on a VPS that forwards traffic to my management interface (Similar in my mind to option 1, but not relying on Cloudflare)

What are your thoughts? Any other ideas?

I appreciate your comments/criticisms!

 

As the title states, how would you set it up? I've got an HP EliteDesk G5, what are the strengths and weaknesses of either:

  • ProxMox with one VM running TrueNAS and another VM running Nextcloud
  • TrueNAS on bare metal with Nextcloud running in docker
  • Some other setup

I'd like to be able to easily expand and backup the storage available to Nextcloud as needed and I'd also like the ability to add additional VMs/containers/services as needed

 

It would be blasphemy not to

view more: next ›