+++ /dev/null
-#! /bin/sh -e
-# Work out Bazaar archive names for branches or tags of the current
-# directory.
-
-WANTED="$1"
-ME="$(baz tree-version)"
-
-if [ "$WANTED" ]; then
- ARCHIVE="$(baz parse-package-name --arch "$ME")"
- CATEGORY="$(baz parse-package-name --category "$ME")"
- case $WANTED in
- *--*)
- echo "$ARCHIVE/$CATEGORY--$WANTED"
- ;;
- *)
- VERSION="$(baz parse-package-name --vsn "$ME")"
- echo "$ARCHIVE/$CATEGORY--$WANTED--$VERSION"
- ;;
- esac
-else
- echo "$ME"
-fi
+++ /dev/null
-#! /bin/sh -e
-# Same as 'baz resolved', but also cleans up .orig and .rej files.
-
-baz resolved "$@"
-
-for file; do
- rm -f "$file.orig" "$file.rej"
-done
+++ /dev/null
-#! /bin/sh -e
-
-usage () {
- cat <<EOF
-$0 [options] VERSION
-
-Options:
- -n, --no-act Don't tag; just print the command that would be run.
-
-EOF
-}
-
-NOACT=
-
-if ! eval set -- "$(getopt -o n -l help,no-act -- "$@")"; then
- usage >&2
- exit 1
-fi
-
-while :; do
- case $1 in
- --help) usage; exit 0 ;;
- -n|--no-act)
- NOACT=echo
- shift
- ;;
- --) shift; break ;;
- *) usage >&2; exit 1 ;;
- esac
-done
-
-if [ $# -eq 0 ]; then
- VERSION="$(dpkg-parsechangelog | grep ^Version: | cut -d' ' -f2)"
-else
- VERSION="$1"
-fi
-
-$NOACT baz branch "$(bazpath)" "$(bazpath "releases--$VERSION")"
ROOT='http://subversion.tigris.org/issues'
;;
openssh)
- ROOT='http://bugzilla.mindrot.org'
- ;;
- warthogs)
- ROOT='http://bugzilla.warthogs.hbd.com/bugzilla'
- ;;
- ubuntu)
- ROOT='http://bugzilla.ubuntu.com'
+ ROOT='https://bugzilla.mindrot.org'
;;
gnome)
ROOT='http://bugs.gnome.org'
;;
mozilla)
- ROOT='http://bugzilla.mozilla.org'
+ ROOT='https://bugzilla.mozilla.org'
;;
redhat)
ROOT='http://bugzilla.redhat.com/bugzilla'
;;
kernel)
- ROOT='http://bugzilla.kernel.org'
+ ROOT='https://bugzilla.kernel.org'
;;
freedesktop)
ROOT='http://bugs.freedesktop.org'
echo "Unknown Bugzilla installation '$1'. Recognized are:" >&2
echo ' subversion' >&2
echo ' openssh' >&2
- echo ' warthogs' >&2
- echo ' ubuntu' >&2
echo ' gnome' >&2
echo ' mozilla' >&2
echo ' redhat' >&2
# Depends: wget
mkdir -p "$HOME/misc/rfc"
cd "$HOME/misc/rfc"
-[ -f "rfc$1.txt" ] || wget "http://www.ietf.org/rfc/rfc$1.txt"
+[ -f "rfc$1.txt" ] || wget "https://www.ietf.org/rfc/rfc$1.txt"
${PAGER:-pager} "rfc$1.txt"
#! /bin/sh
set -e
unset http_proxy
-DEB_MIRROR=${DEB_MIRROR:-ftp.se.debian.org}
+DEB_MIRROR=${DEB_MIRROR:-ftp.uk.debian.org}
debmirror /mirror/debian -h "$DEB_MIRROR" --method http \
- --dist=wheezy,jessie,sid,experimental \
+ --dist=buster,bullseye,sid,experimental \
--section=main,main/debian-installer \
- --arch=i386 --getcontents \
+ --arch=amd64 --getcontents \
--rsync-extra=doc,indices,tools,trace \
--i18n \
+ --keyring=/usr/share/keyrings/debian-archive-keyring.gpg \
--exclude='i18n/Translation-' --include='i18n/Translation-en' \
"$@"
+++ /dev/null
-#!/bin/sh
-# Depends: gs
-
-# This script virginizes (de-fucks) StarOffice postscript, for use in
-# mpage and other tools.
-# Author: Karsten M. Self
-# Date: Tuesday, November 28, 2000
-# Credits: George Smiley (georgesmiley@my-deja.com) for the idea
-# License: This work is public domain
-# ----------------------------------------
-# Arguments: $1= infile, $2= outfile
-# ----------------------------------------
-
-if [ X$1 = "X" -o X$2 = "X" ]; then
- echo "usage: $( basename $0 ) infile outfile" 1>&2; exit 1
-fi
-
-export PATH=/usr/bin:/bin
-TMPFILE=$( mktemp /tmp/sops1.XXXXXX ) || exit 1
-trap 'rm -f $TMPFILE; exit 1' 1 2 3 13 15
-
-ps2ps $1 $TMPFILE && ps2ps -dLanguageLevel=1 $TMPFILE $2
-rm -f $TMPFILE
--- /dev/null
+#! /usr/bin/python3
+
+from argparse import ArgumentParser
+from email.message import EmailMessage
+import io
+import json
+from smtplib import SMTP
+import statistics
+
+import requests
+import toml
+
+
+def fetch_data():
+ # Fetch new case counts for Cambridgeshire.
+ data = requests.get(
+ "https://api.coronavirus.data.gov.uk/v1/data",
+ params={
+ "filters": "areaType=utla;areaName=Cambridgeshire",
+ "structure": json.dumps(
+ ["date", "newCasesBySpecimenDate"], separators=(",", ":")
+ ),
+ },
+ ).json()["data"]
+
+ # Skip the first three days of the response. This seems to be what the
+ # website does, presumably because recent dates don't have reliable
+ # enough numbers yet.
+ data = data[3:]
+
+ last_week = data[:7]
+ mean = statistics.mean([new_cases for _, new_cases in last_week])
+ return last_week, mean
+
+
+def main():
+ parser = ArgumentParser()
+ parser.add_argument(
+ "--config", type=toml.load, default={},
+ help="Configuration file (TOML format)")
+ parser.add_argument("--email", action="store_true")
+ args = parser.parse_args()
+
+ last_week, mean = fetch_data()
+ formatted = io.StringIO()
+ print(
+ "Most recent week's worth of new cases in Cambridgeshire, "
+ "by specimen date:",
+ file=formatted)
+ print(file=formatted)
+ print(f"Mean: {mean:.1f}", file=formatted)
+ for date, new_cases in last_week:
+ print(f"{date}: {new_cases}", file=formatted)
+ if args.email and "email" in args.config:
+ new_cases_message = EmailMessage()
+ new_cases_message["From"] = args.config["email"]["from"]
+ new_cases_message["To"] = ", ".join(args.config["email"]["to_always"])
+ new_cases_message["Subject"] = f"Cambridgeshire case count: {mean:.1f}"
+ new_cases_message.set_content(formatted.getvalue())
+ with SMTP("localhost") as smtp:
+ smtp.send_message(new_cases_message)
+ else:
+ print(formatted.getvalue(), end="")
+
+
+if __name__ == "__main__":
+ main()