• 0 Posts
  • 47 Comments
Joined 1 year ago
cake
Cake day: July 20th, 2023

help-circle

  • 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)



    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.


  • OTA TV: with ads

    OTA TV: if you record you are pirating

    Cable TV: you pay a fortune to have no ads!

    Cable TV: now with extra premium stuff!

    Cable TV: now with ads!

    Cable TV: if you record, you’ll be prosecuted

    Cable TV: pray we do not alter the deal further

    Cable TV: why is everyone moving away from Cable TV?

    Youtube: your own videos!

    Youtube: your own videos are actually ours

    Youtube: our videos with ads!

    Youtube: now pay a fortune to remove ads!

    Youtube: pray we do not alter the deal further

    Youtube: if you download or remove ads you’ll be banned

    This isn’t the pattern you’re looking for. Move along.




  • I have had to un-teach dumb things that people learn from Windows.

    A menu item to run a GUI program as root it is indeed a rather absurd scenario. It suggests that you want to violate the admin/user barrier which is intended to be difficult to surpass except in certain circumstances.

    There can be a lot of things under the hood that are necessary to run a GUI program as root depending on whether you’re using X11 or Wayland or something more esoteric. It’s doable though.

    But instead of doing that, why not just learn how to use the command line? Every administrative task can be done via the command line, but not every administrative task has a GUI counterpart. So you’re going to need to learn to use the command line sooner or later.


  • inetknght@lemmy.mltoLinux@lemmy.mlXZ backdoor in a nutshell
    link
    fedilink
    arrow-up
    18
    arrow-down
    1
    ·
    8 months ago

    and would not include it in the main repo

    Tests that verify behavior at run time belong elsewhere

    The test blobs belong in whatever repository they’re used.

    It’s comically dumb to think that a repository won’t include tests. So binary blobs like this absolutely do belong in the repository.



  • Disabling a systemd service won’t prevent it from starting. For example, if another service depends on it then it will start anyway.

    You have to mask the service which redirects the service files to /dev/null so that the service effectively has zero directives.

    systemctl mask --now snapd

    It also means that anything which depends on snapd will likely fail. That is absolutely an improvement since we obviously don’t want anything that depends on snaps.



  • I was running Fedora. Something like 27 or so. I needed drivers. I don’t remember if it was AMD or Nvidia, but they were only available on RedHat.

    So I downloaded the RedHat drivers for the GPU and forced it to install. It worked! It was great.

    Then when I updated the distro to the next release… everything failed. It was dropping into grub, but no video was output. Ooof.

    So I ended up enabling a terminal console and connecting to it via a serial port to debug. I had to completely uninstall that RPM and I was never happy that it was properly gone. So a few months later I ended up reinstalling the whole OS.

    On the plus side, I learned a lot about grub and serial consoles. Worth it.





  • make -j will create unlimited jobs. If you have very few CPU cores you will likely overload your CPU with tens or hundreds (or maybe even thousands) of compilation jobs.

    Each one of those jobs will need RAM. If you eat up all of your RAM then your computer will hit swap and become unusable for hours (at best) or days. I’ve had a computer chug along for weeks in swap like that before OOMkiller decided to do things. And the worst part is the Out-Of-Memory killer decided to kill all the wrong things…

    The -j argument has an optional additional argument. The additional argument is the limit to the number of jobs. The best thing you can do is (roughly) use make -j$(nproc). That will give the number of processors as an optional argument to -j. If your build line gets parsed (as is common in an IDE) then you might replace “$(nproc)” with a hard number. So if you have 20 cores in your CPU then you might do -j20. If you only have 8GB of RAM with your 20 cores then maybe you give it -j8. I saw one guy try to get fancy with math to divide up CPU and RAM and … it was just way more complicated to get at the same number as nproc :)

    I, personally, just buy more RAM. Then with my 20 cores and 64GB of RAM, there’s plenty of headroom for compilation in the background for each one core and also room in RAM for a browser for documentation and IDE for all the editing. Developer machines are known for being resource hogs. Might as well lean in to that stereotype just a tiny bit.

    And one tiny edit: I highly suggest you start to read the manual. man make will tell you all about how -j works :) and man nproc and there’s tons of others too. I love git’s manual pages, they’re pretty awesome.

    man make tells:

       -j [jobs], --jobs[=jobs]
           Specifies the number of jobs (commands) to run simultaneously.  If there is more than one -j option, the last one is effective.  If the -j option is given without an argument, make will not limit the number of jobs that can run simultaneously.
    

  • Give it time. Cell phones are getting more powerful every day.

    As for misinformed… sure it’s possible. But I doubt it. Llama isn’t chat gpt but it runs pretty well on my machine. Is it perfect? No, of course not. Neither is ChatGPT. But it’s “good enough” for what I need it for, and it certainly could be “good enough” for many other users.

    What’s the gain of a LLM for a virus? Well that… is a little more esoteric. It’s about as esoteric as encrypting hard drives. Crypto malware isn’t always a virus either. Imagine a LLM in a virus used to determine if a given file’s content is worth extracting from the device. I haven’t yet figured out all of the side ventures but I can see a use for it.