I’m working on a some materials for a class wherein I’ll be teaching some young, wide-eyed Windows nerds about Linux and we’re including a section we’re calling “foot guns”. Basically it’s ways you might shoot yourself in the foot while meddling with your newfound Linux powers.

I’ve got the usual forgetting the . in lines like this:

$ rm -rf ./bin

As well as a bunch of other fun stories like that one time I mounted my Linux home folder into my Windows machine, forgot I did that, then deleted a parent folder.

You know, the war stories.

Tell me yours. I wanna share your mistakes so that they can learn from them.

Fun (?) side note: somehow, my entire ${HOME}/projects folder has been deleted like… just now, and I have no idea how it happened. I may have a terrible new story to add if I figure it out.

113 points

Running the right command on the wrong SSH session/machine.

permalink
report
reply
40 points

This is the scariest comment I’ve read in this thread.

permalink
report
parent
reply
5 points

Imagine that you’re using fqdns instead of ips…

I refuse to elaborate.

permalink
report
parent
reply
24 points

I set a different background color on all my machines because of exactly this while using VNC/RDP

permalink
report
parent
reply
9 points

this. after i set different zsh themes on my servers + my main machine i now know exactly what machine i’m running commands to

permalink
report
parent
reply
2 points

Neat idea, I hope I’ll remember this when I’m setting up my next server.

permalink
report
parent
reply
9 points
2 points

Me every single day

permalink
report
parent
reply
57 points

I wanted to try inserting and removing kernel modules, so I looked around and thought “well, I don’t have a USB stick in right now so I can safely try removing the usb kernel module.” So I did that, and after pressing enter I realized my keyboard is connected with USB.

permalink
report
reply
16 points

I was smug thinking “I haven’t done anything so silly as the people commenting in this thread”, then I came across this one. I’ve actually done this one, and it was earlier this year, and I’ve been using Linux since 2004, 20 years.

permalink
report
parent
reply
49 points
  1. have an nvidia GPU

  2. have Fedora

  3. download RPM package of drivers for Red Hat (after all, Fedora and Red Hat are… compatible, right?)

  4. Everything goes fine

  5. Six months later, upgrade to a new version of Fedora

  6. oops, kernel panic at boot after the upgrade, and no video to troubleshoot after UEFI boot

  7. figure out how to boot into a recovery partition from UEFI

  8. figure out how to enable a serial console over a USB device

  9. figure out how to connect to the serial console from another computer using another USB device

  10. figure out what the kernel panic is from (not the upgrade, but the driver which wasn’t upgraded)

  11. figure out how to uninstall the incorrectly installed driver

  12. figure out how to install the correct driver

That was a fun three week OS upgrade.

permalink
report
reply

I have a super-n00b question, and I apologize in advance, but, uh…yeah, what is a serial console?

permalink
report
parent
reply
9 points

Tl;dr: Stick in a USB cable and the other side gets your console.

permalink
report
parent
reply
9 points

You attach a secondary computer via serial (COM port) with your primary computer and then you can open a console on that one. You can access the primary computer as if you would be sitting in front of it.

permalink
report
parent
reply
5 points

You probably have to explain what Serial actually is.

permalink
report
parent
reply
3 points

https://en.wikipedia.org/wiki/Serial_port

Because there’s going to be kids around here who have never seen this port (other than maybe on a Point Of Sale (POS) system?)

permalink
report
parent
reply
5 points

Adding to what DmMacniel said, it’s a hardware interface, often accessed via a USB port (which after all, is the universal serial bus).

permalink
report
parent
reply
6 points

Christ you guys are making me feel old. I remember back in the day when a serial connection was made through an actual serial port. I know I have some serial cards around here somewhere. I have also used the tar command on an actual tape… Here’s a fun fact, if your tape drive (big reel to reel looking thing, not a cassette or other kind of ‘tape’) has an issue with rewinding, do not use your finger to manually spin the reel. Use a pencil. I finished reeling my tape back up once and realized I now had a blister on the end of my finger.

permalink
report
parent
reply
4 points

https://en.wikipedia.org/wiki/Serial_console

tl;dr:

Serial ports are (for example) commonly RS-232, although other types of ports exist. Imagine it to be a very slow Ethernet device. Because it’s so slow (and the technology predates Ethernet and also has different requirements), it’s usually attached directly to a device instead of to a network. But you could connect a modem to it and it becomes connected to a network device.

It could also be connected to a system console device. These are commonly called terminals. Such devices are often monochrome (especially older ones) because a serial connection is often bandwidth limited (eg, measured in kilobits per second instead of megabits or gigabits). Since it’s so slow, it’s not practical for video, so it’s generally just text-only.

Note that your GPU might also output a system console but rendered on your display at very high resolution and with graphics-drawing capabilities. So a system console would be any console that connects to the system.

What is a console? Well, Wikipedia presents several valid articles and the common theme as far as computers go is that a “console” is typically something that a human and a computer use to interact with each other.

For serial consoles, you might find device files for them at /dev/tty*. But for general serial devices, it could be any of several different types of device files.

Wikipedia’s article on /dev devices has a pretty decent listing of what kinds of devices you might find and several of them might be classified as a serial port. Any serial port might be connected to a serial console.

So in my case, a serial console is:

  1. 2x USB-to-RS-232 (USB is a serial protocol and is basically “just” another (Universal) (and perhaps high speed) Serial port (Bus), so conversion is super cheap)
  2. 1x RS-232 null modem cable

That’s pretty much it in a nutshell. Then

  1. System 1 (the failing system) UEFI boots into repair system partition on a separately attached disk (eg, boot from CD or live USB) to get a local system console
  2. System 1 repair system mounts the failing system partition
  3. System 1 modifies failing system grub configuration to enable a serial console on the attached USB-to-serial device file and saves changes, then unmounts failing system partition
  4. Power off System 1
  5. Remove repair partition device
  6. Open terminal window on System 2 (recovery system)
  7. Connect System 2 terminal to the attached USB-to-serial device file using screen (oh wow those were some old days)
  8. Power on System 1
  9. System 1 boot enters grub recovery menu which allows fixing the system remotely

To be fair, a lot of that complexity could have been done by either reinstalling, or removing the hard drive and attaching it to another computer. But doing it this way allowed me to poke around and try different ways of solving the issue, rebooting, etc. It was a learning experience worth exploring.

It was years ago though and I think there was some complication with trying to understand what device file (or device number or something) needed to be to work on the correct serial device (there are often multiple)

permalink
report
parent
reply

Wait, that’s a tl;dr to you? o_O

permalink
report
parent
reply
2 points

Why would you need a serial console? Live USB is a thing

permalink
report
parent
reply
44 points
*

I tried to install an OS to a USB stick. This is Kubuntu specific.

You need to create a GPT partition on the stick, then you should be able to just use the installer and install on another USB stick.

I went through it, selected the usb stick… was not sure if everything was right and went a menu back, was correct, went forth again, past the install target selection and installed.

Well… turns out the Kubuntu installer (Calamares) selects the first disk always. And that selection seems to reset to default when going a menu back…

I deleted my complete normal disk, with like everything I had.

No Backup no mercy. Luckily did one only a few weeks before. The first since half a year! Damn… had my uni stuff on Nextcloud, a lot of personal stuff synced to my phone with syncthing.

permalink
report
reply
1 point

I was gonna recommend kubuntu for a first time user, seems a bit of a hassle then doesn’t it?

permalink
report
parent
reply
2 points

I mean if you actually want to overwrite the main SSD this is okay. Calamares is very nice too.

Kubuntu stays on Plasma 5 forever so I highly recommend against it. There are many bugs that will not get fixed, the fixes are only in Plasma 6.

I recommend Fedora Kinoite. Use Flatpaks, layer the packages you dont need. Add rpmfusion and layer libavcodec-freeworld to get video playback working.

I broke all KDE distros, Kubuntu included. I wouldnt use anything other than Fedora Kinoite, nor want to maintain that mess. Have a look at my latest post for some explanations.

permalink
report
parent
reply
1 point

I thought kubuntu was fairly stable

permalink
report
parent
reply
43 points

rm *.c when I meant rm *.o

permalink
report
reply

Linux

!linux@lemmy.ml

Create post

From Wikipedia, the free encyclopedia

Linux is a family of open source Unix-like operating systems based on the Linux kernel, an operating system kernel first released on September 17, 1991 by Linus Torvalds. Linux is typically packaged in a Linux distribution (or distro for short).

Distributions include the Linux kernel and supporting system software and libraries, many of which are provided by the GNU Project. Many Linux distributions use the word “Linux” in their name, but the Free Software Foundation uses the name GNU/Linux to emphasize the importance of GNU software, causing some controversy.

Rules

  • Posts must be relevant to operating systems running the Linux kernel. GNU/Linux or otherwise.
  • No misinformation
  • No NSFW content
  • No hate speech, bigotry, etc

Related Communities

Community icon by Alpár-Etele Méder, licensed under CC BY 3.0

Community stats

  • 8.4K

    Monthly active users

  • 6.3K

    Posts

  • 172K

    Comments