• 0 Posts
  • 118 Comments
Joined 2 years ago
cake
Cake day: July 9th, 2023

help-circle
  • notabot@lemm.eetoSelfhosted@lemmy.worldTesting vs Prod
    link
    fedilink
    English
    arrow-up
    2
    ·
    1 day ago

    I manage all my homelab infra stuff via ansible and run services via kubenetes. All the ansible playbooks are in git, so I can roll back if I screw something up, and I test it on a sacrificial VM first when I can. Running services in kubenetes means I can spin up new instances and test them before putting them live.

    Working like that makes it all a lot more relaxing as I can be confident in my changes, and back them out if I still get it wrong.


  • How do such people program?

    They don’t. They used to copy and paste stuff they found on the internet, then when it doesn’t work they made a barely coherent post on Stack Exchange, or maybe the issue tracker of one of the packages they think they’re using. I suppose that nowadays they copy and paste whatever they get out of the LLM de jour, then try to tell it that it didn’t work, copy and paste the answer and repeat until it either compiles or they finally give up and post to an issue tracker.







  • As @Tahl_eN@lemmy.world said in another comment, there’s concentration and there’s flow (aka the zone).

    Concentrating takes effort, is often tiring, and requires disipline to block out distractions. It can feel good to consentrate on a problem or task, give it all your mental energy, and achieve your goal. It can be a fragile state though. If a distraction does break through it can completely disrupt your thought processes, causing you to lose track of everything you had in mind, and effectively sending you back to square one. Practice helps avoid that, but concentration is inherently mentally taxing.

    Flow is different. You will probably only reach it through concentration, and may not jnitally be aware of the transition, but you’ll know it afterwards. The complex becomes simple, stuctures untangle themselves at a thought, you feel mental clarity unlike any other time, everything you’d been struggling with becomes effortless, and time ceases to have any importance. It’s more like a trance or meditation than a normal mental state, and you can stay in that state until your body physically runs out of energy. I’ve ended up sitting at my desk for nearly 24 hours without rising, and without eating or drinking, utterly engrosed in the task at hand, not noticing the sun setting and rising again, and felt entirely calm and rested at the end of it.


  • I normally just use X forwarding over ssh. For simple, X native, apps it usually works nicely, but if you’re using something that draws its own UI (electron apps, browsers and the like often do) it’ll be extremely painful or just fail.

    I believe there is, or was, a way to run a vnc client rootless, but I think you needed to configure the server in a specific way too. It’s been a long time since I tried though so things will have changed.








  • For media to endure, whether we’re talking years or millenia, you need to answer three questions:

    • What to record it on.
    • Where to store it.
    • How to encode it.

    The first is, perhaps, the easiest to answer, we have cave paintings from the stone age, velum and parchment that have lasted thousands of years, clay tablets that have similarly endured and various other historical artifacts that could be considered ‘media’. Alternatively, there are more modern techniques, such as etching into plates of non-coroding metal or other substances, or encoding in stable chemical structures such as DNA. Each approach has different benefits, but largely depends on the second question, where to store it?

    Storing the media is the next question, and the answer is going to depend on both what media you’ve chosen and how long you want it to last. Somewhere dry, solid and geologically stable probably makes the most sense, but it also needs to be accessible to those you hope will find the information later. The Voyager disks are a good example of long term storage that will probably outlast the human race, but they’re not exactly handy to retrieve. The same goes for the various efforts to send archives to the moon; they’re more for posterity than use. Finding, or digging, a tunnel in a bedrock type mountain, far above current, or expected, sea levels is probably a good bet. Don’t forget to record how to find the repository, and find a way to keep that knowledge available. That could be a record in another repository, or maybe engineered into the landscape such that signs point to it.

    The last question is how to encode the information. If you’re aiming to store the information for an extreme duration, you have to assume the entity finding it will have little or no cultural, technological or language connection with you. Pictures may work, we’ve learnt a lot from stone-age cave paintings and Egyptian tomb paintings, but they can only convey so much. For textual information you’re probably going to need multiple layers, the first being illustrated and readable without special equipment or techniques, and showing how to access the latter layers. The next layer should include information about how to read the rest of the layers (do you need magnification? If so, how do you do that? Have you included a lens that could be used? Do you need special illumination, or other techniques? How should the reader do that?), information about the language(s) used (perhaps a Rosetta Stone type artifact to help translate if they know any of the languages) and information about things like the units used (how long actually is a metre? What is a second?). The next layer would explain any envoding used for the rest of the information. If it’s binary stored as pits engraved in stone, or DNA base pairs, or holographically stored in metal plates, how do you extract the data, and how do you convert the naughts and ones to text for example. You must assume the entity processing this has no common base with you to work from, so everythis must be explained in detail. Finally you can store the information you actually wanted to store in the final layer.

    These concerns hold whether you’re trying to store information for millenia or just a few decades. For instance, if I handed you an 8" floppy disk containing a Wordstar file, could you read it without more information? Even once you’ve found an appropriate drive (very rare now-a-days) and a machine that can use it (likewise) you need to hope the disk has been stored appropriately.

    If you’re trying to store information to be accessible to humans over a timespan of no more than a few lifetimes you’ll probably be better served by arranging for it to be reencoded and tranferred to new, modern, media every few years.


  • Trying to avoid using any arithmetic operators, and sticking just to binary (extending beyond 16 bit unsigned ints is left as an exercise for the interested reader):

    #!/usr/bin/perl
    
    # This increments $i
    
    my $i=1;
    print "Start: $i ";
    
    if (($i & 0b1111111111111111) == 0b1111111111111111) {die "Overflow";}
    if (($i & 0b0000000000000001) == 0b0000000000000000) {$i=(($i & 0b1111111111111110) | 0b0000000000000001);}
    else
    {
            if (($i & 0b0111111111111111) == 0b0111111111111111) {$i=(($i & 0b0000000000000000) | 0b1000000000000000);}
            if (($i & 0b0011111111111111) == 0b0011111111111111) {$i=(($i & 0b1000000000000000) | 0b0100000000000000);}
            if (($i & 0b0001111111111111) == 0b0001111111111111) {$i=(($i & 0b1100000000000000) | 0b0010000000000000);}
            if (($i & 0b0000111111111111) == 0b0000111111111111) {$i=(($i & 0b1110000000000000) | 0b0001000000000000);}
            if (($i & 0b0000011111111111) == 0b0000011111111111) {$i=(($i & 0b1111000000000000) | 0b0000100000000000);}
            if (($i & 0b0000001111111111) == 0b0000001111111111) {$i=(($i & 0b1111100000000000) | 0b0000010000000000);}
            if (($i & 0b0000000111111111) == 0b0000000111111111) {$i=(($i & 0b1111110000000000) | 0b0000001000000000);}
            if (($i & 0b0000000011111111) == 0b0000000011111111) {$i=(($i & 0b1111111000000000) | 0b0000000100000000);}
            if (($i & 0b0000000001111111) == 0b0000000001111111) {$i=(($i & 0b1111111100000000) | 0b0000000010000000);}
            if (($i & 0b0000000000111111) == 0b0000000000111111) {$i=(($i & 0b1111111110000000) | 0b0000000001000000);}
            if (($i & 0b0000000000011111) == 0b0000000000011111) {$i=(($i & 0b1111111111000000) | 0b0000000000100000);}
            if (($i & 0b0000000000001111) == 0b0000000000001111) {$i=(($i & 0b1111111111100000) | 0b0000000000010000);}
            if (($i & 0b0000000000000111) == 0b0000000000000111) {$i=(($i & 0b1111111111110000) | 0b0000000000001000);}
            if (($i & 0b0000000000000011) == 0b0000000000000011) {$i=(($i & 0b1111111111111000) | 0b0000000000000100);}
            if (($i & 0b0000000000000001) == 0b0000000000000001) {$i=(($i & 0b1111111111111100) | 0b0000000000000010);}
    }
    print "End: $i\n";