Skip to content

Instantly share code, notes, and snippets.

View drbild's full-sized avatar

David R. Bild drbild

View GitHub Profile
@drbild
drbild / README-python-service-on-systemd-activated-socket.md
Created October 4, 2018 15:43 — 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

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 /opt/foo/serve.py.

@drbild
drbild / generate-persistent-net-rules.sh
Last active February 9, 2024 21:12
Generate udev rules for persistent interface names by bus path, not mac address
#!/bin/sh -e
# Copyright (C) 2006 Marco d'Itri <md@Linux.IT>
# Copyright (C) 2007 Kay Sievers <kay.sievers@vrfy.org>
# Copyright (C) 2018 David R. Bild <david.bild@xaptum.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 2 of the License, or
# (at your option) any later version.

Keybase proof

I hereby claim:

  • I am drbild on github.
  • I am drbild (https://keybase.io/drbild) on keybase.
  • I have a public key whose fingerprint is 26DA 6575 70FF 5E7B DC2F E04F ED91 16D5 87F1 1666

To claim this, I am signing this object: