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.
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.
this is beautiful
it’s a pita every time something goes wrong; it works well most of the time, but it also REALLY sucks sometimes.
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.That reminds me of this
Everything here reminds everyone of that.
What is
unclutter
?Uh, well, I kind of already wrote most of what there’s to say in the comment above, it hides your mouse pointer when you don’t move it for a few seconds.
In most distros, it’s available as the
unclutter
package, directly from the repos. On Debian-based systems, the package you want is calledunclutter-xfixes
.https://wiki.archlinux.org/title/Unclutter
It is built for X11 and won’t work on Wayland.
But KDE recently shipped a built-in feature as part of Plasma 6.1 (a Desktop Effect called “Hide Cursor”), which also works very nicely. That one does not cause hover elements to disappear.
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:
- download the game via steam.
- switch it to use proton
- switch it back to linux version
- use the terminal to make the entire game folder read-only, so that steam couldn’t touch the game anymore and screw it up.
- add the exicutable to PATH
- 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.
I… What? Why does that work? How did you figure this out?
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.
I duct taped a Raspberry Pi to the back of a television once. Does that count?
I personally like this, so as far as I’m concerned, yes.
I duct taped a RPi4 to the back of a Motorola Lapdock and used custom cables to make the combo into the worst laptop ever. If yours counts, mine does too. This is what the Lapdock looks like:
Tbh I’ve always wanted to do this
It’s good for bragging rights, but a u2955 Celeron Chromebook is better value for money.
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 opensneovim
inkonsole
.#!/usr/bin/env bash konsole -e "nvim $@"
I have a folder full of scripts tied to aliases that fix various things when they go wonky, and I’ve long since forgotten what any of them do. I just know if
xxx
app stops working, I typefix_xxx
into the terminal and then it does a bunch of stuff and then it works again lol.Also I have a bunch of aliases tied to common tasks, like
e1
= reboot,e2
= shutdown etc. I have no idea where that habit came from.Edit: ALSO, just the general mish-mash of apps. I won’t have anything to do with Snaps, but the rest of it is an unholy combination of native apps, things from the AUR, flatpaks, Appimages, Docker containers and wine setups, mostly (but not all) in Bottles.
I dare you to try
grep -Irn alias
in your home dir.I’m not even sure what that would do! Presumably list every time the word alias appears in every file across the whole home directory or something like that?
Rtfm!
No, seriously, -I avoids binaries, -r recursively, -n print matching file and line number.
Alright, I’m gonna try it and see how long this takes!
edit: about 8 minutes. Not as spectacular as I’d hoped lol
If you have games there, yeah. Ripgrep is way faster. But grep is good enough in most cases.
Btw, did you find your aliases?
I did! I know where they are and which scripts they point to, but as for going into the scripts and trying to remember what they’re actually doing… I’ll get to it some day lol
now im really curious about that
xxx
app…
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 the5.9
kernel era. I am dreading the day when this behavior breaks and I can no longer update my kernel 😳I can hear the ticking…
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.
A zip quine? That’s genius
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
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.
Now THIS is a duct tape solution!
Oh dear
Had a Centos VM that kept slipping time. Every week it would loose about 30min. No amount of NTP syncing got the time correct until manual intervention.
Msp couldn’t work it out, couldn’t rebuild the server for infrastructure reasons, and only that server had the issue. The other 3 VMs on that host were fine.Cron job on one server took it current time, sshed to the dodgy server and configured the correct time.
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.
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.
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
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.
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