Monitor BLE devices using Bluez and D-Bus.
- Bluez >= 5.56
- Linux Kernel >= 5.10
http_port 3128 | |
refresh_pattern -i .rpm$ 129600 100% 129600 refresh-ims override-expire | |
refresh_pattern -i .iso$ 129600 100% 129600 refresh-ims override-expire | |
refresh_pattern -i .deb$ 129600 100% 129600 refresh-ims override-expire | |
refresh_pattern -i .whl$ 129600 100% 129600 refresh-ims override-expire | |
refresh_pattern ^ftp: 1440 20% 10080 | |
refresh_pattern ^gopher: 1440 0% 1440 | |
refresh_pattern -i (/cgi-bin/|\?) 0 0% 0 | |
refresh_pattern . 0 20% 4320 |
"""Usage: | |
def get_listener(request: Request) -> Listener: | |
'''Function used to access listener from the application state.''' | |
return request.app.state.listener | |
def set_listener(app: FastAPI, url: str) -> None: | |
'''Function to be called once on application startup.''' |
This gist describes how to install azure-cli with Ansible.
Disclaimer: Code has not been tested so it may not work, but the intent is still clear.
Reference: Azure/azure-cli#20476 (note that issue has been opened by an engineer working at Microsoft on Azure CLI, so I take it as "it's ok to install azure-cli with pip assumning you don't have problem with using Pypi".)
#!/usr/bin/env bash | |
set -euo pipefail | |
ROLES=$(az role assignment list --query '[].{id:id, principalName:principalName}' --all) | |
IDS=$(echo $ROLES | jq -r '.[] | select(.principalName == "") | .id') | |
for ID in $IDS; do | |
echo "Removing role with unknown user: $ID" | |
az role assignment delete --ids "$ID" & |
This gist is an attempt to design a Python API to implement a distributed IoT solution composed of:
RemoteDevice
and RemoteStation
useful when interacting with IoT devices and stations#!/usr/bin/env bash | |
function natsConf() { | |
echo -e "websocket { | |
# Specify a host and port to listen for websocket connections | |
host: localhost | |
port: 10443 | |
no_tls: true | |
} |
""" | |
Two classes: | |
- OIDCAuthenticator | |
- OIDCClientAuthenticator | |
Dependencies: | |
- PyJWT: API to decode JWT tokens | |
- cryptography: Cryptography algorithms | |
- pydantic: JSON validation library | |
- httpx: Async HTTP client |
import os | |
from pathlib import Path | |
from typing import Callable, Optional | |
from fastapi import FastAPI | |
from starlette.applications import Starlette | |
from starlette.routing import Mount | |
from starlette.staticfiles import StaticFiles | |
from starlette.types import Scope |