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
    10511 months 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
        2
        edit-2
        11 months ago

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

    • Avid Amoeba
      link
      fedilink
      2311 months ago

      I think NDISwrapper is still maintained for issues like this.

      • @eldavi@lemmy.ml
        link
        fedilink
        15
        edit-2
        11 months 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.

    • 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
        1211 months 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.

  • @NauticalNoodle@lemmy.ml
    link
    fedilink
    8
    edit-2
    10 months 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.

    • @sploosh@lemmy.world
      link
      fedilink
      310 months ago

      Just write a script that runs periodically to check the log’s size and delete when its near the crash threahold.

  • @Aceticon@lemmy.world
    link
    fedilink
    1110 months ago

    I got an Orange Pi 5 Plus to play with smallish AIs (because it has an NPU) and I normally access it remotely, so I have to know its IP address to do it.

    In order to easilly know the IP address of it, I’ve wired a little 128x64 monochrome OLED screen to it (Orange PIs, like Raspberry PIs have a pin connector giving access to GPIO and interfaces like I2C, Serial and SPI) which talks via I2C.

    Turns out those interfactes aren’t active in Linux by default (I.e. no /dev/i2c-x), so I figured out that I had to add a kernel overlay to activate that specific interface (unlike with the Raspberry PI whose Linux version has a neat program for doing it, in the Orange Pi you have to know how the low level details of activating those things), which I did.

    To actually render characters on that screen I went with an ARM Linux port of a graphics library for those screens I used before with Arduino, called u8g2)

    Then I made a program in C that just scans all network interfaces and prints their names and IP addresses on that screen, and installed it as a Cron job running once a minute.

    Now, as it turns out when you shutdown your Linux on that board, if you don’t disconnect it from power there is actually still power flowing through the pin connector to any devices you wire there, so after shutdown my screen would remain ON and showing the last thing I had put there, but because the OS was down it would naturally not get updated.

    So the last thing I did was another small C program which just sends to that screen the command for it to go into power saving mode, shutting it down. This program was then installed as a Systemd Service to run when Linux is shutting down.

    The result is now that there is a little screen hanging from the box were I put this board with Linux which lists its IP addresses and the info is updated if it connects other interfaces or reconnects and gets a new IP address. Curiously I’ve actually been using that feature because it’s genuinely useful, not just a funny little project.

    • @flux@lemmy.ml
      link
      fedilink
      110 months ago

      Maybe consider static ip assignment in your DHCP server (e.g. internet router) if at all possible… Then you can add a name to it to /etc/hosts.

      Alternatively you could use Avahi to provide mdns names to your local network

  • @communism@lemmy.ml
    link
    fedilink
    13
    edit-2
    11 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

  • @Drusenija@lemmy.world
    link
    fedilink
    1010 months 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

  • data1701d (He/Him)
    link
    fedilink
    English
    1011 months ago

    Building a custom Buildroot Linux for a Pentium 2 laptop that can fit on a CD so I could back up a 2.5" IDE drive to a USB drive, probably.

    On another note, last night, I had to get a Google TV set up on my dorm Wi-Fi, which requires me to either go through a portal to set it up or to go into my account and add the device’s MAC address. The TV (which was brand new and doing OOBE stuff) wouldn’t let me go to settings to get the MAC address without a network connection. Even more infuriating, there was a button in the Google Home app that said “Show MAC address”, but when I pushed it, it would say “Can’t get MAC address.” What I ended up doing to get around that crap was setting up my Debian Thinkpad (which I am writing from now) to share its internet connection over ethernet to finish the setup process so I could get to settings and get the MAC address.

    On one hand, a funny experience, but on the other hand, I’m simultaneously both mad at Google and my dorm internet provider.

    • @ReveredOxygen@sh.itjust.works
      link
      fedilink
      English
      311 months ago

      The Pixel watch has this problem too. However, it randomizes the MAC per network, so that strategy won’t even work. I’ve tried to get it from the debug log but failed I’ve resigned that it won’t be getting connected to the school network

  • Eager Eagle
    link
    fedilink
    English
    8
    edit-2
    11 months ago

    I keep a small local knowledge base with common fixes for problems I find recurrently (over and over again in some cases).

    It has a bit over 1,300 lines of markdown files split by category of problem. It saves me the trouble of finding that exact solution in stack overflow that fixed this exact problem 5 months ago.

    • @barsquid@lemmy.world
      link
      fedilink
      210 months ago

      I do this also except I need to get in the habit of documenting every single problem instead of just recurring ones. I should start using one of those local server shell history databases, too.

  • @rotopenguin@infosec.pub
    link
    fedilink
    English
    911 months ago

    I made a systemd script that fires when going to / waking up from sleep - it checks how long the sleep was and if it was just a few seconds, it puts the computer back to sleep.

    In hindsight, I think the thing that made it work was bluetooth was somehow responsible for the initial failed suspend. The second shot at sleep happened before bluetooth came back up, so it succeeded.

  • @Willdrick@lemmy.world
    link
    fedilink
    811 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
      link
      fedilink
      211 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
        210 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

        • DarkSirrush
          link
          fedilink
          110 months ago

          Ah, didn’t know it worked differently for spdif, never had anything nice enough to use it.

  • @prime_number_314159@lemmy.world
    link
    fedilink
    1611 months ago

    I ran out of crtcs, but I wanted another monitor. I widened a virtual display, and drew the left portion of it on one monitor, like regular. Then I had a crown job that would copy chunks of it into the frame buffer of a USB to DVI-d adapter. It could do 5 fps redrawing the whole screen, but I chose things to put there where it wouldn’t matter too much. The only painful thing was arranging the windows on that monitor, with the mouse updating very infrequently, and routinely being drawn 2 or more places in the frame buffer.

  • @pastermil@sh.itjust.works
    link
    fedilink
    1011 months ago

    Not me personally, but in one of my past project, my boss was running a bunch of “services” by leaving it on GNU screen terminal sessions and detaching from them.

    Everytime I went in to debug something, I’d need to go thru a list of sessions, attach to one hoping that it’s the right one (sometimes they’d name 'em), then see the console output.

  • @macattack@lemmy.world
    link
    fedilink
    8
    edit-2
    11 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
      link
      fedilink
      English
      4
      edit-2
      11 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'
      
  • @allywilson@lemmy.ml
    link
    fedilink
    910 months ago

    I had to upgrade some OL6 VMs to OL7 VMs running Oracle DBs and Apps (on OVMM no less). There was no appetite for buying additional storage, or restoring the environments with RMAN. Luckily, everything had been installed under /u01 which was on its own virtual disk.

    So I built a new VM as OL7 (same hostname, etc.), installed the pre-req RPMs for Oracle DB, disconnected the virtual disk from the OL6 and attached it to the new OL7, synced users and home dirs - and it only bloody worked.

  • @cm0002@lemmy.world
    link
    fedilink
    911 months ago

    Well it was more like a temporary duct tape, but I “installed” a copy of Ubuntu in RAM from the running Ubuntu system so that I could “boot” (pivot_root) into it without restarting it

    All because I didn’t want to wait on a ticket for my dedicated server provider to hook in a KVM LOL

    (See my meme post I posted to c/linuxmemes a few weeks back for more info)

  • @woelkchen@lemmy.world
    link
    fedilink
    1610 months 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.