Skip Navigation
InitialsDiceBearhttps://github.com/dicebear/dicebearhttps://creativecommons.org/publicdomain/zero/1.0/„Initials” (https://github.com/dicebear/dicebear) by „DiceBear”, licensed under „CC0 1.0” (https://creativecommons.org/publicdomain/zero/1.0/)PE
Perhyte @lemmy.world
Posts 5
Comments 160
How do modern languages deal with prototyping and modules internally?
  • I've never used Rust or Zig, but for Go: (disclaimer: this is all from memory, so there may be inaccuracies or out-of-date information here)

    Go does not allow circular references between modules. That restriction allows the compiler, when compiling a module, to not only put the compiled machine code in the resulting object file for that module but also the information that in C would be required to be in a header file (i.e. type definitions, function signatures, and even complete functions if they're considered candidates for inlining, etc.). When compiling a module that imports others, the compiler reads that stuff back out of those files. Essentially a compiled Go library has it's auto-generated "header file" baked-in.

    In older versions this was actually human-readable: an early part of the object file would essentially look like trimmed-down Go when opened in a text editor. IIRC they've switched to a binary serialization format for this some years back, but AFAIK it still essentially works the same.

    I guess when comparing to C or C++, you could compare this to automatically generating pre-compiled headers for every module, except the headers themselves are also auto-generated (as you alluded to in your post).

    If by "shared library" you mean a dynamically linked one: IIRC Go does allow shared libraries to be used, but by default all Go code is linked statically (though libraries written in other languages may be dynamically linked by default, if you import a module that requires it).

  • I know this isn't exactly self-hosted, but does anyone have experience with this?
  • No idea about the Lemmy hosting bit, but I highly doubt that .com you got will renew at $1 going forward. Judging by this list it'll most likely be $9+ after the first year.

    At $1/year, the registrar you used is taking a loss because they pay more than that to the registry for it. They might be fine with that for the first year to get you in the door, but they'd presumably prefer to be profitable in the long term.

  • Republicans ask Supreme Court to block 40,000 Arizonans from voting in November
  • In Europe I get a voting pass sent in the mail for every election. To vote I have to show both this pass and a valid ID.

    In the Netherlands it doesn't even have to be a valid ID. If it hasn't been expired for more than 5 years it's fine for voting purposes.

  • Why is my tmux borked?
  • Try exiting it and then make sure no tmux process is still running, by for example running ps -aux | grep tmux.

    For future reference: the command to kill the tmux daemon (and as a side-effect, all other running tmux processes connected to it) is tmux kill-server (or in tmux, typing <prefix> :kill-server, assuming default keybindings).

  • Renew ssl certificate in docker container using certbot?
  • The -b in crond -b means to run it as a daemon (in the background), though it appears that is also the default (source). This means the script will continue, but since that's the last line it exits. With the entrypoint stopped, the container also stops.

    The fix should be to replace that line with exec crond -f so the crond process runs in the foreground and becomes the main process running in the container, replacing the entrypoint script. crond -f without exec should also work, but that needlessly keeps an extra process (the shell running the entrypoint script) alive.

  • What is the worst IT setup you have seen at a company?
  • You don't actually have to set all the modification dates to now, you can pick any other timestamp you want. So to preserve the order of the files, you could just have the script sort the list of files by date, then update the modification date of the oldest file to some fixed time ago, the second-oldest to a bit later, and so on.

    You could even exclude recently-edited files because the real modification dates are probably more relevant for those. For example, if you only process files older than 3 months, and update those starting from "6 months old"1, that just leaves remembering to run that script at least once a year or so. Just pick a date and put a recurring reminder in your calendar.

    1: I picked 6 months there to leave some slack, in case you procrastinate your next run or it's otherwise delayed because you're out sick or on vacation or something.

  • Signs of two gases in clouds of Venus could indicate life, scientists say
  • These signs were detected higher in the atmosphere, where the temperature and pressure are more reasonable. And since it took until now to detect the presence of the ammonia, it's probably not a large component of the atmosphere.

    So not boiling hot and probably not that much ammonia. That still leaves the thick clouds of sulfuric acid though, those are still very much a thing any probe or mission to Venus would have to be able to deal with.

  • Docker network internet access
  • Any chance you've defined the new networks as "internal"? (using docker network create --internal on the CLI or internal: true in your docker-compose.yaml).

    Because the symptoms you're describing (no connectivity to stuff outside the new network, including the wider Internet) sound exactly like you did, but didn't realize what that option does...

  • Cloudflare is bad. Youre right.
  • It also means that ALL traffic incoming on a specific port of that VPS can only go to exactly ONE private wireguard peer. You could avoid both of these issues by having the reverse proxy on the VPS (which is why cloudflare works the way it does), but I prefer my https endpoint to be on my own trusted hardware.

    For TLS-based protocols like HTTPS you can run a reverse proxy on the VPS that only looks at the SNI (server name indication) which does not require the private key to be present on the VPS. That way you can run all your HTTPS endpoints on the same port without issue even if the backend server depends on the host name.

    This StackOverflow thread shows how to set that up for a few different reverse proxies.

  • Vertical Tabs can now be enabled in Firefox Nightly and are movable to the right side
  • Is this just placing them vertically, nothing else?

    I currently use the Tree Style Tab extension and really like how it handles sub-tabs and allows collapsing the tree nodes. If I can't have that this is probably not directly useful to me unless extensions can add that functionality.

    I guess I'll be watching how this evolves though.

  • Open source Git repo owners with open licenses, how do you know your code is being used by a big corpo?
  • They've checked in my code in their own repository, using an automated tool that keeps track of its origin so they can still check for updates. (The build tool knows to check this directory before trying to pull in dependencies from elsewhere)

    One benefit to them is that their build won't break if I decide to delete that specific repository (see also: the left-pad incident) or do silly things with version tags (deleting versions, or re-tagging a different commit with the same version number, that sort of thing).

    But more relevantly for this thread, it also means that if I release a new version and they upgrade to it, the PR on their repository won't just be incrementing a version number in go.mod and adding an unreadable hash to go.sum: the diff will show all the changes I've made since the version they previously used.

  • Open source Git repo owners with open licenses, how do you know your code is being used by a big corpo?
  • I may have slightly misremembered the license text (subsection 4c):

    You must cause any modified files to carry prominent notices stating that You changed the files;

    So I guess technically you only need to indicate that you have changed the files, not what you've changed in them. I suppose that's less burdensome because it only needs to be done once per file at most.

  • Open source Git repo owners with open licenses, how do you know your code is being used by a big corpo?
  • I don't think so, no.

    Leaving aside the fact that I don't want to do that:

    They've quite sensibly vendored my library, so I'd have to hope they pull in updates without checking the code changes: since it's such a tiny library (excluding tests but including fairly extensive comments, it's less than 100 lines of quite readable code) I don't think it'd be easy to get it past their code review system if I tried to sneak in enough code to take down entire companies.

    Also, my GitHub account is tied to my real-world identity, so I'd probably be in a lot of trouble if I somehow succeeded.

  • Open source Git repo owners with open licenses, how do you know your code is being used by a big corpo?
  • For MIT, why do you care? That's perfectly fine and explicitly allowed by the license. Same for Apache, but with a few extra requirements (like keeping a list of changes in the source code and preserving licensing information etc.).

    As for how I know big corporations are using my code: the fact that a prominent project (publicly used by several tech giants) took a dependency on one of my tiny (permissively licensed) library packages is probably a clue.

  • Up is an illusion in space
  • Because when people beam over from one ship to the other they don't tend to then immediately sustain cranial injuries? 😛

    Of course, there's probably some technobabble somewhere about the transporters automatically aligning with local gravity (whether artificial or natural) or something.

  • Cloudflare Registrar just added some new supported TLDs

    The following were just added to the list of supported TLDs: app boo channel dad day dev esq foo how mov new nexus page phd prof rsvp soy

    Only app and dev were previously mentioned as "available soon".

    0

    Real Estate Analysis - 2796

    2

    Glass-Topped Table - 2795

    0

    Alphabet Notes - 2794

    3

    Garden Path Sentence - 2793

    3