Skip to content

Instantly share code, notes, and snippets.

View nobrowser's full-sized avatar

Ian Zimmerman nobrowser

View GitHub Profile
@nobrowser
nobrowser / mtk_refclock.py
Created March 20, 2024 02:53
A daemon to read data off an Adafruit/Mediatek GPS module (over I2C) and feed it to chrony refclock SOCK
import board
import adafruit_gps
from struct import Struct
from time import time, sleep
from calendar import timegm
import sys
from argparse import ArgumentParser, ArgumentDefaultsHelpFormatter
from socket import socket, socketpair, AF_UNIX, SOCK_DGRAM
import json
@nobrowser
nobrowser / dune.bash
Last active November 27, 2022 18:14
Wrapper around dune to direct output to stdin and remove frills
#/usr/local/bin/bash -Cfu
# bash only because of PIPESTATUS
eval `opam env --shell=bash` || exit 1
unset INSIDE_EMACS
dune "$@" 2>&1 | cat
exit ${PIPESTATUS[0]}
17:Library $ sudo ls -lO Caches/
ls: com.apple.aned: Operation not permitted
total 0
drwxr-xr-x@ 3 root admin - 96 Jan 2 11:57 ColorSync
drwxr-xr-x 3 root admin - 96 Jan 2 11:57 Desktop Pictures
drwxr-xr-x@ 3 itz admin - 96 Feb 5 18:40 com.apple.cloudkit
drwx--x--x 925 _iconservices admin - 29600 Feb 5 11:43 com.apple.iconservices.store
#! /usr/bin/env perl
# This program parses the keysym definitions from a X11 source distribution
# and one or more XCompose specifications files (XCompose files mentioned
# later on the command line will override settings from those mentioned
# earlier). It then produces the same bindings (more or less) in the format
# suitable for a personal DefaultKeyBinding.dict file.
use strict;
use warnings;
@nobrowser
nobrowser / eclips.el
Created May 11, 2020 08:21
Periodically collect clipboard contents
;;; eclips.el --- periodically collect clipboard contents
;; This file is free software; you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation; either version 2, or (at your option)
;; any later version.
;; This file is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
@nobrowser
nobrowser / dig-browser.el
Created May 11, 2020 08:19
Parse the output of a DNS AXFR query and present it in tabular format in a buffer
;;; NEWS in this version:
;;; fixed bug in expand/collapse code (subtrees of depth > 1 should
;;; remember their state)
;;; IPv6 addresses sort correctly now
;;; dig-browser.el --- a dired-style DNS zone browser
;; Copyright (C) 2002 Ian Zimmerman
;; Author: Ian Zimmerman <itz@speakeasy.org>
@nobrowser
nobrowser / deleterious.el
Created May 11, 2020 08:15
Emacs global minor mode to replace kill-FOO commands with delete-FOO (useful when I don't want to touch the kill ring)
;;; deleterious.el --- minor move to delete things instead of killing them
;; Copyright (C) Ian Zimmerman 2015
;; Terms: GNU General Public License, Version 2
(require 'thingatpt)
(defconst deleterious-mode-map
(let ((k (make-sparse-keymap)))
(define-key k [remap kill-region] 'delete-region)
@nobrowser
nobrowser / Bijections_group.v
Created September 25, 2019 05:58
A proof in Coq/Ssreflect (with classical axioms) that all bijections on a type form a group, without assuming finiteness
From mathcomp Require Import ssreflect ssrfun ssrbool.
Require Import FunctionalExtensionality.
Require Import ClassicalEpsilon.
Require Import PropExtensionality.
Require Import ZArith.
Set Implicit Arguments.
Unset Strict Implicit.
Unset Printing Implicit Defensive.
Require Import Utf8.
@nobrowser
nobrowser / select-window.pl
Created July 9, 2019 01:26
Choose a window ID under bspwm via dmenu
#! /bin/sh localperl
# This is actually -*-Perl-*- code
use strict;
use warnings;
use FileHandle;
use IPC::Open2;
use Getopt::Long;
use Text::Shorten qw(shorten_scalar);
use X11::Xlib;
@nobrowser
nobrowser / lemonbar-source.pl
Created July 9, 2019 01:23
Script to feed lemonbar, with as few external processes as possible
#! /bin/sh localperl
# This is now a -*-Perl-*- script
use strict;
use warnings;
use File::Slurp;
use POSIX qw(strftime);
use X11::Xlib;
use X11::Xlib::Display;