• 0 Posts
  • 73 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.







  • Coming in late here, but your best starting point I think is to find someone that has published a list of known federated lemmy servers, or build your own.

    • I think there’s an API endpoint (IDK if you have to be an authenticated user to access) that lists which servers a particular server is federated to
    • Use that to query all the servers in that list at the same endpoint, deduplicate, and repeat to build a graph of the fediverse.
    • From there you can use a different API endpoint to query which servers are open vs. closed registration
    • Then you can ping each server to find that latency, but that’s not the whole picture.
      • some servers are starved for resources, or on an older version of software that is less optimized, so there may be a way to use the API to navigate to random posts and capture the time it takes that to complete; probably a more useful metric.
      • Might also be a good idea to get a metric for the number of users on that server too, as that might sway your opinion one way or the other.
    • There might be an endpoint to query the number of banned users, but I don’t recall seeing it.

    IDK if you’re interested in doing that work, but I don’t think anyone has published tooling so far that you can run on your desktop to get that performance info. There’s Python libraries already out there for interacting with the Lemmy API, so that’s a good jumping off point.

    Edit: Now that I’m thinking about it, that could be a pretty useful for the main website(s). They can use those type of queries on the backend to help with suggestions for new user onboarding.


  • I self-host basically everything I can, aside from email. Self-host Calendar, contacts, streaming, budgeting, documents and storage, passwords, private chat, etc.

    Email I’d love to self-host, but consensus seems to be that it’s between moderately difficult to impossible to get outbound deliverability depending on quite a few factors, some of which are out of one’s control.

    As for reasons why I self-host, basically everything you’ve listed in your post. I want to be the owner of my data, not some corp making profit by mining it for ad revenue or selling it to data brokers. Also I love digging into the guts of standing up my own services and keeping them maintained, I’ve learned so much over the years from it.





  • Have a Oneplus 7 Pro, first Oneplus phone I’ve owned and it will be the last. Absolutely love the phone itself, but Oneplus as a company, the software they package, the warranty issues, and the direction they’ve gone as a value pick have all fallen off a cliff since it was produced, and have turned me off to ever upgrading to one of their newer models. That’s fine for me though, I have replacement parts on-hand, and a third-party actually maintained rom, so I’m OP7P until the wheels fall off this thing.

    Edit: Can’t comment with experience on other OP phones, but I’ve heard very good things about the 6s, it was my second pick when I was looking for a phone at the time.