Skip to content

Instantly share code, notes, and snippets.

Avatar

Kyle Manna kylemanna

View GitHub Profile
@kylemanna
kylemanna / build-friendlywrt.md
Last active Sep 25, 2022
FriendlyElec NanoPi R5S Linux PTP Support
View build-friendlywrt.md

Build Notes

Environment

Use systemd-nspawn on Arch Linux with debootstrap:

sudo debootstrap --include=systemd-container --components=main,universe jammy ubuntu22.04-rk3568 http://archive.ubuntu.com/ubuntu/
@kylemanna
kylemanna / arch-linux-install.md
Last active Sep 23, 2022 — forked from binaerbaum/arch-linux-install
Minimal instructions for installing arch linux on an UEFI NVMe system with full system encryption using dm-crypt and luks
View arch-linux-install.md
@kylemanna
kylemanna / README-python-service-on-systemd-activated-socket.md
Last active Sep 18, 2022 — forked from drmalex07/README-python-service-on-systemd-activated-socket.md
An example network service with systemd-activated socket in Python. #systemd #python #socket #socket-activation
View README-python-service-on-systemd-activated-socket.md

README

The example below creates a TCP server listening on a stream (i.e. SOCK_STREAM) socket. A similar approach can be followed to create a UDP server on a datagram (i.e. SOCK_DGRAM) socket. See man systemd.socket for details.

An example server

Create an simple echo server at ~/tmp/foo/serve.py.

View 0001-pkgrel-v0.4.1-3-add-python-numpy-OpenGL-dependencies.patch
From 30cf11cb52c49d17abb7b7d22379ff9c383daaa7 Mon Sep 17 00:00:00 2001
From: Kyle Manna <kyle@kylemanna.com>
Date: Thu, 1 Sep 2022 09:46:52 -0500
Subject: [PATCH] pkgrel: v0.4.1-3 add python-numpy + OpenGL dependencies
---
.SRCINFO | 5 ++++-
PKGBUILD | 4 ++--
2 files changed, 6 insertions(+), 3 deletions(-)
mode change 100755 => 100644 PKGBUILD
@kylemanna
kylemanna / connmanctl.md
Last active Jul 7, 2022
Connmanctl Cheat Sheet
View connmanctl.md
@kylemanna
kylemanna / parse-ext-csd.py
Last active Jul 6, 2022
Parse eMMC Extended CSD and print useful things.
View parse-ext-csd.py
#!/usr/bin/env python
"""
Author: Kyle Manna <kyle@kylemanna.com>
Blog: https://blog.kylemanna.com
cat /d/mmc0/mmc0:0001/ext_csd
0000000000000001030100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002000000087a0000000000000000061502030700100608010101080800100000728000000808080808080000000000010200070002000500000000000001000200000000000000000000000000000100050000000000030001ca00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
@kylemanna
kylemanna / 7z+tar.md
Last active May 2, 2022
Archive with tar + 7z + max compression
View 7z+tar.md

Overview

7-zip doesn't preserve the Linux/Unix owner/group of files and possibly other details. Use tar instead because it's designed to preserve these things, then just 7zip the tar archive.

Create the archive

tar cf - --exclude=\*.o -v directory | 7z a -si -t7z -m0=lzma -mx=9 -mfb=64 -md=32m -ms=on directory.tar.7z
@kylemanna
kylemanna / falcon-zipfile-stream.py
Created May 16, 2020
Falcon + zipfile streaming proof of concept v2
View falcon-zipfile-stream.py
#!/usr/bin/env python3
#
# Falcon + zipfile streaming content using os.pipe() to minimize RAM usage to a
# pipes worth of data.
#
# This test program generated a nearly 500 MB zip file with various compression
# arguments supported by the python3 standard library.
#
# Usage for debug webserver:
# $ ./app.py
@kylemanna
kylemanna / android-ca-cert-hash.sh
Last active Jan 22, 2022
Generate hash file name for Root CAs on Android. Handy for things like mitmproxy.
View android-ca-cert-hash.sh
CERT=$1
NAME=$(openssl x509 -in $HOME/.mitmproxy/mitmproxy-ca-cert.cer -subject_hash_old -noout)
cp ${CERT} ${OUT}/system/etc/security/cacerts/${NAME}.0
@kylemanna
kylemanna / list-non-dependent-pkgs-by-size.sh
Last active Jan 15, 2022
Arch Linux: List packages installed without a dependency sorted by size
View list-non-dependent-pkgs-by-size.sh
#!/bin/bash
pacman -Qi | awk '/^Name/{name=$3} /^Required By/{req=$4} /^Installed Size/{print $4$5, name, req}' | grep None | sort -h