Skip to content

Instantly share code, notes, and snippets.

@lachesis
lachesis / protocols.txt
Created March 18, 2024 15:12
Alarm reporting protocols described by KJ7BZC
Contact ID, Ademco High Speed, Ademco Express:
-dualtone handshake
-1400hz acknowledgement
-10 digits per second dtmf data
Acron, Scancom/Scantronic 4+3+3, FBI Superfast, DSC/SG 4+3:
-2300hz handshake
-2300hz acknowledgement
-10 digits per second dtmf data
@lachesis
lachesis / telpwgen.py
Created March 10, 2024 21:09
Tiny script to generate secure passwords that are easy to type quickly on telephone keypads
#!/usr/bin/env python3
import secrets
import sys
letters = [
'abc',
'def',
'ghi',
'jkl',
'mno',

Overview

Here's some docs on how I connected to OCTOI using a Raspberry Pi, an icE1usb, and my Cisco 2921 voice router.

Getting a config file

I contacted LaF0rge from #retronetworking on libera.chat. He asked me to email him at (redacted).

@lachesis
lachesis / adit-failover.py
Created March 2, 2024 22:38
Adit 600 failover
#!/usr/bin/env python3
"""
Failover between T-1s for an Adit 600.
When called with no arguments, connect to Adit 600 mgmt
via Telnet, introspect the current status of both A T-1s,
and update connections to PRIMARY/SECONDARY T-1.
When called with "snmptrap" as argument, first update the
state internally based on the issued alarms, then blindly
@lachesis
lachesis / bulkvs-search.py
Last active February 6, 2024 20:35
BulkVS bulk number download tool
#!/usr/bin/env python
# downloads a list of BulkVS phone numbers and writes them out as a CSV to stdout
# developed on python3.11, but should work in any modern python3
# before running, install deps:
# virtualenv venv
# source ./venv/bin/activate
# pip install --upgrade aiohttp aiohttp-client-cache
# supply env vars with your BULKVS_EMAIL and BULKVS_APIKEY
# delete "cache.sqlite" to clear the HTTP cache, otherwise it's indefinite
# this takes hours to run, downloads 500MB to 30GB, and makes 30k+ network requests to BulkVS
@lachesis
lachesis / ephemp2p.py
Created July 17, 2023 15:10
python client for https://github.com/losvedir/ephemeral2, just playing with websockets
#!/usr/bin/python2
import collections
import hashlib
import json
import logging
import os
import time
import websocket
@lachesis
lachesis / flipper-ir-fan.py
Created June 13, 2023 23:06
Flipper IR explorations
#!/usr/bin/env python3
# Uses flipper as an IR blaster to drive my Bionaire window fan into the desired state
# Also uses my Kasa plug to reset the fan into a known starting state
# deps: pip install pyflipper
# the remote protocol does on-off keying (i.e. ASK) of an IR carrier
# the carrier is a 38 KHz square wave with a 33% duty cycle
# (the fan still seems to work with a 50% duty cycle as well)
# the signal has a base period time T that I have rounded to 400ms
# the following symbols are used:
#!/usr/bin/python
# Get Duke Energy electricity usage information. Needs lxml and requests. Supply info in envvars
import os
import json
import re
import datetime
import requests
import lxml.etree
#!/usr/bin/python3
# Only requirement: pip install pyusb
# Run as root
# Might need to detach from the kernel driver?
import sys
import json
import usb.core
import usb.util
def init(dev):
@lachesis
lachesis / nws-forecast.py
Created May 18, 2022 21:14
NWS weather forecast, hourly for next 7 days
#!/usr/bin/python3
import datetime
import hashlib
import itertools
import os
import socket
from pprint import pprint
import dateutil.parser
import lxml.etree