• @[email protected]
    link
    fedilink
    132 years ago

    Yup. Took me weeks to figure out why I explicitly need to use sudo nvim for my nginx config on my Pi, while on my server my little helper script could automatically use sudo for me. Turns out, I chmoded the sites-available and sites-enabled on my pi to 644 but left them untouched on my server.

    I still don’t know what numbers would be 644 but with execute permissions, but in the end, idc.

    • Undearius
      link
      fedilink
      6
      edit-2
      2 years ago

      For those that don’t know, you can use three numbers, zero through eight, with the chmod command. it takes the binary of each digit to set the permissions.

      $ chmod 644
       6  |  4  |  4
      110 | 100 | 100
      rw- | r-- | r--
      
      • @[email protected]
        link
        fedilink
        32 years ago

        with the chmid command

        Nah, that command just makes the file below average quality. It’s a new command added by Gen Z.

    • Jamie
      link
      fedilink
      42 years ago

      Execute just adds 1, so if you want the dir world viewable, it’s 755.

    • @[email protected]
      link
      fedilink
      62 years ago

      644 and 755 are the two most useful octal codes to remember because they make up the majority of files on your system. 644 is user read/write but read-only for everyone else. 755 adds execute to that, useful for scripts and directories.

      Other than that, the most common other things are setting access for group and others to zero, so your ~/.ssh directory is 700 (rwx for you, no access for anyone else) and the private keys in it are 600, rw for you, no access for anyone else).

    • @[email protected]
      link
      fedilink
      English
      172 years ago

      You can also do chmod +x to add the executable bit to whatever the existing perms are.

      0: no permissions
      +4: read
      +2: write
      +1: execute

      • 🇨🇦 tunetardis
        link
        fedilink
        142 years ago

        I often go chmod -R go+rX . if I want to give read-only access to whatever I’m working on to everyone else. The capital X only sets the executable bit on directories.

  • Yardy Sardley
    link
    fedilink
    452 years ago

    You wasted 3 hours of your life so far lol

    But yeah. I find the most mysterious and time-consuming of problems are usually caused by a very minor detail that is so obvious it gets overlooked immediately.

    And even if you know that’s probably the case, sometimes your brain will just discard information that isn’t consistent with its assumed reality, and it tells you the piece of code you just read is fine when it’s obviously not.

    Troubleshooting/debugging is fun.

    • Elise
      link
      fedilink
      5
      edit-2
      2 years ago

      Oh god that reminds me of those cases where it IS a language bug. It’s like just not part of reality somehow so you don’t see it.

    • @[email protected]
      link
      fedilink
      162 years ago

      More than a decade of using linux and I still can’t remember setfacl syntax. I have better luck remembering tar syntax.

        • @[email protected]
          link
          fedilink
          32 years ago

          This is a very useful way to remember it, but nowadays it’s better to drop the z (which immediately makes the mnemonic more forgettable, of course). tar can autodetect compression now, so tar -xf should work on anything from plain tar archives over tar.gz to more unusual compression algorithms like tar.xz or tar.bz2.

          (the z is specifically for gzip)

        • @[email protected]
          link
          fedilink
          English
          52 years ago

          And tar -czf compress ze file. I saw someone post these mnemonic devices a while back and now I actually remember tar commands. Amazing!

  • @[email protected]
    link
    fedilink
    7
    edit-2
    2 years ago

    Is lemmy just a collection of low grade SWEs? Constantly see memes like this, talking about “coding in HTML”, or debating Linux distros lol.

    • StarDreamer
      link
      fedilink
      English
      32 years ago

      I would argue that this is something that should be taught in every undergraduate Operating Systems course. But if someone posting it here benefits teens, self-taught hobbyists, and old-timers getting back into the field so be it.

    • @[email protected]
      link
      fedilink
      English
      192 years ago

      There are a few people that are just getting into Unix style operating systems and we all remember and relate. Even if it was 30 years ago.

      • @[email protected]
        link
        fedilink
        12 years ago

        Thank you! I only switched to Linux in 2022. I came for the privacy and performance, and stayed for the customisation, the FOSS philosophy and the terminal experience.

  • @[email protected]
    link
    fedilink
    732 years ago

    SELinux enters the chat

    Sure you own it, your groups owns it, its permissions are 777, SELinux says GEEEEEEET FUUUUUUCKED.

        • Possibly linux
          link
          fedilink
          English
          62 years ago

          Honestly I’ve never had to do anything but the defaults so I can’t really testify to that.

          • @[email protected]
            link
            fedilink
            English
            10
            edit-2
            2 years ago

            It’s a bit of an ordeal on the server-side of things if you don’t know what SELinux does. These days “is SELinux fucking something up?” is a regular on my troubleshooting list, though.

    • @[email protected]
      link
      fedilink
      92 years ago

      But then you get the pleasure of making it submit. My Minecraft server is now running in GNU screen just like I wanted it to, and SELinux can only look on and whimper softly.

  • @[email protected]
    link
    fedilink
    English
    3642 years ago

    If it makes you feel any better, I decided earlier today to experiment with “castnow”, a command-line program for casting to a Chromecast device.

    I grabbed the url of a video off of Archive.org, used wget on a box I was ssh’d into to download the video, and then ran my “castnow” command to cast it to the Chromecast.

    I got a progress bar and current/total time on the TV, but aside from that only a black screen and no audio.

    I tried getting the latest version of “castnow” from the Git repo. I tried transcoding 7 different ways with FFMPEG. A bunch of things.

    Finally, copied the video to my local machine and ran it in mpv.

    The video itself was solid black with no audio and the Archive.org page had comments on it saying “why is there no video or audio?”

    I tried a different video and it worked fine.

  • @[email protected]
    link
    fedilink
    442 years ago

    I love posts like these because they help me avoid mistakes I would’ve definitely made too. Thanks OP!

  • thelastknowngod
    link
    fedilink
    1572 years ago

    Back in the dark, old days of Linux I spent 5-6 hours digging through dbus events and X11 configs to get my mouse working. It was unplugged.

    In my defense, in those days, Linux was such an insane asylum that diving into dbus and X11 as a first step was usually the logical approach.

    • Elise
      link
      fedilink
      32 years ago

      On the bright side you must be tough as bricks now.

    • @[email protected]
      link
      fedilink
      English
      42 years ago

      I am still bitching when I have to touch anything dbus, x11 or xdg.
      Also, finding where an environment variable comes from is fun too.

    • @[email protected]
      link
      fedilink
      42 years ago

      Once helped a nice old lady troubleshooter her computer. Everything was yellow. Checked monitor settings three times. Checked Windows for f.lux. Checked Windows video settings. Reverted drivers. Updated drivers.

      Jiggled the cable.

    • edric
      link
      fedilink
      182 years ago

      Had a similar experience with Mint (of all distros) on an old laptop where it would not detect the headphones I plugged in. Spent like 30 minutes troubleshooting the settings/configuration and googling. Turns out the cable was weird and I just needed to not push it in too deep for it to be detected.

    • @[email protected]
      link
      fedilink
      462 years ago

      Jesus Christ. I’ve never been so thankful for being a Linux noob in my life. That sounds awful.

        • @[email protected]
          link
          fedilink
          82 years ago

          I owe much of my career to trying to set up Linux From Scratch two decades ago. While it’s a much better experience installing Linux nowadays, there’s a lot to be said for the experience spending your weekend debugging a system will give you.

        • @[email protected]
          link
          fedilink
          222 years ago

          Remember make

          Oh wait. Missing something.

          Download it.

          Tar unzip make missing something else. Tar unzip make.

          1 hour later. What was I doing?

    • @[email protected]
      link
      fedilink
      142 years ago

      Been there with those old printer cables that had the two thumb screws. I spent way too long troubleshooting print problems turned out with some cables if you dont screw the thumb screws all the way in you don’t get a good cable connection.

      • @[email protected]
        link
        fedilink
        7
        edit-2
        2 years ago

        Ah yes the good ol’ LPT ports. Back in the days of pin printers and them catching on fire. Good times.

        • Elise
          link
          fedilink
          52 years ago

          I like that it has those little inside bevels to guide the pins. More connectors should have that.

    • @[email protected]
      link
      fedilink
      English
      13
      edit-2
      2 years ago

      Back in the dark, old days of Linux I spent 5-6 hours digging through dbus events

      That’s not possible. In the dark, old days of Linux, dbus didn’t exist yet.

  • Phoenixz
    link
    fedilink
    22 years ago

    R is to read it’s contents, x to enter

    s (g+s) keeps the group for all new files in that directory the same as it’s parent

  • Punkie
    link
    fedilink
    27
    edit-2
    2 years ago

    I worked in a job with build scripts. Developers would list what they wanted in a drop-down menu on a website, with very few “fill in the blanks.” This would create a template, which was sanity-checked.

    One of the “fill in the blanks” was “home directory of user, if not default /home/username.” Some people filled it in, some didn’t. A lot of “users” might be apps with /home being “/opt/appname” “/var/www/html” or something. We checked to make sure that directory existed, if not, create, and set permissions. Easy peasy, all automated. Ran this lots of times.

    Then one day, the script failed. Borked the whole box. Sometimes the VM was corrupt, so delete VM and try again. Usually worked. But this time, the build kept failing. The box went down. Wasn’t even bootable. This happened several times with this one build. So we mounted the borked drive under a new VM and checked out the logs. Just like the dessert stage of Willy Wonka chewing gum, it always failed at the last stage: making /home directories.

    It would create them, then halt that it could not find bash. We looked for bash on the bad drive, and it was the usual /bin/bash shortcut to /usr/bin/bash and we were truly puzzled. I did a chroot to the drive and NOTHING worked. It just hung. That was the first clue.

    The second was looking through the build script (in bash, which we didn’t write) and checking the steps. Looked it the logs. Always died at creating some user named sapadm, the user for the HANA database. Eventually, I checked the configure file, and noticed it was the only user with the odd home directory “/usr/sap.” Then it hit me: the permissions.

    The script, thinking it was a home directory, did a chmod - R 755 for all directories and chmod - R 644 for all files! That meant, while creating home, it made everything under /usr not executable anymore! Holy shit, no wonder nothing worked! So we commented out that user in the config, ran the build again, and we were good! We created the sapadm by hand, and then later fixed the bug in the script.

    SANITIZE YOUR DATA. Or you might turn Violet Beauregarde into a blueberry.

  • auth
    link
    fedilink
    22 years ago

    and you were the one to remove the +x

  • LanternEverywhere
    link
    fedilink
    7
    edit-2
    2 years ago

    As a tip, this is the type of thing that AI is very good at. Just describe what the problem is and ask what might be causing it