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.
Linux
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
- Posts must be relevant to operating systems running the Linux kernel. GNU/Linux or otherwise.
- No misinformation
- No NSFW content
- No hate speech, bigotry, etc
Related Communities
Community icon by Alpár-Etele Méder, licensed under CC BY 3.0
I wrote a systemd unit file to force my wireless keyboard to always switch the fn key to normal F-keys.
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.
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
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.
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
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
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
gtk3-classic
still doesn't work properly on Wayland and I doubt it will ever be fixed so I include WAYLAND_DISPLAY=0
in each shortcut file to force them into xwayland.
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 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 type fix_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.
Bootstraping.
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.
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.
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. 🥹
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.
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.
Side of the case fell off.
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.
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.
It just felt simpler than completely disassembling a hard-to-take-apart laptop.
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.
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.
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.
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.
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.
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.
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.
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.
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?
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 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.
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.