Skip to content

Instantly share code, notes, and snippets.

View 4z3's full-sized avatar
🦀
computering hard

tv 4z3

🦀
computering hard
View GitHub Profile
@4z3
4z3 / nix-haddock-index.sh
Last active September 4, 2019 06:54
nix-haddock-index.sh
#! /bin/sh
set -euf
# TODO NIX_GHC=$(type -P ghc) NIX_GHC_DOCDIR=$(dirname $(dirname $(type -P ghc)))/share/doc/ghc/html
# if unset: this is for e.g. emse-hdsb
main() {
pkg=$(dirname $(dirname $NIX_GHC))
@4z3
4z3 / vim.vim
Last active August 29, 2015 14:05
Vim 256-color colorscheme editing config
" show syntax highlight group
fu ShowSyntax ()
let id = synID(line("."), col("."), 1)
let name = synIDattr(id, "name")
let transName = synIDattr(synIDtrans(id),"name")
if name != transName
let name .= " (" . transName . ")"
endif
return name
endfu

Keybase proof

{
    "body": {
        "key": {
            "fingerprint": "dfc654d26a794b53e9d2052f6734ac8d34cfa5a8",
            "host": "keybase.io",
            "key_id": "6734ac8d34cfa5a8",
            "uid": "92b9f4e0eef5154d8b59cf82dcb70a00",
            "username": "tv"
@4z3
4z3 / gist:1033129
Created June 18, 2011 14:16
Fix TTY job-control
#? /bin/sh
#
# Fix TTY job-control
#
# source: Internet
#
# Let's try this:
exec </dev/tty1 >/dev/tty1 2>&1
# No, doesn't work: even if opening /dev/tty1 gave sh the ctty,
@4z3
4z3 / retiolum-subnet-list
Created April 24, 2011 20:54
scrape retiolum's subnet list from syslog[-ng]
#! /bin/sh
set -euf
tempfile=`tempfile`
trap "rm $tempfile" EXIT
inotail -n 0 -f /var/log/syslog.log |
sed -rn '
/tinc\.retiolum/!b
/.*: Subnet list:$/,/.*: End of subnet list\.$/{
@4z3
4z3 / gist:790604
Created January 21, 2011 23:01
Temporary queue up messages
// Temporary publish() to queue up messages until connection to Genericore
// is ready.
var publish_queue = [];
var publish_enqueue = function (message) {
publish_queue.push(message);
log('enqueue: ' + publish_queue.length);
};
var publish = publish_enqueue;