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.
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--
with the chmid command
Nah, that command just makes the file below average quality. It’s a new command added by Gen Z.
Execute just adds 1, so if you want the dir world viewable, it’s 755.
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).
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: executeI often go
chmod -R go+rX .
if I want to give read-only access to whatever I’m working on to everyone else. The capitalX
only sets the executable bit on directories.
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.
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.
No one mentioned ACLs so far. If you see a + using ls -l like this
drwxrwx---+
, you have an access control list entry.and then what is the thing that will happen to us next
More than a decade of using linux and I still can’t remember
setfacl
syntax. I have better luck rememberingtar
syntax.tar -xzf
extract ze fileThis 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)
You don’t even need the dash (
-
).
And
tar -czf
compress ze file. I saw someone post these mnemonic devices a while back and now I actually remember tar commands. Amazing!
Danngggg… 3 hours maannn…
Is lemmy just a collection of low grade SWEs? Constantly see memes like this, talking about “coding in HTML”, or debating Linux distros lol.
We all started small, making mistakes. Most of us still do from time to time
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.
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.
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.
SELinux enters the chat
Sure you own it, your groups owns it, its permissions are 777, SELinux says GEEEEEEET FUUUUUUCKED.
Selinux is great. It provides actual security to a system
But it is hard to operate. Source: did more than audit2allow for years.
Honestly I’ve never had to do anything but the defaults so I can’t really testify to that.
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.
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.
deleted by creator
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.
This is hilarious
My desktop background used to be solid black with faint grey text reading “Yes, the monitor works.”
deleted by creator
Beautiful story. Feel that we’ve all been there. Every now and then, when the assumption is that the stupid piece of tech isn’t working, and there it is, just functioning as intended :)
Thanks for sharing
I love posts like these because they help me avoid mistakes I would’ve definitely made too. Thanks OP!
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.
On the bright side you must be tough as bricks now.
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.Remember - if an environment variable’s not your fault, it’s your parent’s fault.
Let’s just hope X11 will soon be gone for good.
Or forgetting to enable the third button/wheel in the kernel
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.
Ah, good old VGA brings the memories back
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.
Jesus Christ. I’ve never been so thankful for being a Linux noob in my life. That sounds awful.
Those days gave me a career so I can’t really complain.
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.
Remember make
Oh wait. Missing something.
Download it.
Tar unzip make missing something else. Tar unzip make.
1 hour later. What was I doing?
Turns out, I do need therapy.
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.
Ah yes the good ol’ LPT ports. Back in the days of pin printers and them catching on fire. Good times.
I like that it has those little inside bevels to guide the pins. More connectors should have that.
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.
There’s always a darker, older day
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
The EPERM didn’t give you a little hint?
Wouldn’t it be EACCES?
ESOMETHING
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.
and you were the one to remove the +x
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
This sentence can be posted on pretty much every Lemmy post
Why do people keep telling me to ask Al about these questions? He’s just my next door neighbor for god’s sake
Big Al also says dogs can’t look up