Skip to content

Instantly share code, notes, and snippets.

@leogallego
leogallego / gitconfig
Created May 10, 2021 19:37
git graph tree in cli with changes
[alias]
lg = log --graph --abbrev-commit --decorate --date=relative --format=format:'%C(bold blue)%h%C(reset) - %C(bold green)(%ar)%C(reset) %C(white)%s%C(reset) %C(dim white)- %an%C(reset)%C(bold yellow)%d%C(reset)' --all
@leogallego
leogallego / etc-pulse-default.pa
Last active March 15, 2021 17:11
white noise speaker when idle pulse audio linux
White noise is caused by the suspend-on-idle for some speakers.
]$ sudo vim /etc/pulse/default.pa
### Automatically suspend sinks/sources that become idle for too long
#load-module module-suspend-on-idle
@leogallego
leogallego / wacom-one-small-dual-monitor-nvidia.txt
Last active March 5, 2021 18:54
wacom one small dual monitor nvidia propietary driver
## list screens / monitors
~]$ xrandr
Screen 0: minimum 8 x 8, current 3640 x 1920, maximum 32767 x 32767
DVI-D-0 connected 1080x1920+0+0 left (normal left inverted right x axis y axis) 475mm x 267mm
HDMI-0 disconnected (normal left inverted right x axis y axis)
DP-0 connected primary 2560x1080+1080+0 (normal left inverted right x axis y axis) 673mm x 284mm
DP-1 disconnected (normal left inverted right x axis y axis)
DP-2 disconnected (normal left inverted right x axis y axis)
@leogallego
leogallego / gist:ef00d7667b2ba221f444b4aea35749c8
Created February 14, 2021 21:16
wacom one tablet linux dual monitor setup
### Requirements ###
* X Server 1.8 or later
* xf86-input-wacom-0.10.9 or later
## MapToOutput ##
Tip: The '''MapToOutput''' [[xsetwacom]] parameter requires at least xf86-input-wacom-0.11.99.1 to work with the NVIDIA binary driver. See [[Coordinate Transformation Matrix|Dual-and-Multi-Monitor-Set-Up#coordinate-transformation-matrix|]] instead.
The wacom driver does not support multi-monitor setups directly - handling of such setups is handled by the X Server. [[xsetwacom]] does however provide a parameter to easily map a tablet to a screen
@leogallego
leogallego / readme.md
Created February 6, 2021 18:22 — forked from rometsch/BH456A_linux_driver.md
MPOW BH456A Bluetooth USB Adapter Kernel Module Adjustements (Realtek RTL8761B chip)

Problem

The MPOW Bluetooth 5 dongle (Model: BH456A) does not work out of the box on Ubuntu 20.04 (kernel 5.4.0-42).

Solution

Patch the bluetooth kernel module and copy the firmware binaries to /lib/firmware.

Copy the fimware

https://github.com/Pulse-Eight/libcec/blob/master/docs/README.linux.md
---
AOCEC
Pass the argument -DHAVE_AOCEC_API=1 to the cmake command in the compilation instructions:
cmake -DHAVE_AOCEC_API=1 ..
---
Section "InputClass"
Identifier "Marble Mouse"
MatchProduct "Logitech USB Trackball"
Driver "libinput"
Option "ScrollMethod" "button"
Option "ScrollButton" "9"
Option "MiddleEmulation" "true"
Option "HorizontalScrolling" "false"
Option "ButtonMapping" "3 9 1 4 5 6 7 2 8"
# Option "ButtonMapping" "3 9 1 4 5 6 7 2 8" // left hand - SR scroll, LL+LR fwd, SL mid click
@leogallego
leogallego / gist:9f034f4d5de2e7590d811c174b951c97
Created May 23, 2019 16:09
github error key already in use
# If the key already exists in another user (or machine user) or is a deploy key in a project/repo, it can't be used anywhere else.
# Github doesn't inform the owner of the key, the project or any other data about the conflict
# You only see the key fingerprint in every project or user, and a user filed description (text, might not have relation to actual key)
#
# How to see a github compatible fingerprint from a public id_rsa key file:
ssh-keygen -E md5 -lf /$PATH/$ID_RSA_FILE
# Set all directories permissions to 755 / rwx-r-x-r-x
find . -type d -exec chmod 755 {} \;
# Set all files permissions to 644 / rw-r--r--
find . -type f -exec chmod 644 {} \;
# Set all directories permissions to 555 / r-x-r-x-r-x (read only)
find . -type d -exec chmod 755 {} \;
# Set all files permissions to 444 / r--r--r-- (read only)
In VIM:
:w !sudo tee %
Or in .vimrc, map w!! to the command above:
cmap w!! w !sudo tee > /dev/null %