Skip to content

Instantly share code, notes, and snippets.

View ohthehugemanatee's full-sized avatar
💭
I may be slow to respond.

Campbell Vertesi ohthehugemanatee

💭
I may be slow to respond.
View GitHub Profile
@ohthehugemanatee
ohthehugemanatee / split-zoom.sh
Created March 11, 2021 11:52
Split zoom meeting recordings into two sides
#!/bin/sh
set -eu
### Splits a zoom side-by-side recording into separate left and right video files.
# Usage: ./split-zoom.sh /path/to/my-zoom-file.mp4
# Outputs ./my-zoom-file_right.mp4 and ./my-zoom-file_left.mp4
# Ensure we have ffmpeg in the PATH:
which ffmpeg
@ohthehugemanatee
ohthehugemanatee / drm.log
Created December 6, 2022 17:06
drm debug log
This file has been truncated, but you can view the full file.
[Di Dez 6 15:23:31 2022] [drm:drm_ioctl [drm]] comm="sway" pid=55803, dev=0xe280, auth=0, I915_GEM_EXECBUFFER2_WR
[Di Dez 6 15:23:31 2022] [drm:drm_ioctl [drm]] comm="sway" pid=55803, dev=0xe280, auth=0, I915_GEM_MADVISE
[Di Dez 6 15:23:31 2022] [drm:drm_ioctl [drm]] comm="sway" pid=55803, dev=0xe280, auth=0, I915_GEM_MADVISE
[Di Dez 6 15:23:31 2022] [drm:drm_ioctl [drm]] comm="sway" pid=55803, dev=0xe280, auth=0, DRM_IOCTL_SYNCOBJ_WAIT
[Di Dez 6 15:23:31 2022] [drm:drm_ioctl [drm]] comm="sway" pid=55803, dev=0xe280, auth=0, DRM_IOCTL_SYNCOBJ_DESTROY
[Di Dez 6 15:23:31 2022] [drm:drm_ioctl [drm]] comm="sway" pid=55803, dev=0xe280, auth=0, I915_GEM_MADVISE
[Di Dez 6 15:23:31 2022] [drm:drm_ioctl [drm]] comm="sway" pid=55803, dev=0xe280, auth=0, DRM_IOCTL_SYNCOBJ_CREATE
[Di Dez 6 15:23:31 2022] [drm:drm_ioctl [drm]] comm="sway" pid=55803, dev=0xe280, auth=0, I915_GEM_EXECBUFFER2_WR
[Di Dez 6 15:23:31 2022] [drm:drm_ioctl [drm]] comm="sway" pid=55803, dev=0xe280, auth=0, I915_GEM_MADVISE
[Di Dez 6 15:2
@ohthehugemanatee
ohthehugemanatee / .Shelly high-availability for home assistant.md
Last active February 20, 2024 09:54
Shelly HA script: when homeassistant is unavailable, gracefully fail over to local operation

Shelly / Home Assistant High Availability Scripts

Great home automation is invisible to the user, and should never cause catastrophic failure (ie inability to turn on the light). Which means that when your HomeAssistant server is down for whatever reason, the lights should continue to work "as expected".

These are scripts you can insert in the web interface of your Shelly device to achieve this effect. For normal operation, set the shelly to "detatched" mode, and create a HomeAssistant automation to actually respond to switch on/off events. Then add this script in the Shelly's web interface. Make sure to adjust the URI for your homeassistant appropriately.

The script checks the availability your homeassistant URI every 30 seconds to make sure it's up. If it's down, it changes the mode to local "flip" mode, where it cuts power on a switch event. When, on a future check, homeassistant is once again responding, it will automatically return to detached mode.

Variants of this script are floating around the h

@ohthehugemanatee
ohthehugemanatee / rm-keyboard.sh
Created December 3, 2024 16:03
Script to enable/disable USB keyboard support on the Remarkable 2
#!/bin/bash
# Script to enable/disable USB keyboard support on the remarkable 2.
# Just copy it to the rm2 over SSH, make it executable with chmod +x, and run it.
# You can confirm the change using `lsusb`. When this is enabled, you will see the host device and anything
# plugged into it.
#
# Then connect your keyboard using a powered USB OTG adapter. Bonus: the RM2 will charge while using it.
# In theory it is safe to keep "enabled" all the time, but TMK this has not been tested. It probably impacts battery life.