Howdy! 👋

I’m level 27 web dev from 🇫🇮 Finland. Full stack developer by trade but more into server side and sysadmin stuff.

A furry or something. Why be yourself when you can be fluffy raccoon on the internet?

I’m also on Mastodon: @jakeRaccoon@mastodon.social

  • 1 Post
  • 33 Comments
Joined 1 year ago
cake
Cake day: June 20th, 2023

help-circle

  • JRaccoon@discuss.tchncs.detoSelfhosted@lemmy.worldDynamic IP - Self hosting
    link
    fedilink
    English
    arrow-up
    2
    arrow-down
    1
    ·
    3 months ago

    I’ve been using No-IP free plan for years without issues. Inputted the credentials to my routers DDNS client and then basically forgot about it. Free users need to confirm their account once a month via email but that’s just one click.

    If your domain registrar happens to have an API to update DNS entries, you could implement DDNS yourself by writing a simple automated script to check the external IP (e.g. via ipify.org) and if it’s changed from the last check then call the API to update the DNS entries.






  • Cool, thanks for the explanation.

    a single application that gets bundled with all necessary dependencies including versioning

    Does that mean that if I were to install Application A and Application B that both have dependency to package C version 1.2.3 I then would have package C (and all of its possible sub dependencies) twice on my disk? I don’t know how much external dependencies applications on Linux usually have but doesn’t that have the potential to waste huge amounts of disk space?













  • TypeScript

    GitHub link

    It’s nice to have a quick easy one for a change

    Code
    import fs from "fs";
    
    const rows = fs.readFileSync("./09/input.txt", "utf-8")
        .split(/[\r\n]+/)
        .map(row => row.trim())
        .filter(Boolean)
        .map(row => row.split(/\s+/).map(number => parseInt(number)));
    
    console.info("Part 1: " + solve(structuredClone(rows)));
    console.info("Part 2: " + solve(structuredClone(rows), true));
    
    function solve(rows: number[][], part2 = false): number {
        let total = 0;
        for (const row of rows) {
            const sequences: number[][] = [row];
            while (sequences[sequences.length - 1].some(number => number !== 0)) { // Loop until all are zero
                const lastSequence = sequences[sequences.length - 1];
                const newSequence: number[] = [];
                for (let i = 0; i < lastSequence.length; i++) {
                    if (lastSequence[i + 1] !== undefined) {
                        newSequence.push(lastSequence[i + 1] - lastSequence[i]);
                    }
                }
                sequences.push(newSequence);
            }
    
            // For part two just reverse the sequences
            if (part2) {
                sequences.forEach(sequence => sequence.reverse());
            }
    
            // Add the first zero manually and loop the rest
            sequences[sequences.length - 1].push(0);
            for (let i = sequences.length - 2; i >= 0; i--) {
                sequences[i].push(part2
                    ? sequences[i][sequences[i].length - 1] - sequences[i + 1][sequences[i + 1].length - 1]
                    : sequences[i][sequences[i].length - 1] + sequences[i + 1][sequences[i + 1].length - 1]
                );
            }
        
            total += sequences[0].reverse()[0];
        }
    
        return total;
    }