Skip to content

Instantly share code, notes, and snippets.

View nobrowser's full-sized avatar

Ian Zimmerman nobrowser

View GitHub Profile
@nobrowser
nobrowser / cron.py
Last active September 29, 2017 15:28
Save wireless neighborhood scans to a database
#! /usr/bin/python3
import sys
import subprocess as SP
import json
import time
import sqlite3 as SQL
DIRECT_FIELDS = 'address essid quality channel encrypted wpa wpa2'.split();
DIRECT_PLACES = [':' + df for df in DIRECT_FIELDS]
#! /bin/sh -Cefu
. /usr/local/bin/mashlib.sh
vconc OPAM $HOME /bin/opam
vconc REALPROG $HOME /.opam/ $($OPAM switch show) /bin/ocamlbuild
CURDIR=$PWD
while : ; do
if exists $PWD/_tags ; then break ; fi
@nobrowser
nobrowser / grokplaces.sh
Created October 23, 2017 21:12
Replicate palemoon (and firefox?) places database
#! /bin/sh -Cefu
. /usr/local/etc/foolinux-pathconfig ; . $FOOLINUX_BIN_PATH/mashlib.sh
PROFILE=${1:-default}
vconc PROFILEDIR $HOME '/.moonchild productions/pale moon/' $PROFILE .profile
vconc PLACES $PROFILEDIR / places.sqlite
vconc PLACESWAL $PLACES -wal
vconc PLACESSHM $PLACES -shm
@nobrowser
nobrowser / message-id-filter.pl
Created November 21, 2018 23:57
Run a mail search program and get message-ids from result filenames
#! /usr/bin/env perl
use strict;
my $indexer = $ENV{'MAIL_INDEXER'} || 'mairix';
sub snag_msgid {
open (my $mail, "<$_[0]");
if (!$mail) {
warn("failed to open $_[0]: $!");
@nobrowser
nobrowser / perlsuck.pl
Last active December 9, 2018 07:00
Perl code to download netnews articles via NNTP in batch
#! /usr/bin/env perl
use strict;
use warnings;
use Net::NNTP;
use Getopt::Long qw(:config no_permute);
use Fcntl;
$main::usage = <<'EOF'
@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;
@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 / 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 / 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)