Skip to content

Instantly share code, notes, and snippets.

@mat813
mat813 / send-to-encrypted.sh
Created Jan 7, 2021
Script to send from an unencrypted zfs pool to an encrypted zfs pool
View send-to-encrypted.sh
#!/bin/sh
set -e
set -u
send=$1
receive=$2
echo "from $send"
echo "to $receive"
@mat813
mat813 / batch_stream.js
Created Nov 9, 2020
Batch transform stream javascript
View batch_stream.js
const { Transform } = require('stream');
const batchStream = (batchSize = 5) => {
let batch = [];
return new Transform({
objectMode: true,
transform(data, _, done) {
batch.push(data);
@mat813
mat813 / convert.pl
Last active Jan 12, 2017
Convert a directory containing zone files into a dlz directory
View convert.pl
#!/usr/bin/env perl
#
use 5.008;
use utf8;
use strict;
use warnings;
use File::Spec;
use File::Path qw(make_path);
@mat813
mat813 / export-import.sh
Created Nov 21, 2016
Export/Imports commits from/to a git branch
View export-import.sh
for i in $(git branch|cut -b 3-|sed -e '/^trunk$/d;/^svnadmin$/d')
do
mkdir -p ../patch/$i
git format-patch -o ../patch/$i origin/trunk..$i
git show $(head -1 ../patch/$i/0001-*|awk '{print $2}')~1|grep git-svn-id > ../patch/$i/rev-svn
done
for i in $(find ../patch -name rev-svn|sed -e 's/^..\/patch\///;s/\/rev-svn$//')
do
rev=$(sed -e 's/.*@\([[:digit:]]*\) .*/\1/' ../patch/$i/rev-svn)
@mat813
mat813 / LICENSE
Last active Jan 7, 2019
Scripts around acme_tiny to manage keys, requests, certificates...
View LICENSE
Copyright (c) 2016 Mathieu Arnold. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
@mat813
mat813 / build.sh
Last active Aug 29, 2015
Build the FreeBSD docs
View build.sh
#!/bin/sh
# Needs sysutils/watchman, textproc/jq
set -e
BUILD_OBJ=/usr/home/mat/work/freebsd/doc-obj
watchman watch ${PWD} > /dev/null
# Subscribe to changes in $PWD, don't care about anything it returns,
@mat813
mat813 / shuffle.sh
Created Apr 10, 2015
Use pdftk to shuffle even and reverse odd scanned pages in a single document
View shuffle.sh
#!/bin/sh
if [ `expr $# % 2` -ne 0 ]
then
echo "odd number of arguments"
exit 1
fi
while [ $# -gt 0 ]
do
View keybase.md

Keybase proof

I hereby claim:

  • I am mat813 on github.
  • I am mat (https://keybase.io/mat) on keybase.
  • I have a public key whose fingerprint is 3AB6 9789 D2ED 1210 6440 BA5B 3A45 16F3 5183 CE48

To claim this, I am signing this object:

View Makefile
# $Abso: Makefile,v 55f370ca4feb 2013/08/27 12:21:04 hg $
all: commit unsigned sign
SIGNED!= find -s * -name '*.signed'
sign: ${SIGNED}
COMMIT?=Update
UNSIGNED=/usr/local/var/opendnssec/unsigned/
@mat813
mat813 / change-ns.rb
Last active May 30, 2017
OpenDNSSEC to SmallRegistry
View change-ns.rb
#!/usr/bin/env ruby
# frozen_string_literal: true
# vim:sw=2 sts=2:
require 'rubygems'
require 'dnsruby'
require 'epp-client/smallregistry'
require 'awesome_print'
require 'getoptlong'