Skip to content

Instantly share code, notes, and snippets.

View diffficult's full-sized avatar
💽
the big switcharoo

reese diffficult

💽
the big switcharoo
View GitHub Profile
@diffficult
diffficult / linux_kernel_patch.md
Last active April 1, 2024 16:41
Patching Linux Kernel 6.8.2 to solve BT issues

foolproof step by step

  1. sudo pacman -Syu base-devel devtools. This will pull in the necessary dependencies to build Arch packages.
  2. pkgctl repo clone --protocol=https linux. This will grab the PKGBUILD for the linux package. There should now be a linux folder in your current directory.
  3. Visit https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/?id=1c3366abdbe884 and download the patch by right-clicking the "patch" link next to the commit id and save as.
  4. Place the downloaded patch into the linux folder. It should be named d39a2734bf6221a1a4fe42eea1dd6a17f08ebf5b..1c3366abdbe884be62e5a7502b4db758aa3974c6.patch, but it really doesn't matter what you name it.
  5. Add that patch file name as another line in the source=() section. This tells the PKGBUILD to include the patch as a source file for the build.
  6. Add an extra 'SKIP' line as the last entry in both the `sha256
@diffficult
diffficult / ELECOM_HUGE_Trackball_keymap.md
Created March 30, 2024 22:13
ELECOM Huge Config XORG

ELECOM Trackball Mouse HUGE Trackball

Needed to remap keys on my ELECOM Huge Trackball, so I wrote a .conf file to be loaded at boot by X.

The ELECOM Huge has 12 keys you can assign. I will be remapping Fn1 and Fn2 which are near my index finger to be used as regular Left Click and Middle Click

Code Default Key Remap Key
1 Left Left
2 Middle Middle
@diffficult
diffficult / gist:1c5266a158cde39e47897413b202bdc7
Created July 12, 2023 23:20
enable zram on raspberry pi
https://haydenjames.io/raspberry-pi-performance-add-zram-kernel-parameters/
https://www.techrepublic.com/article/how-to-enable-the-zram-module-for-faster-swapping-on-linux/
https://ikarus.sg/using-zram-to-get-more-out-of-your-raspberry-pi/
@diffficult
diffficult / watchdog_setup.md
Created May 4, 2022 21:12
Setting up "Watchdog" to keep Raspberry Pi Alive

We have deployed a couple of long-running Raspberry Pis equipped with cameras and sensors reporting into our network 24/7. All these are under uptime monitoring for us to keep track of the network availability.

From to time one of our Raspberry Pis freezes in the field either because of a kernel or a hardware issue. In that case there is nothing that can be done with software anymore. You can’t connect to it, can’t ping the Pi – It becomes impossible to send it a restart command in any way to bring it back to normal operation. Debugging into these events you might find indications of such as freeze in the /var/log/kernel.log file, and only manual powering down, and powering up again brought it back to live.

One little known Pi features is a builtin hardware watchdog. This little hardware service will once enabled watch the system activity and automatically power cycle the Raspberry Pi once it gets stuck.

It’s done in few steps directly on a terminal on your Pi:

  1. Enable the hardware watchdog on your Pi a
@diffficult
diffficult / new_python_version_breaks_packages.md
Last active December 13, 2021 15:54
ARCHLINUX: How to rebuild packages when a new version of Python releases and gets added to [core]

How to identify and rebuild packages when a new version of Python is released

2021-12-12

Python 3.10 is now in [core].

You may need to rebuild any Python packages you've installed from the AUR. To get a list of them, you can run:

pacman -Qoq /usr/lib/python3.9

@diffficult
diffficult / bt_headset_audio_autoswitch.md
Last active June 18, 2023 05:26
LINUX - Switch your main audio output to your headset when bluetooth connects

Auto switch audio output when a new Bluetooth device connects

Depending on the distro or DE/WM you are running and which programs you are using to manage your audio you maybe run into the hassle of having to switch audio outputs each time you connect a bluetooth device (headset/speaker). You can in fact make pulseaudio to autoswitch when connection is established and not do it manually.

To accomplish this you just need to check a condition in the default.pa config file located in /etc/pulse/ directory on your install and add the following line load-module module-switch-on-connect like in the code snippet below:

...

### Automatically load driver modules for Bluetooth hardware
@diffficult
diffficult / reglas.md
Last active August 17, 2020 07:13
Reglas del Clan

Nuestra Comunidad

La idea detras de este clan desde un inicio siempre fue juntarse con amigos, hacer nuevos amigos y ayudarnos mutuamente para realizar actividades tanto PVE como PVP de cualquier dificultad sin presiones, despues de todo esto es un juego, una actividad recreativa.

REGLAS

- Los miembros del clan deben ser mayores de 18 años.

@diffficult
diffficult / perprogram_gtktheme.md
Created August 2, 2020 23:19
Use different GTK themes for specific programs

Use a different GTK2/3 theme for specific programs

Why would you want to specify a different theme for a program?

Most common scenario, you installed a program that looks horrible or unreadable on your current theme or variation of that theme (light, dark). There's a simple workaround for most programs to fix this problem.


GTK 2

@diffficult
diffficult / trimsetup.md
Created August 2, 2020 09:06
Proper TRIM setup on your system

TRIM on your Linux System

⚠️ WARNING ⚠️

DO NOT ENABLE BOTH PERIODIC TRIM AND CONTINOUS TRIM AT THE SAME TIME

ALSO DEBIAN, REDHAT AND OTHERS HIGHLY RECOMMEND TO DITCH CONTINUOS TRIM TO KEEP YOUR SSD HEALTHY AND THERE'S NO GOOD REASON TO HAVE IT RUNNING ON YOUR SYSTEM.


@diffficult
diffficult / AuthyToOtherAuthenticator.md
Created February 15, 2020 05:41 — forked from gboudreau/AuthyToOtherAuthenticator.md
Export TOTP tokens from Authy

Generating Authy passwords on other authenticators


There is an increasing count of applications which use Authy for two-factor authentication. However many users who aren't using Authy, have their own authenticator setup up already and do not wish to use two applications for generating passwords.

Since I use 1Password for all of my password storing/generating needs, I was looking for a solution to use Authy passwords on that. I couldn't find any completely working solutions, however I stumbled upon a gist by Brian Hartvigsen. His post had a neat code with it to generate QR codes (beware, through Google) for you to use on your favorite authenticator.

His method is to extract the secret keys using Authy's Google Chrome app via Developer Tools. If this was not possible, I guess people would be reverse engineering the Android app or something like that. But when I tried that code, nothing appeared on the screen. My gues