• palordrolap@fedia.io
        link
        fedilink
        arrow-up
        0
        ·
        19 days ago

        While the palindromic structure of that command is pleasing to mine eye, LMDE basically called me a frickin’ idiot for trying.

        I know it always asks Continue [Y/n] and there’s no yes | or echo | to force that, so I was reasonably sure I’d get away with it, but I don’t think I could argue with the sentiment had it actually said that.

        (Also, I have Timeshift, so that would have saved my bacon but for the inconvenience of having to go through a rollback.)

        Anyway, here’s what it said (scrolling may be required to see the last line which is clearly code for “you’re an idiot”):

        REMOVING:                       
          apt       apt-utils          mint-meta-cinnamon  mintsources  mintupdate       sudo
          apt-file  command-not-found  mint-meta-core      mintsystem   python3-repolib
        
        WARNING: The following essential packages will be removed.
        This should NOT be done unless you know exactly what you are doing!
          apt
        
        Summary:
          Upgrading: 0, Installing: 0, Removing: 12, Not Upgrading: 1
          Freed space: 52.3 MB
        
        Error: Removing essential system-critical packages is not permitted. This might break the system.
        
        • 🌞 Alexander Daychilde 🌞@lemmy.world
          link
          fedilink
          English
          arrow-up
          0
          ·
          18 days ago

          First of all, it pleases me greatly that you appreciated the palindromic nature of it. That pleased me as I wrote it (you know how you can write something and realize that it’s unintentionally great? lol)

          Second of all, it pleases me that you tried it. lol. I was originally a DOS/Windows guy, so while I know a tiny bit of the Deep Magic, it’s safe to say I’m a fairly average user on the Linux side of things, though I do love learning.

          How brilliant. Just like with rm / -rf protection that you can override, but must override… I had actually assumed (without thought) that sudo and apt were built-in commands like dir and cd in DOS, so there wouldn’t be anything to remove. But makes sense that everything is a package.

          Today, thanks to you, I learned the most delightful thing. Thank you. <3

          • palordrolap@fedia.io
            link
            fedilink
            arrow-up
            0
            ·
            17 days ago

            Everything is a package

            I mean, pretty much. Or rather, everything is in a package. Back in the old days they were called source distributions or .tar.gzs and you compiled everything yourself. Gentoo, for example, still does everything that way, but uses the name ‘package’ anyway.

            The coreutils package, or something like it, contains multiple commands that a bare bones, command-line-only system would need, but some things are built into the shells. e.g. cd is always shell-based. echo may or may not be. ls (dir) is in coreutils.

            There are also things like busybox that, in a single executable from a single package, contains a stripped-down version of everything in coreutils, a shell and a handful of other things too.

        • jdr@lemmy.ml
          link
          fedilink
          arrow-up
          0
          ·
          19 days ago

          Honestly, I want to be allowed to break my system. I own it, it should do exactly what I say, warnings are fine, but software deciding it knows better than you is how we have reached the inescapable technogulag of the now.

  • Err(()).unwrap()@lemmy.world
    link
    fedilink
    arrow-up
    0
    ·
    edit-2
    19 days ago

    Fortunately Windows is at least protected from gaining elevated privileges since it still has to go through UAC. I hope nobody discovers some vulnerability called something like “desktop2shell”.

    • a_jeering_serpent@sopuli.xyz
      link
      fedilink
      English
      arrow-up
      0
      ·
      19 days ago

      Don’t forget the —no-preserve-root flag or you’ll get an index out of bounds when deleting the recipe for five-root-puree

        • a_jeering_serpent@sopuli.xyz
          link
          fedilink
          English
          arrow-up
          0
          ·
          17 days ago

          Oh i was kind of going for the opposite. 😈

          BTW use caution with your glob there, that only does what you described if the folder has contents, if it doesn’t, rather than getting nothing you’ll get back the parent directory, at least in bash. I’m not one of the cool zsh kids.

          • yetAnotherUser@discuss.tchncs.de
            link
            fedilink
            arrow-up
            0
            ·
            17 days ago

            Huh, are you sure or am I just stupid?

            [user@device Documents]$ mkdir test
            [user@device Documents]$ cd test
            [user@device test]$ ls ./*
            ls: cannot access './*': No such file or directory
            

            Same behavior with * instead of ./*.

            • a_jeering_serpent@sopuli.xyz
              link
              fedilink
              English
              arrow-up
              0
              ·
              17 days ago

              I may be the stupid one, i’m sure there’s a related gotcha here under some condition, but objectively not the one i described. Sorry, did not intend to waste anyone’s time and i do appreciate the response back to set me straight.

  • rockSlayer@lemmy.blahaj.zone
    link
    fedilink
    English
    arrow-up
    0
    ·
    19 days ago

    Only tangentially related, but this reminds me of an interaction I had here on Lemmy. I was talking about my pure bash, brain-made CLI app that pushes files between Google Compute head nodes and Google Storage buckets, but does some additional fuckery with bash strings to serve as a crude git. Basically, the app manipulates a string that represents a bucket, and then uses the appropriate gcloud command with that string.

    Someone was extremely concerned about the security of my app, how I should do an AI code review, and that only good programmers use all the tools available to them. I told them that I only want my code to be reviewed by humans. They said it was wild that someone would decline a security review. I told them that if there’s a security issue with my app, they’ll have to take it up with Google.

  • some_guy@lemmy.sdf.org
    link
    fedilink
    English
    arrow-up
    0
    ·
    17 days ago

    If you’re smart, like me, you’ll unplug your devices immediately. Failure to do so ensures your doom.

  • SapphironZA@sh.itjust.works
    link
    fedilink
    arrow-up
    0
    ·
    19 days ago

    Switch off computer is the best mitigation

    Removing keyboard and locking operator out of building is the next best thing.