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

Linux

48208 readers
1367 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 2) 50 comments
sorted by: hot top controversial new old
[–] itslilith@lemmy.blahaj.zone 12 points 2 months 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.

[–] savvywolf@pawb.social 11 points 2 months ago (1 children)

I one crossgraded a debian server from x86 to x86_64.

load more comments (1 replies)
[–] data1701d@startrek.website 11 points 2 months ago (6 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.

load more comments (6 replies)
[–] delirious_owl@discuss.online 11 points 2 months ago

Wow, Lotta smart people here doin some.hacky shit

[–] macattack@lemmy.world 10 points 2 months ago* (last edited 2 months ago) (2 children)

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 6 points 2 months ago* (last edited 2 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'
load more comments (1 replies)
[–] mrvictory1@lemmy.world 10 points 2 months ago (2 children)

I ran chmod 777 /dev/uinput so AntiMicroX worked on Wayland. The PC was intented to be used as an HTPC. A Dualshock 3 would be the remote and KDE Plasma Bigscreen would be used to launch Linux native apps ie. Firefox and Android apps via Waydroid, hence the Wayland requirement. AntiMicroX would bind gamepad inputs to arrow keys, enter, ESC, volume up/down, mouse navigation, left/right click etc. The whole setup was duct tape, user unfriendly and it ultimately did not solve the problem that sent me down this rabbit hole: Internet was unstable even with an ethernet cable so it had no advantage over the crappy Android TV stick that had trouble streaming anything but Chromecast. A close contender is having to disable Internet when launching a specific online only game otherwise performance halves. There is also a guide I uploaded to Reddit that describes how to import ringtones from Linux to iOS that has 8 steps and involves rebooting your phone. And another guide to run 2 games at once and stream one of thrm while playing the other locally.

I have a problem with half working duct tape solıtions.

load more comments (2 replies)
[–] allywilson@lemmy.ml 10 points 2 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.

[–] Shadow@lemmy.ca 10 points 2 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.

[–] dditty@lemm.ee 9 points 2 months 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

[–] jbk@discuss.tchncs.de 8 points 2 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

[–] Wolf314159@startrek.website 5 points 2 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)
[–] Head@lemmings.world 8 points 2 months ago

I was trying to customize shit and accidentally deleted my entire task bar. I couldn't figure out how I did it so I just installed a different one which needed to boot on startup.

[–] mycodesucks@lemmy.world 8 points 2 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.

[–] mactan@lemmy.ml 8 points 2 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

[–] ramius345@sh.itjust.works 5 points 2 months ago

Fucking network daemons messing with my resolv.conf

load more comments (1 replies)
[–] dizzy@lemmy.ml 8 points 2 months ago

Couldn’t figure out how to access my headless server’s desktop environment via VNC without a monitor connected and turned on. I bought a hardware displayport dummy adapter to pretend to be a real display to get it to work.

A hardware solution to a software problem… felt really wrong.

I’ve since wrapped my head around tmux and managing all my services via command-line or web-ui so I have no need for it anymore.

[–] SimplyTadpole@lemmy.dbzer0.com 8 points 2 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.

[–] RogueBanana@lemmy.zip 6 points 2 months ago (2 children)

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.

load more comments (2 replies)
[–] everett@lemmy.ml 6 points 2 months ago (1 children)

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 5 points 2 months ago

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

[–] kate@lemmy.uhhoh.com 6 points 2 months ago* (last edited 2 months ago)

something kept messing with my dns and i’m too lazy to find out why so i hardcoded etc/resolv.conf and chmod +i on it

[–] chameleon@fedia.io 6 points 2 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.

[–] 314xel@lemmy.world 6 points 2 months ago* (last edited 2 months ago)

I'm rebooting my router every week via a crontab because some dynamic dns update process fails from time to time and I find it hanging. No time to debug the actual problem.

[–] MicrowavedTea@infosec.pub 6 points 2 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.

[–] dotslashme@infosec.pub 6 points 2 months ago

Actually really few instances of jerry rigging, but I do remember during my distro-hopping days where I used a binary gcc package to compile a more optimized binary of gcc. At the time, that felt pretty weird, but looking back I see why.

[–] ving_thor@lemmy.world 6 points 2 months ago (1 children)

I wrote a systemd unit file to force my wireless keyboard to always switch the fn key to normal F-keys.

load more comments (1 replies)
[–] communist@lemmy.frozeninferno.xyz 6 points 2 months ago* (last edited 2 months 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.

[–] Quackdoc@lemmy.world 5 points 2 months ago

I really needed to run a compositor from an arch chroot and systemd's udev is straight up broken in chroot, so I used libudev-zero and made sure that every time systemd updated I would delete the libudev .so file and plunk libudev-zero ontop of it, no i've moved on to greener pastures (Artix) but hey, it did work.

load more comments
view more: ‹ prev next ›