Skip to content

Instantly share code, notes, and snippets.

@kk7ds
kk7ds / osgatelog
Last active March 1, 2024 16:35
Tool to fetch, convert and display openstack gate job journals
#!/bin/bash
# Usage: call with a base url to a gate job log, like:
# https://zuul.opendev.org/t/openstack/build/83d6dc665c2643f88d0025c385987c92
#
# Any other arguments go to the journalctl
URL="$1"
shift
uuid=$(echo $URL | cut -d / -f 7)
Data:
-----CODE START-----
// [WRITE THE DEVICE NAME HERE]
rf.register_Receiver(
<unmanaged encoding>, // mod
65535, // initseq
0, // lo_prefix
0, // hi_prefix
0, // first_lo_ign
@kk7ds
kk7ds / pronto2broadlink.py
Last active January 30, 2022 23:00 — forked from appden/pronto2broadlink.py
Convert Pronto IR hex codes to LIRC pulses then Broadlink packets compatible with python-broadlink
#!/usr/bin/python3
# Copyright 2022 Dan Smith <dsmith+kpc3@danplanet.com>
#
# This monitors an aprx rflog and compares packets heard on multiple
# interfaces to make sure they arrive reasonably close. It is intended
# to monitor a troublesome kpc3+ to make sure the packets received via
# it and APRSIS are close together. When using this, enable a wide
# range filter on your aprsis connection so that you receive things
# back from APRSIS you are likely to hear on RF.
#!/usr/bin/python3
# Copyright 2021 Dan Smith <kk7ds+wxbeacon@danplanet.com>
#
# APRS NWS alert bulletin agent
#
# This attempts to provide one APRS bulletin message per execution for
# any NWS alerts active for the given area and zone(s). The expected
# usage is as an exec beacon for aprx, scheduled every ten minutes or
# so. Each new NWS alert will be emitted once as a bulletin until it
import logging
import threading
import requests
# This is my dedicated house module. It's private, and includes details I
# can't share for obvious reasons. It has an Events module that ends up sending
# things to MQTT, but used to send them to a different bus technology before
# I moved to MQTT.
import myhouse
from nx584 import model
import json
import pprint
import sys
import requests
HOST = 'https://review.opendev.org'
ZUUL = 'https://zuul.opendev.org'
JOBCACHE = {}
def get_gerrit_json(path):
#!/usr/bin/python3 -u
#
# Copyright Dan Smith <dsmith+ustopo@danplanet.com>
#
# This downloads USGS topo GeoPDF maps in bulk, by default the current
# high-resolution 7.5-minute maps. For reference, all of Oregon comes to
# 96GB, all of Washington is 78G. For each state, the index will be downloaded
# into the root of the per-state directory, which is how you find which
# section map you need, by name.
#
import logging
import re
import struct
import subprocess
import sys
Mi = 1024 * 1024
LOG = logging.getLogger(__name__)
import collections
import logging
import json
import sys
import threading
import time
from oslo_config import cfg
import oslo_messaging