A "Best of the Best Practices" (BOBP) guide to developing in Python.
- "Build tools for others that you want to be built for you." - Kenneth Reitz
- "Simplicity is alway better than functionality." - Pieter Hintjens
| import socket | |
| import httplib | |
| import StringIO | |
| class SSDPResponse(object): | |
| class _FakeSocket(StringIO.StringIO): | |
| def makefile(self, *args, **kw): | |
| return self | |
| def __init__(self, response): | |
| r = httplib.HTTPResponse(self._FakeSocket(response)) |
| var dgram = require('dgram'); // dgram is UDP | |
| // Listen for responses | |
| function listen(port) { | |
| var server = dgram.createSocket("udp4"); | |
| server.on("message", function (msg, rinfo) { | |
| console.log("server got: " + msg + " from " + rinfo.address + ":" + rinfo.port); | |
| }); |
| #!/bin/sh | |
| # https://community.wd.com/t/guide-auto-removal-of-downloads-from-transmission-2-82/93156 | |
| # script to check for complete torrents in transmission folder, then stop and move them | |
| # either hard-code the MOVEDIR variable here… | |
| # MOVEDIR=/home/amhiserver/.box # the folder to move completed downloads to | |
| # …or set MOVEDIR using the first command-line argument | |
| # MOVEDIR=%1 | |
| # | |
| # auth | |
| # port, username, password |
| # tailscale under podman on fedora | |
| # tested on Fedora IOT (arm64 and amd64) and Silverblue (amd64). | |
| # !!! Not to be run as a script (contains reboot) !!! | |
| # ensure the tun module is loaded by default | |
| echo tun > /etc/modules-load.d/tun.conf | |
| # ensure iptables xt_mark module is enabled and loaded | |
| echo xt_mark > /etc/modules-load.d/xt_mark.conf | |
| # ensure iptables ip6table_filter module is enabled and loaded | |
| echo ip6table_filter > /etc/modules-load.d/ip6table_filter.conf | |
| # iptables rather than nftables, for compatibility |
| #!/bin/bash | |
| # repos | |
| sudo rpm-ostree install https://mirrors.rpmfusion.org/free/fedora/rpmfusion-free-release-$(rpm -E %fedora).noarch.rpm https://mirrors.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-$(rpm -E %fedora).noarch.rpm -y | |
| sudo sh -c 'echo -e "[repo-tuxedo-computers] | |
| name=TUXEDO Computers - 15.3 | |
| baseurl=https://rpm.tuxedocomputers.com/opensuse/15.3 | |
| path=/ |
| ❗ IMPORTANT: This gist is not actively maintained anymore. See https://github.com/cednore/ubuntu |
|---|
My personal environment setup guide on Ubuntu
https://github.com/recloudstream/cloudstream/