Skip to content

Instantly share code, notes, and snippets.

Avatar

Kyle Manna kylemanna

View GitHub Profile
@kylemanna
kylemanna / 0_README.md
Last active March 26, 2023 05:46
Bug notes for gluetun multiple networks issue.
View 0_README.md

README

Issue

The gluetun container doesn't work correctly with multiple networks attached.

This is an example of a working and broken config with only minor differences.

Expected Output

@kylemanna
kylemanna / arch-linux-install.md
Last active March 16, 2023 05:32 — 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 March 14, 2023 23:30 — 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.

@kylemanna
kylemanna / build-friendlywrt.md
Last active March 14, 2023 20:57
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 / connmanctl.md
Last active March 13, 2023 00:45
Connmanctl Cheat Sheet
View connmanctl.md
@kylemanna
kylemanna / gist:1376913
Created November 18, 2011 16:16
Reverse endianess on a binary file
View gist:1376913
#!/bin/sh
# Following command will reorder 32 bit words from little endian to big endian
#
# This is needed on TI81xx platforms to convert a standard LE bootloader/SPL/MLO
# to a byte ordering the works via SPI flash
arm-none-linux-gnueabi-objcopy -Ibinary --reverse-bytes=4 MLO MLO.spi
# Output:
# $ hexdump -C MLO | head -n2
@kylemanna
kylemanna / 7z+tar.md
Last active February 18, 2023 19:18
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 / purge.wolfram-engine.txt
Created August 2, 2014 21:46
Raspberry Pi + wolfram-engine => Wasted Space
View purge.wolfram-engine.txt
pi@rpi0 ~ $ sudo apt-get purge wolfram-engine
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages will be REMOVED:
wolfram-engine*
0 upgraded, 0 newly installed, 1 to remove and 0 not upgraded.
After this operation, 454 MB disk space will be freed.
Do you want to continue [Y/n]? y
(Reading database ... 77272 files and directories currently installed.)
@kylemanna
kylemanna / ingress.nft
Last active February 4, 2023 09:21
ATT UVerse Disable Drop DHCP for temproary 192.168.1.64 address on BGW320 and block Bogons/DDoS packets using nftables
View ingress.nft
#!/usr/sbin/nft -f
#
# Can't block DHCP like a normal service beacuse it use raw sockets and bypasses nftables filter chains. Instead use and ingress chain.
#
flush table netdev filter
table netdev filter {
# Earliest filtering chain
chain ingress {
type filter hook ingress device wan0 priority -500;
@kylemanna
kylemanna / serial-proxy.py
Created November 30, 2012 00:03
Serial Proxy Server
View serial-proxy.py
#!/usr/bin/env python
"""
This python script opens two serial ports, specified with arguments 1 and 2
on the command line. It forwards data between the two serial ports as if it's
just a wire.
Usage: ./serial-loopback.py /dev/ttyUSB0 /dev/ttyUSB1
"""
import sys