--- /dev/null
+#!/usr/bin/python3
+
+import sys, getopt, subprocess, re
+
+def usage(out):
+ out.write("usage: gpgrep PATTERN FILENAME\n")
+
+opts, args = getopt.getopt(sys.argv[1:], "h")
+for o, a in opts:
+ if o == "-h":
+ usage(sys.stdout)
+ sys.exit(0)
+if len(args) < 2:
+ usage(sys.stderr)
+ sys.exit(1)
+
+try:
+ pattern = re.compile(args[0], re.IGNORECASE)
+except Exception as exc:
+ sys.stderr.write("gpgrep: %s: %s\n" % (args[0], exc))
+ sys.exit(1)
+try:
+ efp = open(args[1], "r")
+except OSError as exc:
+ sys.stderr.write("gpgrep: %s: %s\n" % (args[1], exc.strerror))
+ sys.exit(1)
+with efp, subprocess.Popen(["gpg", "--quiet", "--decrypt", "--armor"], stdin=efp, stdout=subprocess.PIPE, universal_newlines=True) as gpg:
+ try:
+ for line in gpg.stdout:
+ line = line.rstrip()
+ if len(line) > 0 and not line[0].isspace() and pattern.search(line):
+ sys.stdout.write("%s\n" % (line))
+ for line in gpg.stdout:
+ line = line.rstrip()
+ if line == "" or not line[0].isspace():
+ break
+ sys.stdout.write("%s\n" % (line))
+ sys.exit(0)
+ sys.exit(1)
+ finally:
+ gpg.stdout.close()
+ if gpg.wait() != 0:
+ sys.stderr.write("gpgrep: gpg failed\n")
+ sys.exit(1)
--- /dev/null
+#!/bin/sh
+
+set -e
+
+if [ $# -lt 1 ]; then
+ echo "usage: gpvi FILENAME" >&2
+ exit 1
+fi
+
+file="$1"; shift
+
+rcpt="$(gpg --batch --quiet --decrypt --list-only --status-fd 1 <"$file" | sed -n '/^\[GNUPG:\]/s/^.*ENC_TO \([^ ]*\) .*$/-r \1/p')"
+tf="$(mktemp /tmp/gpvi.XXXXXX)"
+
+gpg --quiet --decrypt --armor <"$file" >"$tf"
+omd5="$(md5sum "$tf")"
+vi -n "$tf"
+nmd5="$(md5sum "$tf")"
+if [ "$omd5" != "$nmd5" ]; then
+ gpg --quiet --encrypt --armor $rcpt <"$tf" >"${file}.new"
+ rm -f "$file~"
+ ln "$file" "$file~"
+ mv "${file}.new" "$file"
+else
+ echo "gpvi: file left unchanged, not overwriting old" >&2
+fi
+
+shred -u "$tf"
#include <errno.h>
#include <pthread.h>
+static void *spin_snb(void *uu)
+{
+ char __attribute__((aligned(32))) m[2][32];
+
+ asm("vpxor %%xmm1, %%xmm1, %%xmm1;\n"
+ "vpxor %%xmm2, %%xmm2, %%xmm2;\n"
+ "0:\n"
+ "vmovaps (%0), %%ymm0;\n"
+ "vmovaps %%ymm1, (%1);\n"
+ "vaddps %%ymm1, %%ymm1, %%ymm2\n"
+ "vmulps %%ymm3, %%ymm3, %%ymm4\n"
+ "vmovaps (%0), %%ymm0;\n"
+ "vmovaps %%xmm1, (%1);\n"
+ "vaddps %%ymm1, %%ymm1, %%ymm2\n"
+ "vmulps %%ymm3, %%ymm3, %%ymm4\n"
+ "vmovaps (%0), %%ymm0;\n"
+ "vaddps %%ymm1, %%ymm1, %%ymm2\n"
+ "vmulps %%ymm3, %%ymm3, %%ymm4\n"
+ "jmp 0b;\n"
+ :
+ : "r" (&m[0]), "r" (&m[1])
+ : "rax", "rcx");
+ abort();
+}
+
static void *spin(void *uu)
{
while(1) {
debug=y
;;
-t)
- cmdline=("${cmdline[@]}" -ao 'alsa:device=[hw:3,7]')
+ cmdline=("${cmdline[@]}" -audio-device 'alsa/hdmi:CARD=PCH,DEV=0')
DISPLAY=:1
chwp=y
;;