Skip to content

Instantly share code, notes, and snippets.

@Chris-hughes10
Chris-hughes10 / timm.ipynb
Last active February 15, 2025 19:52
timm.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@stueja
stueja / lxd-wayland-gui.md
Last active January 9, 2025 16:41
GUI application via Wayland from Ubuntu LXD container on Arch Linux host
@drmalex07
drmalex07 / README-setup-socket-activated-systemd-service.md
Last active November 30, 2024 21:36
An example inetd-like socket-activated service. #systemd #inetd #systemd.socket

README

This is an example of a socket-activated per-connection service (which is usually referred to as inetd-like service). A thorough explanation can be found at http://0pointer.de/blog/projects/inetd.html.

Define a socket unit

The key point here is to specify Accept=yes, which will make the socket accept connections (behaving like inetd) and pass only the resulting connection socket to the service handler.

@drmalex07
drmalex07 / README-python-service-on-systemd-activated-socket.md
Last active January 20, 2025 10:48
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.

@lanceliao
lanceliao / OpenWrt-Package-Downloader.py
Last active June 3, 2020 17:50
Cache all packages from OpenWrt trunk repository
#!/usr/bin/env python
#coding=utf-8
#
# Openwrt Package Grabber
#
# Copyright (C) 2014 http://www.shuyz.com
#
import urllib2
import re