What is the most duct-tape thing you've done to Linux?
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.
Oh god, this is horrible. I beg you to find a better solution 🙏
it's horrible in more ways that you would expect and what other solutions exist with intel wifi hardware in ap mode on linux?
I think NDISwrapper is still maintained for issues like this.
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.
The kludge wins. 😅
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.
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.
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.
Ah okay thats the one kind of device where there is nothing you can really do true.
it's an ordinary desktop; the screwiness is introduced by intel's decision to remove ap capability from its recent drivers.
This is the real solution, just stop using the built in stuff and free yourself
It's not a laptop and the hardware is fully capable of ap mode support in it's older iteration of drivers; Intel made the decision to remove that capability in the recent versions of the driver.
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...
https://xkcd.com/1172/
How the fuck....
Other way around.
That's horrifying.
Hey, my setup works for me! Just add an option to enable CPU overheating in the next update!
Just think how many children are holding down spacebar to keep warm in the winter. We need to keep this feature around.
This is an absolute winner IMHO. I’m imagining all the hotkeys that are accidentally activated when a CPU-intensive task spins up.
Wow...
It's not real, it's an xkcd joke
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
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.
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!
I wonder if the windows docker image could be of use?
Is there such a thing as a windows docker image that doesn't run Linux on Windows?
I saw a reference to it the other day but didn't look further, it looks like the windows docker image can only run as athe same os as the base release
Ah right, useless.
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
https://xkcd.com/1172/
Everything here reminds everyone of that.
thats really cool actually
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.
I think this one beats them all.
My home server keeps a few services up, including an instance of Jitsi Meet. The server runs nixos and the nixos package for jitsi is incomplete to say the least and doesn't even support authentication, so I use the docker-compose version and I have a script that runs periodically to keep it updated. So far so good, right? Well, no.
Because the server is at home, I have a dynamic external IP address, so I have to use a DDNS provider, but jitsi doesn't expect this and uses a stun server at startup to determine the public IP of the server once, so if my connection goes down or is restarted and the IP changes, jitsi needs to be restarted or it won't work anymore.
The solution?
I've been running this setup since mid 2020 and I expect this to continue until IPv6 becomes the norm.
why not just run the IP check script on the box jitsi is on? a quick google gave me this:
dig +short myip.opendns.com @resolver1.opendns.com
and this:wget -q -O - checkip.dyndns.org | sed -e 's/.\*Current IP Address: //' -e 's/<.\*$//'
I already had a script on the router that I used to notify me of network outages, IP changes, keep the DDNS updated, etc. and I thought it was easier to just add a couple lines to that
Valid!
Couldn't it be possible to set a script that restarts jitsi as that user's login shell?
The jitsi user is a system user so it can't login even if you set a key for it. Besides, I wouldn't risk it anyway since that user is in the docker group, if it gets compromised somehow, the attacker would have very high privileges.
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:
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.
Even when Proton doesn't work, it still somehow works.
Magic.
Indeed. Proton for the win yet again.
I have an old laptop running some basic services.
I have taken it apart before to replace the hard drive with an SSD, but I never replaced the dead CMOS battery because you have to literally completely disassemble it to get at the battery.
So I have a cronjob that runs on startup to change the system clock to the right time-zone.
Debian (and Ubuntu) has the package "fake-hwclock". I'm sure other distros do too.
Periodically saves the time info to disk and resets the clock with it on boot.
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 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 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
.based
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.
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 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
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.
sssd didn’t work well with my company’s AD server, which would cause repeated authentication failures until I restarted sssd. I rigged up a bash script which would restart sssd any time xscreensaver logged an auth fail.
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
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.
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)
(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
Hey that's pretty good, I'm gonna steal it. It might even be worth making a pullrequest to update swaylock to have a flag to do this, I use waybar and it has a lock inhibit button that I use before I start watching anything, but automating it like this is seems super nice
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.
I have a Logitech mouse with extra buttons, I used Piper to set one of those buttons to be Play/Pause media button. It worked well, however for some reason it only worked when the mouse was connected via the dongle, via Bluetooth the button did nothing. So I configured to a random shortcut (don't remember what it is now, something like super+p) and configured that to call playctl play/pause.
Not as creative or duct tapey as others but it's what I remember now, pretty sure there are many others too hahaha
i did almost exactly the same thing lol
So I use a surface device with the Linux surface kernel, and there was (and probably still is) an issue where the type cover doesn't properly rebind after being detached and re-attatched. To make matters worse, connecting other USB devices disconnected the type cover. My solution was to make a udev rule that detected if the keyboard is "removed" and then try to rebind it, effectively unplugging it and plugging it back in again in software.
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.
I need this
Mounting a Samba share and moving my LVM pvolumes of / onto a losetup'ed file on it, while running the system. Bass ackwards.
Good grief. Why?
I needed to redo partitions, but didn't want to reboot.
That's not even a bad idea then.
One of my machines has a boot partition that's a bit too small, on an otherwise LVM setup.
I'd recommend a Linux installer on a memory stick, instead. It's bound to have less network lag.
Nah, it'll be fine.
I might have a large enough USB SSD laying around some where. I could probably use that instead.
Does your FS support online resizing? EXT4 doesn't, so you'd have to use an installer stick.
Be super careful about partition sizes. I once tried to shrink my FS to an exact size, then shrink the LV to the same size - it ended up corrupting my FS. After that time, I started undersizing the FS, then resizing LV, finally expanding the FS again.
Have backups.
Yeah. I mainly use btrfs; it supports online growing and shrinking.
I know. I have done plenty of same device partition resizing. I know the pit falls, and for safety shrink the FS to below what the LV is going to be.
Thanks for the reminder. I've been meaning to set up snapshot backups for this machine using rsnapshot as an experiment. I mainly use Dirvish
I use rsync with a custom shell script to manage the number of incremental copies. You'll probably prefer something less janky.
That sounds pretty much like what Dirvish and rsnapshot do. Both wrap rsync.
Did it work? There's a huge chance of data corruption if you are copying the disk of a running system.
Some years ago, I had a client with a really fucked up set of requirements:
This was during the days when booting into a LUKS encrypted Gentoo install involved copy-and-pasting a shell script out of the Gentoo wiki and adding it to the initrd. I want to say late 2006 or early 2007.
I remember creating a /boot partition, a tiny little LUKS partition (512 megs, at most) after it, and the rest of the drive was the LUKS encrypted root partition. The encrypted root partition had a randomly generated keyfile as its unlocker; it was symmetrically encrypted using gnupg and a passphrase before being stored in the tiny partition. The tiny partition had a passphrase to unlock it. gnupg was in the initrd. I think the workflow went something like this:
I don't miss those days.
@drwho @squid_slime
Wow, that sounds like quite the adventure!! I can’t imagine juggling all those steps just to boot up the system....
Huge pain in the ass to set up, but from the user's end of things it was pretty easy to do.
@drwho It's amazing how much work can go on behind the scenes to make things smooth and simple for the user....
Side of the case fell off.
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.
Just write a script that runs periodically to check the log's size and delete when its near the crash threahold.
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.
I'll admit to doing this (but with tmux)
I may or may not do this occasionally with byobu and my own services. Byobu is easier to use.
Why is it so hard to just daemonize???
Interactivity 😂
I regularly recommend configurations to peers that are arguably impossible for normal humans. (Not on purpose! Sorry Dave!)
I love to run stuff on Raspberry Pi, and I fear no
gcc
compile flag. (Ok. That's a bold faced lie, even I fear a couple of them.) So I frequently forget the bullshit I had to do to get something weird running on a random Pi.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
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)
This is god-tier duct tape…
I love Linux
I've set Raspberry Pis to auto-reboot themselves at night if they are being used for headless network services that need to be available 24/7, just to clear out memory leaks or other things that may have gotten locked up. Not sure if that's duct tape or just a standard practice. They aren't the most stable things sometimes. They're known for power supply and SD card issues.
I did this with my sensors running in Pi picos.
There was some wonkyness with some of the electrical stuff and since I have no idea how to debug that, I just restarted them every 24 hours and at start "drained" all pins by repeatedly reading from them.
I'm reasonably sure, this setup is cursed enough to kill an electrical engineer on sight, but it kind of works good-ish enough.
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.
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
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.
Haaaa! I do the same with a tiddlywiki
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.
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
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.
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
Ah, didn't know it worked differently for spdif, never had anything nice enough to use it.
I one crossgraded a debian server from x86 to x86_64.
absolute madlad
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.
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
Open a bug report with the school network admkn. This is default android behavior and a privacy issue to boot
Android is fine because you're able to use a web browser to get an auth key. You have to register devices where you can't do that, and it seems to be impossible in the case of the pixel watch
Edit: Also, they're not concerned about privacy. They want to know who every device belongs to
That never works for me on Android systems. It probably needs some shitty Google service.
You have a right to privacy. Its your school. They work for you.
The iPhone does that too, but has a way to disable it on a per-network basis.
What is it with these schools and not just using WPA Enterprise? They already hand out an email to every student so it makes it dead simple to deactivate the account's PSK upon terming the student
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.
Knowing myself, I shiver at the idea of my nix config... It'll probably have more ductape than a 3M distribution center
At least all the ductape would be easily findable and documentable in a nixos config
Wow, Lotta smart people here doin some.hacky shit
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.
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.
Neat idea. Btw what's that character you used in place of a "u" in "solıtions"? It looks an "i" lost its tittle
In Turkish we have ı/I and i/İ instead of i/I. u is next to ı, I made a typo.
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 &'
I still occasionally need to use one of these two
Damn Taskbar is gold
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.
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
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
Fucking network daemons messing with my resolv.conf
Using this with Steam to prevent games from updating.
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.
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.
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.
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.
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. lolUsing 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.
I'm about to do some SELinux workarounds. I want to install an SELinux package in a VM to build rpm-ostree images, but installing that breaks the Incus agent inside the VM when it cannot listen on a socket. Any advice on how to go about it? I'm pretty new with anything SELinux.
I wrote a systemd unit file to force my wireless keyboard to always switch the fn key to normal F-keys.
I think there is a value you can put into a /sys file to fix this. Had the same issue on my k10 keyboard. (the fix was easily findable on their forums)
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.
can't you just trigger a script after some udev event? Your battery would be happg
That was when I first switched to Linux so safe to say I did my best lol. A correction, the issue happened when I used the switch in my Bluetooth keyboard which connects to 3 devices but was working fine using a dedicated KVM switch with WiFi dongle. Maybe I should check again if its still a thing as its been almost an year now.
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 restartingplasmashell
to clean up the occasional edge case where a tray icon is supposed to follow the theme but doesn't.Oh yeah I do this, I'll raise you that mine also sshs into my server to update the editor theme
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.
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.
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.
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
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.
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.
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.
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.
Here's a few of the micro-hacks that I've hacked up in the past.
::: spoiler A 2-line script to chroot into Debian when logging in as a certain user on FreeBSD.
:::
::: spoiler 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.:::
::: spoiler This thing, called
demoronize
, which does what it says in the comments:::
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.gtk3-classic
still doesn't work properly on Wayland and I doubt it will ever be fixed so I includeWAYLAND_DISPLAY=0
in each shortcut file to force them into xwayland.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.
On the client side of a relayd-based wireless bridge using OpenWrt, I discovered there was a bug in that relayd version which made the process hang after it moved so many gigs of data. I made a cron job that pings the network relayd makes accessible. If the ping fails, it nukes relayd. Of course this relies on a live machine to ping. If this machine dies for some reason, the cron job would just keep killing relayd over and over again. 🥹
Bootstraping.
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
this sounds quit useful tbf
Don't remember the specifics but I had a key combo setup to force a soft reset in my DE. Occasionally a kernel or driver update would fuck up my video and make the system unusable but still live. I try to avoid hard resets.
This is in my Home Manager configuration. I don't think this is that bad, it's just kinda messy. If you can't tell, it's a script for taking screenshots, embedded in my configuration.
About a decade ago I was playing a game on Linux and the game crashed and took the entire DE with it. So I went to a different
tty
and started a fresh x desktop session and started playing again until the game crashed again (I was running a bunch of mods so it would crash every couple of hours or so) and still didn't feel like rebooting so I went to yet anothertty
and started yet another x desktop session. I did this about 3 times in total before I finally went "I should probably actually reboot because this has to be making a bigger mess of things"My Fedora distro can't restart and stalls when it tries to shutdown with the auto update checked. So it never shuts down. I set up a cronjon to run dnf update to make sure that I don't need to uncheck the auto update option. Just a really silly thing that bothers me.
I converted a custom raspberry pi distribution (some kind of a debian I think) into an Arch Linux ARM without a reinstall.
I’ll leave this one here for someone:
You can tunnel L2 over OpenVPN. Just bridge your interfaces in both sides and it works.
That way if you need to provision a VOIP phone or just have something NetBoot remotely. Not that I recommend doing that…
When installing an encrypted Arch system, I couldn't figure out how to change the keymap in GRUB stage 1, which asks for the passphrase and then decrypts
/boot
. I just entered my passphrase with the default en-us keymap without really knowing what characters it outputs.Hmm. Maybe
systemctl enable rc-local
because I was too lazy to get the service order correct and I just wanted something to happen last and be done with it.