Skip to content

Instantly share code, notes, and snippets.

View coddingtonbear's full-sized avatar

Adam Coddington coddingtonbear

View GitHub Profile
import argparse
import csv
import dataclasses
import datetime
import os
import sqlite3
import sys
import time
from typing import Iterator
{
// See https://go.microsoft.com/fwlink/?linkid=733558
// for the documentation about the tasks.json format
"version": "2.0.0",
"tasks": [
{
"label": "Run all tests (mark problems)",
"type": "shell",
"group": {
"kind": "test",
@coddingtonbear
coddingtonbear / dontforget.bash
Last active April 21, 2017 17:52 — forked from ttscoff/dontforget.bash
Quick reminders from Terminal (bash); Added support for OSX notifications (instead of using LaunchBar.app).
#!/bin/bash
# dontforget
#
# A stupid script for short term reminders in bash
#
# Arguments just need to contain a number and a bunch of words.
#
# The number can be anywhere in the arguments, but there shouldn't
# be any other numeric digits.
#
@coddingtonbear
coddingtonbear / dstarrepeater_ircddbgateway.conf.rst
Created January 19, 2016 00:33
Detailed overview of settings used for DStarRepeater and IRCDDBGateway for HackRFBridge.

DStarRepeater and IRCDDBGateway are together responsible for handling the process of routing D-Star audio to and from the D-Star network. The configuration process for these two things can be a little confusing, so I've below described what settings I've set in each so if you were to try to do something similar, you'd know what I had working.

Following the same pattern as the above; for IRCDDBGateway, you can launch ircddbgatewayconfig and enter the following settings. As above, you can leave any unmentioned settings at their defaults:

  • Gateway
    • Type: "Hotspot"
    • Local HB Address: "127.0.0.1" (note that HB in all situations here means "Homebrew repeater")
    • Local HB Port: "20010"
@coddingtonbear
coddingtonbear / twoline-logwatch.conf.json
Last active November 16, 2015 16:12
A simple configuration for twoline-logwatch that watches for certain Dstarrepeater messages
{
"files": {
"/var/log/opendv/*": {
"M:.*Transmitting to - My: (?P<callsign>[A-Za-z0-9-_]+)[ ]*/(?P<suffix>[A-Za-z0-9-_]*).*Flags: 00.*": {
"message": "Transmitting\r{callsign}/{suffix}",
"color": [255, 0, 0],
"expires": 180,
"meta": {
"message_name": "logwatcher-opendv-tx"
}
@coddingtonbear
coddingtonbear / serializer.py
Created June 5, 2014 20:02
Adam's Lovely-but-now-about-to-be-abandoned Serializer
import json
from django.core import serializers
from django.core.serializers.json import DjangoJSONEncoder
from django.db.models import Model
from django.db.models.query import QuerySet
from django.template import (
Context, Library, Node, TemplateSyntaxError, Variable
)
from django.utils.safestring import mark_safe
This file has been truncated, but you can view the full file.
[
{
"docAuthors": [],
"docDate": [],
"docTitle": [
{
"Str": "Why"
},
"Space",
{