Skip to content

Instantly share code, notes, and snippets.

View kousu's full-sized avatar

Nick Guenther kousu

View GitHub Profile
@kousu
kousu / README.md
Last active May 7, 2025 04:39
Upgrading Galaxy Tab E SM-560NU (gtelwifiue) to LineageOS 19.1

The Galaxy Tab E is an unsupported and somewhat dated device now, but there are a lot of them in the world and they have a nice screen that's comfortable for reading or watching shows. Here is how to keep one alive, if you have it, by updating its OS to 2025. Credit for the build goes to @retiredtab (https://sourceforge.net/projects/retiredtab/). Google(?) is no longer doing firmware security updates, and so @retiredtab has decided this is the last build they are going to make, so there will be no more updates unless someone else picks maintenance up. Do not put any sensitive data on this device, but it makes a good e-book reader or youtube/Netflix viewer.

This guide assumes you have a desktop machine with Linux and ~1GB of free space.

Verify model

Look at Tablet > Settings > About Tablet > model. Verify it says SM-T560NU.

@kousu
kousu / README.md
Last active May 5, 2025 17:24
DIY markdown wiki sync

Cloud-reduced Markdown Wiki (WIP)

This is a way to write and share notes for yourself between multiple devices, without signing up for locked-in cloud services

Install

(Android) phone:

  1. Diary.apk
@kousu
kousu / nc-chdir.py
Created April 24, 2023 22:14
Prototype a workaround for unix domain socket length limit of 107.
#!/usr/bin/env python
# this is a tiny little clone of `nc -U -l path`
# but it creates the socket *after chdir()ing in a subprocess* to avoid ENAMETOOLONG:
#
# To test the difference, get openbsd-netcat and run:
#
# mkdir -p /tmp/abcdefhijklmnopqrstuvwxyz/abcdefhijklmnopqrstuvwxyz/abcdefhijklmnopqrstuvwxyz/abcdefhijklmnopqrstuvwxyz
# nc -v -U -l /tmp/abcdefhijklmnopqrstuvwxyz/abcdefhijklmnopqrstuvwxyz/abcdefhijklmnopqrstuvwxyz/abcdefhijklmnopqrstuvwxyz/ipc.sock
#
@kousu
kousu / README.md
Created January 12, 2023 23:50
Bridging Discord + XMPP

Just because the docs on https://github.com/42wim/matterbridge/wiki/ are a little bit obscure in some parts, here's a complete record of what I did:

  1. sudo pacman -S matterbridge
  2. Set up a generic systemd service file:
$ cat /etc/systemd/system/matterbridge\@.service 
[Unit]
Description=%I Chat Bridge
After=network-online.target
@kousu
kousu / .gitignore
Last active October 9, 2022 19:04
nifti demo
node_modules
@kousu
kousu / pip-integrity
Last active September 30, 2022 18:57
The missing `pip integrity` command
#!/usr/bin/env python3
#
# The missing 'pip integrity' command.
#
# This verifies the correctness of an unpacked pip package
# by examining the file hashes in the 'RECORD' file.
# spec at https://peps.python.org/pep-0427/#the-dist-info-directory
import sys
import base64
@kousu
kousu / README.md
Last active November 28, 2021 18:36
Linux du(1) de-duplication bug

I've found a confusing behaviour in Linux's version of du(1). du can take a single folder to recurse into, or list of files/folders either via --files0-from or in argv. But its behaviour is inconsistent if this list contains parents and children.

  1. A child given before its parent makes the parent count as empty
  2. With -s (or equivalently -d 0), a parent given before its child (vice versa) skips the child

OpenBSD's du conversely has consistent behaviour: it always outputs one line (or block of lines, if not given -s) per input, and always counts everything as full-sized, parent and child.

<?xml version='1.0' encoding='utf-8'?>
<MixxxControllerPreset schemaVersion="1" mixxxVersion="2.3.0">
<info>
<name>Akai MPK Mini</name>
</info>
<controller id="AkaiMPKMini">
<scriptfiles/>
<controls>
<!-- Master -->
@kousu
kousu / README.md
Created April 11, 2021 18:13
dockerize for travis-ci
@kousu
kousu / README.md
Last active April 8, 2021 22:13
extract functions

Extract an indented block from a file, starting from a given header line.

Usage: extract.awk HEADER file

e.g.

$ ./extract.awk a t
   a() {