tell me the most ass over backward shit you do to keep your system chugging?
here’s mine:
sway struggles with my dual monitors, when my screen powers off and back on it causes sway to crash.
system service ‘switch-to-tty1.service’

[Unit]
Description=Switch to tty1 on resume
After=suspend.target

[Service]
Type=simple
ExecStart=/usr/local/bin/switch-to-tty1.sh

[Install]
WantedBy=suspend.target

‘switch-to-tty1.service’ executes ‘/usr/local/bin/switch-to-tty1.sh’ and send user to tty1

#!/bin/bash
# Switch to tty1
chvt 1

.bashrc login from tty1 then kicks user to tty2 and logs out tty1.

if [[ "$(tty)" == "/dev/tty1" ]]; then
    chvt 2
    logout
fi

also tty2 is blocked from keyboard inputs (Alt+Ctrl+F2) so its a somewhat secure lock-screen which on sway lock-screen aren’t great.

  • Trainguyrom@reddthat.com
    link
    fedilink
    English
    arrow-up
    0
    ·
    7 months ago

    About a decade ago I was playing a game on Linux and the game crashed and took the entire DE with it. So I went to a different tty and started a fresh x desktop session and started playing again until the game crashed again (I was running a bunch of mods so it would crash every couple of hours or so) and still didn’t feel like rebooting so I went to yet another tty and started yet another x desktop session. I did this about 3 times in total before I finally went “I should probably actually reboot because this has to be making a bigger mess of things”

  • Shadow@lemmy.ca
    link
    fedilink
    arrow-up
    0
    ·
    8 months ago

    Had a zfs array on an adaptec raid card. On reboot the partition table would get trashed and block the zfs pool from coming up, but running fdisk against the disk would recover it from the backup.

    Had a script to run on reboot that just ran “fdisk -l” on every disk, then brought up the zfs pool. Worked great for years until I finally did a kernel upgrade that resolved it.

  • macattack@lemmy.world
    link
    fedilink
    arrow-up
    0
    ·
    edit-2
    8 months ago

    Prior to switching (upgrading?) to Wayland, Debian KDE crashed under X11 regularly when waking from hibernation and the taskbar would disappear. Restarting the plasma shell made it operable again, so I created an alias and regularly rebooted the DE shell 2-3x a day:

    alias damnTaskbar='killall plasmashell ; kstart plasmashell &'

    • Eager Eagle@lemmy.world
      link
      fedilink
      English
      arrow-up
      0
      ·
      edit-2
      8 months ago

      I still occasionally need to use one of these two

      # for plasma desktop
      alias kplasma='plasmashell --replace & disown'
      
      # when kwin crashes or acts weird
      alias kbug='if [ "${XDG_SESSION_TYPE}" = "x11" ]; then kwin_x11 --replace & disown; else kwin_wayland --replace & disown; fi'
      
  • xp19375@sh.itjust.works
    link
    fedilink
    arrow-up
    0
    ·
    8 months ago

    sssd didn’t work well with my company’s AD server, which would cause repeated authentication failures until I restarted sssd. I rigged up a bash script which would restart sssd any time xscreensaver logged an auth fail.

  • TimeSquirrel@kbin.melroy.org
    link
    fedilink
    arrow-up
    0
    ·
    8 months ago

    I’ve set Raspberry Pis to auto-reboot themselves at night if they are being used for headless network services that need to be available 24/7, just to clear out memory leaks or other things that may have gotten locked up. Not sure if that’s duct tape or just a standard practice. They aren’t the most stable things sometimes. They’re known for power supply and SD card issues.

    • leisesprecher@feddit.org
      link
      fedilink
      arrow-up
      0
      ·
      8 months ago

      I did this with my sensors running in Pi picos.

      There was some wonkyness with some of the electrical stuff and since I have no idea how to debug that, I just restarted them every 24 hours and at start “drained” all pins by repeatedly reading from them.

      I’m reasonably sure, this setup is cursed enough to kill an electrical engineer on sight, but it kind of works good-ish enough.

  • UNY0N@lemmy.world
    link
    fedilink
    arrow-up
    0
    ·
    8 months ago

    This certainly isn’t of the same caliber as some of these other comments, but I found it to be fitting to the topic.

    Last year I was having problems getting the game stellaris working on arch. (I use bazzite now, btw) My solution was the following:

    1. download the game via steam.
    2. switch it to use proton
    3. switch it back to linux version
    4. use the terminal to make the entire game folder read-only, so that steam couldn’t touch the game anymore and screw it up.
    5. add the exicutable to PATH
    6. start the game via terminal

    If any one of those step was left out, it didn’t work. I’m no linux expert, so I didn’t have the skills to actuality find the real problem.

      • UNY0N@lemmy.world
        link
        fedilink
        arrow-up
        0
        ·
        8 months ago

        Blind trial and error, mostly. Making the game folder read-only was the real “duct-tape” part, it occued to me to do that after steam kept “updating” the game and breaking my solution.

  • I_like_cats@lemmy.one
    link
    fedilink
    arrow-up
    0
    ·
    8 months ago

    My mother uses some software that runs in the browser for her shop. It can print out receipts and scan items. To do these things it has a small “sattelite” application that runs on the system and interacts with the printer and scanner. This software only runs on Windows and Linux doesn’t have drivers for the scanner.

    When I switched her over to Linux and found this out in the process I wanted to stop, give up and install windows.

    But then I had a stupid idea. I could run the sattelite program in a Windows VM and pass through the USB devices for receipt printer and scanner. The webapp uses requests to localhost:9998 to communicate with the sattelite so I set up a apache server that proxies these requests into the VM. I also prevented the VM from acessing the Interner so Windows doesn’t update and screw everything up.

    And it works. It has been in use for a week now and I’ve heard no complaints. I’m just praying to god it doesn’t break

    • capital@lemmy.world
      link
      fedilink
      arrow-up
      0
      ·
      8 months ago

      At least getting a snapshot of the Windows VM should be simple. And since it doesn’t connect to the internet and doesn’t update, restore should be quick and relatively easy.

    • averyminya@beehaw.org
      link
      fedilink
      arrow-up
      0
      ·
      8 months ago

      Create a script to send important data records (if you need that for taxes or inventory data etc) as a nightly routine, that way you have a consistent database for any important records.

      Then just create a restore point. If it breaks in 2 weeks, then you just relaunch it and know that it’s going to kill itself in 2 weeks. A simple restart to that restore point solves everything.

      Sounds 100% functional to me!

  • Random Dent@lemmy.ml
    link
    fedilink
    English
    arrow-up
    0
    ·
    edit-2
    8 months ago

    I have a folder full of scripts tied to aliases that fix various things when they go wonky, and I’ve long since forgotten what any of them do. I just know if xxx app stops working, I type fix_xxx into the terminal and then it does a bunch of stuff and then it works again lol.

    Also I have a bunch of aliases tied to common tasks, like e1 = reboot, e2 = shutdown etc. I have no idea where that habit came from.

    Edit: ALSO, just the general mish-mash of apps. I won’t have anything to do with Snaps, but the rest of it is an unholy combination of native apps, things from the AUR, flatpaks, Appimages, Docker containers and wine setups, mostly (but not all) in Bottles.

      • Random Dent@lemmy.ml
        link
        fedilink
        English
        arrow-up
        0
        ·
        8 months ago

        I’m not even sure what that would do! Presumably list every time the word alias appears in every file across the whole home directory or something like that?

          • Random Dent@lemmy.ml
            link
            fedilink
            English
            arrow-up
            0
            ·
            edit-2
            8 months ago

            Alright, I’m gonna try it and see how long this takes!

            edit: about 8 minutes. Not as spectacular as I’d hoped lol

            • MonkderVierte@lemmy.ml
              link
              fedilink
              arrow-up
              0
              ·
              edit-2
              8 months ago

              If you have games there, yeah. Ripgrep is way faster. But grep is good enough in most cases.

              Btw, did you find your aliases?

              • Random Dent@lemmy.ml
                link
                fedilink
                English
                arrow-up
                0
                ·
                8 months ago

                I did! I know where they are and which scripts they point to, but as for going into the scripts and trying to remember what they’re actually doing… I’ll get to it some day lol

  • Willdrick@lemmy.world
    link
    fedilink
    arrow-up
    0
    ·
    8 months ago

    Got fed up of Pipewire suspending (old receiver takes ~2 sec to work again after spdif stream is cut) that now I auto-run aplay to play a silent .wav on loop

    • DarkSirrush@lemmy.ca
      link
      fedilink
      arrow-up
      0
      ·
      8 months ago

      But there is a setting to disable that? I don’t remember where I found it because I don’t remember where to find any settings, but you can definitely disable automatic shut off of audio devices.

      • Willdrick@lemmy.world
        link
        fedilink
        arrow-up
        0
        ·
        8 months ago

        Yes, you kinda can disable suspend, but it will still cut off spdif transmission even then. Normally that wouldn’t be an issue but my receiver is super old and takes its sweet time to start actually playing audio after it gets a signal

  • MajorHavoc@programming.dev
    link
    fedilink
    arrow-up
    0
    ·
    edit-2
    8 months ago

    I regularly recommend configurations to peers that are arguably impossible for normal humans. (Not on purpose! Sorry Dave!)

    I love to run stuff on Raspberry Pi, and I fear no gcc compile flag. (Ok. That’s a bold faced lie, even I fear a couple of them.) So I frequently forget the bullshit I had to do to get something weird running on a random Pi.

  • chameleon@fedia.io
    link
    fedilink
    arrow-up
    0
    ·
    8 months ago

    Did a physical-to-virtual-to-physical conversion to upgrade and unbreak a webserver that had been messed up by simultaneously installing packages from Debian and Ubuntu.

  • communism@lemmy.ml
    link
    fedilink
    arrow-up
    0
    ·
    edit-2
    8 months ago

    Youtube doesn’t seem to inhibit idle for me for some reason, so my screen would always turn off with swayidle while watching youtube videos. So I made my lockscreen script (which is called by swayidle)

    if [ "$(playerctl status)" = "Playing" ]; then
        exit 0
    else
        exec "/path/to/lockscreen/script"
    fi
    

    (lockscreen script was just swaylock called with a bunch of arguments)

    Not super crazy compared to some of the things people are saying in the comments, but also definitely not how you’re meant to handle idle inhibition when media is playing lol

    • iiGxC@slrpnk.net
      link
      fedilink
      arrow-up
      0
      ·
      8 months ago

      Hey that’s pretty good, I’m gonna steal it. It might even be worth making a pullrequest to update swaylock to have a flag to do this, I use waybar and it has a lock inhibit button that I use before I start watching anything, but automating it like this is seems super nice

  • everett@lemmy.ml
    link
    fedilink
    arrow-up
    0
    ·
    8 months ago

    Possibly my light/dark mode scripts. They change my Plasma theme, which is honestly most of the job, but also set the matching GTK theme, set the new theme in running Konsole sessions, do a bunch of manual sed edits on conf files for applications that don’t follow system theming, finally restarting plasmashell to clean up the occasional edge case where a tray icon is supposed to follow the theme but doesn’t.

    • iiGxC@slrpnk.net
      link
      fedilink
      arrow-up
      0
      ·
      8 months ago

      Oh yeah I do this, I’ll raise you that mine also sshs into my server to update the editor theme

  • mycodesucks@lemmy.world
    link
    fedilink
    arrow-up
    0
    ·
    8 months ago

    My Nvidia card won’t properly resume the display after suspend with the default suspend script, but if I correct the script file, every time aptitude updates the nvidia drivers, it restores the bad version of the configuration file. If you set the file immutable with chattr, aptitude throws a fit and goes into a broken state when it can’t overwrite the file on a driver update.

    So I keep a good copy of the script file in the directory, and in my pre-suspend script file I overwrite the main suspend script with the good version. Every single time.