Skip to content

Instantly share code, notes, and snippets.

View LinusCDE's full-sized avatar
💭
Things are currently pretty wild in life. So super inactive here rn.

Linus K. LinusCDE

💭
Things are currently pretty wild in life. So super inactive here rn.
View GitHub Profile
@LinusCDE
LinusCDE / README.md
Created May 16, 2023 23:08
reMarkable: Using Internet over USB (Linux PC)

This is a small writedown of you to use Internet over USB on your reMarkable in cases you can't use WiFi.

Requirements:

  • A Linux PC (mac might work or do with some minor workarounds)
  • Turn a blind eye to the crappy scripts below

Since the PC being connected to the reMarkable over USB connects them in the Network 10.11.99.0/24 which the reMarkable creates, we can use this subnet to route all other traffic of the device over it and essentially treat the PC like an ordinary router.

Step 1: Allow your PC to act like a router

@LinusCDE
LinusCDE / README.md
Created January 6, 2022 17:08
EvMacros

EvMacros

Basic but really powerful recording and playback of raw ev events. This is useful for short-term recording and playback and especially helpful if your devices are not conventional you want support for relative mouse input which is especially needed in games.

Recording

Adjust the devices to be recorded in macrec.py at the end of the file. Use evtest to see what devices have which number (/dev/input/event<X>).

Then you can just run the script: ./maccrec.py > recording. The recording will automaticially stop if you press the ESC key (can be adjusted in the code as well).

@LinusCDE
LinusCDE / ffmpeg-wrapper.sh
Last active February 3, 2024 10:57
FFmpeg Wrapper script that forces jellyfin to use nvmpi hardware accelleration when device is a nvidia jetson and jetson-ffmpeg is added
#!/bin/bash
SHELLDIR=$(dirname "`realpath \"$0\"`")
FORCE_HW_DECODE=true
FORCE_HW_ENCODE=true
echo "WRAPPER OLD: " $0 "$@"
skipnext=false
@LinusCDE
LinusCDE / integrate_pdf.py
Created November 23, 2020 14:17
Script to integrate PDF into Xochitl (on-device)
#!/usr/bin/env python3
import json
from os import system, path
from shlex import quote
from sys import argv, stderr
from time import time
from uuid import uuid4
DOC_DIR = '/home/root/.local/share/remarkable/xochitl/'
@LinusCDE
LinusCDE / ipupdater.py
Created September 17, 2020 21:35
ipupdater.py
#!/usr/bin/env python3
'''
This script gets the public IPv4 Address from your Fritz!Box (!!!)
and the public IPv6 from your Interface.
When they change, the specified cloudflare dny record will get updated.
Adjust your settings in the config section (this is nothing serious, hence
no proper external config).
@LinusCDE
LinusCDE / remarkable-bootstrap-wget.sh
Created September 3, 2020 23:06
remarkable-bootstrap-wget.sh
#!/bin/sh
WGET_BINARIES_PATH='http://static.cosmos-ink.net/remarkable/artifacts'
WGET_BINARIES_FILENAME='wget-remarkable-pipeline_job245_wget1.20.3.zip'
WGET_BINARIES_SHA256='84185a5934e34e25794d439c78dc9f1590e4df12fbf369236f6a8749bf14d67f'
# Download and compare to hash
wget "$WGET_BINARIES_PATH/$WGET_BINARIES_FILENAME" -O "/home/root/$WGET_BINARIES_FILENAME"
if ! echo "$WGET_BINARIES_SHA256 /home/root/$WGET_BINARIES_FILENAME" | sha256sum -c -; then
echo 'FATAL: Invalid hash!' >&2
@LinusCDE
LinusCDE / glasscord_install.sh
Last active July 8, 2020 20:34
Install Glasscord on Linux
#!/bin/sh
if [ $UID -ne 0 ]; then
echo "Root required!" >&2
exit 1
fi
if [ ! -d /opt/discord/resources ]; then
echo "Discord is not installed, where it is expected" >&2
echo "Make sure to have discord installed in /opt/discord using" >&2
@LinusCDE
LinusCDE / _reMarkable badges.md
Last active June 2, 2020 17:19
reMakarkable status badges demo
@LinusCDE
LinusCDE / mqtt_influx_relay.py
Created April 9, 2020 19:29
MQTT to Influx relay script
#!/usr/bin/env python3
# Bases on snippet from this tutorial:
# https://gonzalo123.com/2018/06/04/playing-with-docker-mqtt-grafana-influxdb-python-and-arduino/
import paho.mqtt.client
from influxdb import InfluxDBClient
import datetime
import logging
@LinusCDE
LinusCDE / comment_block_detector.js
Last active February 19, 2020 06:05
Youtube Comment-Block Detector
// Raw elements:
RAW_ELEMENT_COMMENT_BLOCKED = `
<span class="ytcbd ytcbd-blocked-info"
style="background-color: #800000; color: #fefefe; padding: 0 4px; margin: 0 3px; border-radius: 4px; font-weight: 800; font-size: 8pt;"
title="Dieser Kommentar wurde höchstwarscheinlich blockiert und ist nur für dich sichtbar!
YouTubes Interne Antwort lautet:
%MESSAGE%">
<span style="font-size: 9pt">✘</span>
Kommentar blockiert!
</span>