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.

  • delirious_owl@discuss.online
    link
    fedilink
    arrow-up
    33
    ·
    edit-2
    28 days ago

    My control key was broken, but I found that when I used an app and held down the space bar key, the CPU would get abnormally hot.

    So I wrote an Emacs interrupt to interpret a rapid CPU rise as “press the control button”.

    Unfortunately the dev pushed an update that broke space bar heating, which broke my workflow. I opened a bug report about it, though…

  • cryoistalline@lemmy.ml
    link
    fedilink
    arrow-up
    23
    ·
    28 days ago

    I had to use unity game engine for one of my assignments for school, but unity wouldn’t generate files needed for the language server unless I set the code editor to vscode. I fixed this by creating a bash script with the path /usr/bin/code that opens neovim in konsole.

    #!/usr/bin/env bash
    konsole -e "nvim $@"
    
  • dosse91@lemmy.trippy.pizza
    link
    fedilink
    arrow-up
    15
    ·
    edit-2
    29 days ago

    I think this one beats them all.

    My home server keeps a few services up, including an instance of Jitsi Meet. The server runs nixos and the nixos package for jitsi is incomplete to say the least and doesn’t even support authentication, so I use the docker-compose version and I have a script that runs periodically to keep it updated. So far so good, right? Well, no.

    Because the server is at home, I have a dynamic external IP address, so I have to use a DDNS provider, but jitsi doesn’t expect this and uses a stun server at startup to determine the public IP of the server once, so if my connection goes down or is restarted and the IP changes, jitsi needs to be restarted or it won’t work anymore.

    The solution?

    • My router runs OpenWrt, so I am able to run a script that checks for external IP changes. When a change is detected, it uses SSH to connect to my server to restart jitsi
    • Because I don’t want the router to just be able to run any command, I created a jitsi-restart user that has no shell
    • When the router tries to log in with its pubkey, sshd creates a file called restartasap in the jitsi folder and closes the connection
    • On the server, there’s a systemd unit running a script as the jitsi user that periodically checks for that file, and if it exists it deletes it and restarts jitsi

    I’ve been running this setup since mid 2020 and I expect this to continue until IPv6 becomes the norm.

    • Norah - She/They@lemmy.blahaj.zone
      link
      fedilink
      English
      arrow-up
      1
      ·
      28 days ago

      why not just run the IP check script on the box jitsi is on? a quick google gave me this: dig +short myip.opendns.com @resolver1.opendns.com and this: wget -q -O - checkip.dyndns.org | sed -e 's/.\*Current IP Address: //' -e 's/<.\*$//'

      • dosse91@lemmy.trippy.pizza
        link
        fedilink
        arrow-up
        1
        ·
        28 days ago

        The jitsi user is a system user so it can’t login even if you set a key for it. Besides, I wouldn’t risk it anyway since that user is in the docker group, if it gets compromised somehow, the attacker would have very high privileges.

  • eldavi@lemmy.ml
    link
    fedilink
    arrow-up
    14
    ·
    29 days ago

    intel won’t allow its linux drivers to work above wifi 4 speeds in ap mode, so i created a kvm virtual windows machine with pci pass through on the wifi nic plus ip masquerade and now i’m getting wifi 6 speeds in ap mode.

      • eldavi@lemmy.ml
        link
        fedilink
        arrow-up
        2
        ·
        edit-2
        29 days ago

        it’s horrible in more ways that you would expect and what other solutions exist with intel wifi hardware in ap mode on linux?

      • eldavi@lemmy.ml
        link
        fedilink
        arrow-up
        1
        ·
        edit-2
        29 days ago

        it’s a pita every time something goes wrong; it works well most of the time, but it also REALLY sucks sometimes.

      • eldavi@lemmy.ml
        link
        fedilink
        arrow-up
        2
        ·
        edit-2
        29 days ago

        i wasn’t aware that you could use ndiswrapper on an access point; i’ll look into it.

        UPDATE: googles says that you can’t do this because ndiswrapper uses windows drivers that don’t support ap mode.

    • unexposedhazard@discuss.tchncs.de
      link
      fedilink
      arrow-up
      0
      ·
      29 days ago

      Lots of laptops just use a removable m.2 wifi card. Have you considered replacing it with something thats properly supported? I know hardware costs money but not that much probably.

      • eldavi@lemmy.ml
        link
        fedilink
        arrow-up
        1
        ·
        29 days ago

        It’s not a laptop; it’s a mini desktop that I obtained to serve as a wifi router; storage server; firewall; VPN; media server; remote file storage; and my cat’s favorite warm napping surface.

        the wifi nic is embedded on the motherboard and it was chosen since it included a high gain antenna; among other qualities.

        Wifi works fine if you use it in ordinary client mode w full Linux support and the hardware is capable of fully supporting ap mode in older Linux kernels; it’s just that Intel decided remove higher speed ap mode support in the latest versions of the driver to force people to buy thier more expensive wifi nics.

  • Ephera@lemmy.ml
    link
    fedilink
    arrow-up
    10
    ·
    29 days ago

    I like to use unclutter to hide my mouse pointer after a few seconds without being moved.

    Now, the thing is, it doesn’t just visually hide the cursor, it actually removes it, so UI elements triggered by hovering disappear. Sometimes that’s great, other times it’s infurriating, like when reading a tooltip or menu.

    I mostly use a touchpad, and so I developed a habit to wiggle my finger while I’m intentionally hovering something, so that there was enough mouse movement for unclutter to not remove my pointer.

    Then I found a setting for the jitter threshold of the touchpad. Basically, with the threshold on, it ignores tiny movements, because the hardware reports finger wiggling, even if you hold your finger perfectly still. Which is perfect for me to turn off.

    Now when I have my finger on the touchpad, it automatically wiggles and allows me to read hover elements. If I take my finger off, it stops wiggling and removes the cursor.
    It’s almost like someone designed an OS with touchpads in mind, rather than them being an afterthought.

  • bodaciousFern@lemmy.dbzer0.com
    link
    fedilink
    arrow-up
    10
    ·
    edit-2
    28 days ago

    I’m using Gentoo with systemd and a customized kernel, and additionally I have the /usr partition LUKS encrypted. Because /usr is absolutely essential for systemd to function, I configured dracut to make a specially crafted initrd which activates the luks lvm and prompts for the password to decrypt and mount /usr on startup before systemd init tries to run.

    About a year or two ago, some update to dracut or some other dependency (assumption) caused the dracut generated initrd’s to kernel panic. After multiple days of troubleshooting, I discovered that just copying forward an older initrd in /boot and naming it to match the new kernel, e.g. initramfs-6.6.38-gentoo.img , allows the system to boot normally .

    So, my Gentoo is booting a kernel 6.6.something with a ramdisk generated in the 5.9 kernel era. I am dreading the day when this behavior breaks and I can no longer update my kernel 😳

  • UNY0N@lemmy.world
    link
    fedilink
    arrow-up
    8
    ·
    29 days 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
        3
        ·
        29 days 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.

  • demesisx@infosec.pub
    link
    fedilink
    English
    arrow-up
    8
    ·
    29 days ago

    You guys will probably groan but lots of people in this comment section should look into NixOS. My old Ubuntu machine was loaded with hacks I got from stack overflow to get certain things working (a script that runs at boot and shutdown to mount and unmount some network drives I wanted to appear natively). But now, I just use NixOS and there’s nothing on my machines that is even remotely hackey now. I just declare the drives as I want them and when I boot they are there and work as needed.

    • Willdrick@lemmy.world
      link
      fedilink
      arrow-up
      1
      ·
      28 days ago

      Knowing myself, I shiver at the idea of my nix config… It’ll probably have more ductape than a 3M distribution center

  • I_like_cats@lemmy.one
    link
    fedilink
    arrow-up
    9
    arrow-down
    1
    ·
    29 days 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
      5
      ·
      29 days 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
      3
      ·
      29 days 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!

  • woelkchen@lemmy.world
    link
    fedilink
    arrow-up
    8
    ·
    28 days ago

    An old (now decommissioned) notebook of mine had a broken headphone jack. I didn’t have BT headphones then. Audio output worked technically but the detection whether headphones were plugged in or not did no longer work.

    I wrote a very short amixer script to force unmute the jack, set the volume to 50 or so percent and set the speaker volume to 0% but not “mute” state. I could then use my wired headphones again.

  • cizra@lemm.ee
    link
    fedilink
    arrow-up
    7
    ·
    edit-2
    29 days ago

    BZ2-ing up a terabyte of zeroes (back when a TB was more than people commonly had, then zipping that file up together with another file, to bypass virus scanners in emails that prevent emailing .exe files.

    I’ve also seen a self-referential .zip file somewhere that contains itself.

  • umbrella@lemmy.ml
    link
    fedilink
    arrow-up
    6
    ·
    28 days ago

    holy shit i was about to post about how i have automatic login and lock to start a program that refuses to work correctly on boot through systemd.

    but then you guys are here casually posting some of the worst duct tape shit ive heard of so far. im not sure if i should reprimand or congratulate you for that jankiness.

  • RogueBanana@lemmy.zip
    link
    fedilink
    English
    arrow-up
    6
    ·
    28 days ago

    I used to have a bug with my KVM switch muting my audio devices when I switch. Tried so many things but ended up running a login script that continuously runs unmute command on loop every 100ms.

    • rien333@lemmy.ml
      link
      fedilink
      arrow-up
      1
      ·
      27 days ago

      can’t you just trigger a script after some udev event? Your battery would be happg

      • RogueBanana@lemmy.zip
        link
        fedilink
        English
        arrow-up
        1
        ·
        27 days ago

        That was when I first switched to Linux so safe to say I did my best lol. A correction, the issue happened when I used the switch in my Bluetooth keyboard which connects to 3 devices but was working fine using a dedicated KVM switch with WiFi dongle. Maybe I should check again if its still a thing as its been almost an year now.

  • Communist@lemmy.frozeninferno.xyz
    link
    fedilink
    arrow-up
    6
    ·
    edit-2
    28 days ago
    bindntr=CTRL,C,exec,hyprctl dispatch closewindow alacrittyclipboard & hyprctl activewindow | rg -q "class: Wfica" && alacritty -qq --config-file ~/.config/alacritty/alacrittyclipboard.toml --class 'alacrittyclipboard' --title 'Office365 Desktop - Nexus (SSL/TLS Secured, 256 bit)' -e sh -c 'sleep .03 && xclip -o | wl-copy ; wl-paste | xclip -i'
    windowrulev2 = float,class:(alacrittyclipboard)
    windowrulev2 = stayfocused,class:(alacrittyclipboard)
    windowrulev2 = noborder,class:(alacrittyclipboard)
    windowrulev2 = noanim,class:(alacrittyclipboard)
    windowrulev2 = noblur,class:(alacrittyclipboard)
    windowrulev2 = opacity 0,class:(alacrittyclipboard)
    windowrulev2 = maxsize 1 1,class:(alacrittyclipboard)
    
    

    Fixes the fucking clipboard in citrix, no, I cannot figure out a better solution.

    the move to aquamarine with hyprland mostly resolved this… but not completely and i’m going to have to write a new duct tape solution for that.

    If you’re wondering why I launch alacritty… it doesn’t work without alacritty, wayland needs the window to be in focus, if alacritty isn’t there there’s no in focus window and it doesn’t update the clipboard.

  • ditty@lemm.ee
    link
    fedilink
    English
    arrow-up
    5
    ·
    28 days ago

    I had an external hard drive enclosure that I stored my Plex content on before I built a nas, and the enclosure would go to sleep after 15 minutes and take the drives offline. So i had a cron script write a 1 kb file to each drive every 14 minutes. Worked well enough