this post was submitted on 21 Aug 2024
279 points (98.3% liked)

Linux

48758 readers
1209 users here now

From Wikipedia, the free encyclopedia

Linux is a family of open source Unix-like operating systems based on the Linux kernel, an operating system kernel first released on September 17, 1991 by Linus Torvalds. Linux is typically packaged in a Linux distribution (or distro for short).

Distributions include the Linux kernel and supporting system software and libraries, many of which are provided by the GNU Project. Many Linux distributions use the word "Linux" in their name, but the Free Software Foundation uses the name GNU/Linux to emphasize the importance of GNU software, causing some controversy.

Rules

Related Communities

Community icon by Alpár-Etele Méder, licensed under CC BY 3.0

founded 5 years ago
MODERATORS
 

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.

(page 3) 50 comments
sorted by: hot top controversial new old
[–] [email protected] 21 points 4 months ago* (last edited 4 months ago) (1 children)

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.

load more comments (1 replies)
[–] [email protected] 19 points 4 months ago

On my previous laptop, the trackpad had a bug that made it spam interrupts after waking up from sleep. It ruined battery life and basically kept one core at 100% permanently.

So I duct-taped a systemd script that unbound and bound the trackpad after each wake up.

#!/bin/sh
case "$1" in
        post)
                echo -n "i2c_designware.0" > /sys/bus/platform/drivers/i2c_designware/unbind
                echo -n "i2c_designware.0" > /sys/bus/platform/drivers/i2c_designware/bind
        ;;
esac
[–] [email protected] 13 points 4 months ago* (last edited 4 months ago) (1 children)

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.

load more comments (1 replies)
[–] [email protected] 13 points 4 months ago (1 children)

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.

[–] [email protected] 6 points 4 months ago (2 children)

I'll admit to doing this (but with tmux)

[–] [email protected] 1 points 4 months ago (1 children)

Why is it so hard to just daemonize???

load more comments (1 replies)
[–] [email protected] 2 points 4 months ago

I may or may not do this occasionally with byobu and my own services. Byobu is easier to use.

[–] [email protected] 11 points 4 months ago (1 children)

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.

[–] [email protected] 4 points 4 months ago (5 children)

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

load more comments (5 replies)
[–] [email protected] 11 points 4 months ago (2 children)

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.

load more comments (2 replies)
[–] [email protected] 4 points 4 months ago (1 children)

It makes me mad to see the current state sway is in, I even bought an AMD GPU for nothing.

[–] [email protected] 3 points 4 months ago

I too was a bit underwhelmed by sway. I also bought an amd gpu, but I don't regret it. I couldn't get Wayland to work at all on my 3060 ti.

[–] [email protected] 4 points 4 months ago

In the earlier days of Plasma 6, it would crash on me when waking from sleep, so I had a small script that would basically restart plasmashell when waking so I didn't have to wait the several seconds for the system to realize that it was frozen before I had a functional desktop.

[–] [email protected] 12 points 4 months ago (1 children)

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

[–] [email protected] 2 points 4 months ago (2 children)

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.

load more comments (2 replies)
[–] [email protected] 8 points 4 months ago (2 children)

not sure if duct tape or brute force but if I can't stop a file from getting overwritten like resolv.conf I just make it immutable with chattr

[–] [email protected] 5 points 4 months ago

Fucking network daemons messing with my resolv.conf

load more comments (1 replies)
[–] [email protected] 8 points 4 months ago

I'm not technically inclined at all, so the most duct tapey thing I can remember was hacking Gnome to use Nemo as my file browser instead of Gnome's default file browser once.

[–] [email protected] 18 points 4 months ago (2 children)

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.

load more comments (2 replies)
[–] [email protected] 38 points 4 months ago (4 children)

I duct taped a Raspberry Pi to the back of a television once. Does that count?

[–] [email protected] 13 points 4 months ago

I personally like this, so as far as I'm concerned, yes.

load more comments (3 replies)
[–] [email protected] 11 points 4 months ago (2 children)

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)

load more comments (2 replies)
[–] [email protected] 8 points 4 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.

[–] [email protected] 15 points 4 months ago (1 children)

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.

load more comments (1 replies)
[–] [email protected] 12 points 4 months ago* (last edited 4 months ago) (2 children)

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.

[–] [email protected] 4 points 4 months ago

Haaaa! I do the same with a tiddlywiki

load more comments (1 replies)
[–] [email protected] 8 points 4 months ago (2 children)

sometime ago I had my home directory managed by systemd-homed on Fedora (before 38 even afaik). the SELinux policy wasn't configured properly for it though, so I had to keep setting it to permissive mode. for some stupid reason I remember running the command to do that on every. single. boot. lol

[–] [email protected] 5 points 4 months ago

Using crontab to execute these kinds of quick fixes that don't really solve the problem so much as reset the countdown to failure are the real Duck tape Linux hacks.

load more comments (1 replies)
[–] [email protected] 6 points 4 months ago

Not exactly mine but I've used it. I have a fast but data-limited internet connection and a slower unlimited connection. When I need the faster connection to do something I connect to it through wifi while staying connected to the other through Ethernet. Then use this project to bind a specific app to wifi while everything else keeps using Ethernet. It uses LD_PRELOAD to link its own version of network connect that calls the real method. There's definitely a better way to do this with iptables but it's a good enough patch for when needed.

load more comments
view more: ‹ prev next ›