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.

  • eldavi@lemmy.ml
    link
    fedilink
    arrow-up
    49
    ·
    26 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
        9
        ·
        edit-2
        26 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
        11
        ·
        edit-2
        26 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.

  • I_like_cats@lemmy.one
    link
    fedilink
    arrow-up
    34
    ·
    26 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

    • averyminya@beehaw.org
      link
      fedilink
      arrow-up
      1
      ·
      26 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!

    • capital@lemmy.world
      link
      fedilink
      arrow-up
      1
      ·
      26 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.

  • delirious_owl@discuss.online
    link
    fedilink
    arrow-up
    8
    ·
    edit-2
    25 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…

  • itslilith@lemmy.blahaj.zone
    link
    fedilink
    arrow-up
    6
    ·
    25 days ago

    For me it’s probably the way I self-host overleaf, a online LaTeX editor. The community version has a docker image that’s horribly maintained (because they want to sell enterprise, I reckon), and instead relies on a horrendous amalgamation of setup scripts that wrap docker compose.

    What I have is a Dockerfile that pulls the image, manually installs a second version of TeX with the right dependencies, unlinks the old one and links the second one. Then for the database, it uses Mongo replsets, which be to be manually initialized. So I wrote a health check for the container that checks if the repl set is initialized, and if that fails the health check initializes it.

    It’s horrendous, it’s disgusting, and it’s an all-in-one compose file to get overleaf running. Good enough.

  • mycodesucks@lemmy.world
    link
    fedilink
    arrow-up
    5
    ·
    26 days 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.

  • Drusenija@lemmy.world
    link
    fedilink
    arrow-up
    5
    ·
    26 days ago

    I created an SMS to Email gateway back in 2011 when data was still expensive on phones and I was trying to see if I could turn an iPod Touch into an iPhone. (I was a poor student at the time, was trying to find ways to save money 😅)

    Basically I had a 3G modem plugged into a Linux server that could receive the messages, a prepaid SIM card with a long life credit expiry, a domain name set up with unknown email address capturing, and some tools to handle the actual SMS part.

    At the time I published the scripts I used online and apparently they’re still online 😅 This is on Whirlpool which is an Australian telecommunications forum.

    https://whrl.pl/RcXD5e

  • communism@lemmy.ml
    link
    fedilink
    arrow-up
    5
    ·
    edit-2
    26 days 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

  • DeltaWingDragon@sh.itjust.works
    link
    fedilink
    arrow-up
    4
    ·
    22 days ago

    Here’s a few of the micro-hacks that I’ve hacked up in the past.

    A 2-line script to chroot into Debian when logging in as a certain user on FreeBSD.
    #!/bin/sh  
    
    clear  
    doas chroot /linux /bin/login
    
    I didn't have an IDE, so I just made a script called ide which runs Vim, and then compiles the code and makes it executable.
    #!/bin/sh
    #Works only for C
    vim $1.c && cc -O3 -Wall -Werror -Wno-unused-result $1.c -o $1
    #MODE=`stat -f "%OLp" $1`
    if ("stat -f "%OLp" $1 | grep -e 6 -e 4 -e 2") then
    	chmod +x $1
    fi
    
    This thing, called demoronize, which does what it says in the comments
    #!/bin/sh
    
    #dos2unix -O -e -s $1 | sed 's/    /	/g' | sed 's/“/"/g' | sed 's/”/"/g'
    cat $1 | sed 's/    /	/g' | sed 's/“/"/g' | sed 's/”/"/g'
    #Convert DOS line endings to Unix ones and add a final newline if there isn't one,
    #replace sequence of 4 spaces with tab,
    #and replace "smart" quotes with normal ones
    

    I just keep those ones for historical value, but there’s one hack I use every day. My keyboard doesn’t have a function key (Fn), so I use the Super/Windows key instead.
    I have xdotool keyup Super_L keyup Super_R keyup F4 key XF86Sleep bound to a custom keyboard shortcut. It unpresses the keys used for the shortcut (Super + F4), then presses the sleep key.

  • chameleon@fedia.io
    link
    fedilink
    arrow-up
    4
    ·
    26 days 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.

  • NauticalNoodle@lemmy.ml
    link
    fedilink
    arrow-up
    4
    ·
    edit-2
    26 days ago

    I have a hardware malfunction with my secondary hard drive. Every once in the while it locks itself into read-only mode and corrupts a log file that crashes my system. My solution is to reboot Fn + Alt + Sysrq + ‘b’ and periodically delete the log files that exacerbate the issue. I need to replace the drive but that requires money and a backup solution, neither of which i currently have. It’s been an ongoing issue for at least 4 years now.

  • OmegaLemmy@discuss.online
    link
    fedilink
    arrow-up
    3
    ·
    20 days ago

    I made a script to add a middle click scroll function with a toggle. I can share the script, it’s a really bash script

  • cryoistalline@lemmy.ml
    link
    fedilink
    arrow-up
    3
    ·
    25 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 $@"
    
  • Kazumara@discuss.tchncs.de
    link
    fedilink
    arrow-up
    3
    ·
    25 days ago

    I wrote a script to turn the power of the the Wifi+Bluetooth chip off, then enumerate the PCIe bus again to start it back up.

    The chip sometimes hung itself when using both. I looked for the bug and even found an Intel engineer on some mailing list admitting that they had issues with coexistance mode.

    Just turning the wireless off and back on wasn’t enough I needed to reeinitialize the hardware and that was the best way I knew.