• 0 Posts
  • 111 Comments
Joined 1 year ago
cake
Cake day: June 11th, 2023

help-circle
  • Here’s one I have saved in my shell aliases.

    nscript() {
        local name="${1:-nscript-$(printf '%s' $(echo "$RANDOM" | md5sum) | cut -c 1-10)}"
        echo -e "#!/usr/bin/env bash\n#set -Eeuxo pipefail\nset -e" > ./"$name".sh && chmod +x ./"$name".sh && hx ./"$name".sh
    }
    alias nsh='nscript'
    

    Admittedly much more complicated than necessary, but it’s pretty full featured. first line constructs a filename for the new script from a generated 10 character random hash and prepends “nscript” and a user provided name.

    The second line writes out the shebang and a few oft used bash flags, makes the file executable and opens in in my editor (Helix in my case).

    The third line is just a shortened alias for the function.



  • Probably not exactly what you’re looking for, but for my personal use I just set up a repo in my git forge (gitea in my case) with a bunch of markdown files in various folders and a Hugo theme.

    Every time I want to update a document I can click the link at the bottom of the “Wiki” page and edit it in Gitea’s WYSIWYG editor. Similar process if I want to make a new document. When I save the changes I have a CI job (native to Gitea/Github) that uses Hugo to build the markdown docs into a full website and sync it to a folder on one of my servers where it’s picked up by a web server.

    Sounds complicated when I type it all out, but the only thing that I can reasonably expect to be a deal breaker is the Hugo software, of which there are archived versions, and even if there wasn’t Hugo’s input is just markdown, so I can repurpose however I see fit.

    You could probably do something similar with other SSG’s or even use Github’s pages feature, though that does add a failure point if/when they decide to sunset or monetize the feature.



  • Even if you need something just once, just install it and then uninstall it, takes like 10 seconds.

    apt install foo && apt remove foo
    

    That’s essentially what nix-shell -p does. Not a special feature of nix, just nix’s way of doing the above.

    Actually using it though is pretty convenient; it disappears on its own when I exit the shell. I used it just the other day with nix-shell -p ventoy to install ventoy onto an ssd, I may not need that program again for years. Just used it with audible-cli to download my library and strip the DRM with ffmpeg. Probably won’t be needing that for a while either.

    The other thing to keep in mind is that since Nix is meant to be declarative, everything goes in a config file, which screams semi-permenant. Having to do that with ventoy and audible-cli would just be pretty inconvenient. That’s why it exists; due to how Nix is, you need a subcommand for temporary one-off operations.







  • so I assumed someone would probably have subscribed before me

    I think the community is very new, so there’s a decent chance you were the first. As to the overloading problem, it’s certainly possible. Lemmy.world has a ton of users, and while I know ruud is dedicating a lot of resources to your lemmy instance, it just may not be enough to keep performance great. There’s been a lot of reports of performance problems by both lemmy.world users and federation problems between .world and other lemmy instances, most likely from being overloaded. You might try setting up a secondary account on another instance if you’re inclined, can’t hurt. Then at least you’ll be able to compare. Mine is on sh.itjust.works and everything has been pretty decent for me since the latest software upgrade, just as a point of reference.

    Sorry for my cluelessness, I’m new to the fediverse

    No worries mate, we’re all new here. I’m still getting used to things too.





  • how can that be if others from this instance have already subscribed?

    How certain are you that the community was already subscribed to? You may be the first person on your instance to subscribe there. If that’s the case you’ll only be seeing anything posted after you subscribed.

    That is, unless Faceman is correct, in which case lemmy.world will eventually backfill content when it can.

    For example, I’m seeing three posts there on both my instance and when I visit https://feddit.nl/c/trendingcommunities. I’m fairly sure that when I first subscribed I could only see the first post, but definitely not sure that’s the case.






  • The way I have my monitoring set up is to poll the containers from behind the proxy layer. Ex. if I’m trying to poll Portainer for example:

    ---
    services:
        portainer:
        ...
    

    with the service name portainer

    from uptime-kuma within the same docker network it would look like this:

    Can confirm this is working correctly to monitor that the service is reachable. This doesn’t however ensure that you can reach it from your computer, because that depends on if your reverse proxy is configured correctly and isn’t down, but that’s what I wanted in my case.

    Edit: If you’re wanting to poll the http endpoint you would add it before like http://whatever_service:whatever_port