Skip to content

Instantly share code, notes, and snippets.

View brlin-tw's full-sized avatar
:octocat:
Loading status...

林博仁(Buo-ren, Lin) brlin-tw

:octocat:
Loading status...
View GitHub Profile
@brlin-tw
brlin-tw / x-resize
Created July 24, 2023 06:02 — forked from wynnchel/x-resize
Manual Implementation of Auto Resizing For Non-Gnome Environments (like XFCE) running under Spice/Libvirt
#!/bin/bash
# Steps:
# 1) Make sure bash is available
# 2) Create udev rule
# - path to new udev rule: /etc/udev/rules.d/50-x-resize.rules
# - udev rule content:
# ACTION=="change",KERNEL=="card0", SUBSYSTEM=="drm", RUN+="/usr/local/bin/x-resize"
# 3) Create /var/log/autores directory
# 4) Create script /usr/local/bin/x-resize (this file) and make executable
# 5) Reload udev rules with `sudo udevadm control --reload-rules`
@brlin-tw
brlin-tw / archived.md
Created March 25, 2022 02:26 — forked from nevack/archived.md
[ARCHIVED] Fix for CSR Dongle 0a12:0001 ID 0a12:0001 Cambridge Silicon Radio, Ltd Bluetooth Dongle (HCI mode)

This gist is currenctly archived.

Please refer to previous revisions if you know what to do.

The patch proposed was merged into kernel in 5.8 release, but no longer working as of linux 5.11

Please contact me, if you have new info about workarounds for CSR Bluetooth Dongle.

Telegram:

@brlin-tw
brlin-tw / asciinema-to-scriptreplay
Created December 5, 2019 11:57 — forked from izabera/asciinema-to-scriptreplay
convert between asciinema and scriptreplay
#!/bin/bash
exec {times}> times {typescript}> typescript < "${1-/dev/stdin}"
while read -r; do [[ $REPLY = ' "stdout": [' ]] && break; done # skip to this line
LANG=C
printf "Script started on %(%c)T\n" -1 >&"$typescript" # dummy
while read -r open; [[ $open = '[' ]]; do
read -r elapsed; read -r string; read -r close
eval printf %b%n "$string" characters >&"$typescript" # put count in $characters
printf "%s %s\n" "${elapsed%,}" "$characters" >&"$times"
done