Skip to content

Instantly share code, notes, and snippets.

@mnalis
mnalis / etc_kernel_postinst.d__cdc-acm-irtoy-kludge
Last active October 22, 2025 17:23
RaspberryPI IrToy - restore /dev/ttyACM0 interface in newer kernels automatically on kernel upgrade
#!/bin/sh
# by Matija Nalis <[email protected]> GPLv3+ started 20211112
# automatically kludge cdc_acm.ko for IrToy /dev/ttyACM0 usage "old-way"
# updated by Matija Nalis <[email protected]> 20251022 for RpiOS-Trixie (6.12.47+rpt-rpi-v8)
#
# put this file with +rx permissions in /etc/kernel/postinst.d/cdc-acm-irtoy-kludge
#
#echo script: $0
#echo params: "$@"
@sirodoht
sirodoht / migrate-django.md
Last active September 22, 2025 17:30
How to migrate Django from SQLite to PostgreSQL

How to migrate Django from SQLite to PostgreSQL

Dump existing data:

python3 manage.py dumpdata > datadump.json

Change settings.py to Postgres backend.

Make sure you can connect on PostgreSQL. Then:

@rubo77
rubo77 / rotate-screen.sh
Last active August 21, 2025 16:36
This script rotates the screen and touchscreen input, disables or enbles the touchpad, and dis- or enables the virtual keyboard on a Lenovo Yoga 13 or Yoga 2 Pro (source: http://askubuntu.com/q/405628/34298)
#!/bin/bash
# This script rotates the screen and touchscreen input 90 degrees each time it is called,
# also disables the touchpad, and enables the virtual keyboard accordingly
# by Ruben Barkow: https://gist.github.com/rubo77/daa262e0229f6e398766
#### configuration
# find your Touchscreen and Touchpad device with `xinput`
TouchscreenDevice='ELAN Touchscreen'
TouchpadDevice='SynPS/2 Synaptics TouchPad'