This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh -e | |
printf "Input (no echo):\n" >&2 | |
stty -echo; read -r Input; stty echo; printf "\n" >&2 | |
[ ${#Input} -gt 16 ] || exit 23 | |
Sha256=$(printf '%s' "$Input" | sha256sum | cut -d " " -f 1) | |
Prefix="3041020100301306072a8648ce3d020106082a8648ce3d030107042730250201010420" | |
BcIn=$(printf '%s%s' "$Prefix" "$Sha256" | tr a-f A-F | sed -e 's/../&;/g') | |
Fmt=$(printf 'obase=8;ibase=16;%s' "$BcIn" | bc | tr \\n \\ | sed -e 's/.$//' -e 's/^/\\/') | |
Base64=$(printf '%b' "$Fmt" | base64 -w 64) | |
printf '\055----BEGIN PRIVATE KEY-----\n%s\n-----END PRIVATE KEY-----\n' "$Base64" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env escript | |
%% -*- erlang -*- | |
%%! -smp enable | |
%% | |
-module(sendfile_tc). | |
-export([main/1]). | |
main([]) -> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- STARTING with an empty FreeBSD10.1 RELEASE on amd64, install gmake git and ocaml --- | |
root@FreeBSD10:~ # pkg info | |
pkg-1.3.8_3 Package manager | |
root@FreeBSD10:~ # pkg install devel/gmake devel/git lang/ocaml | |
Updating FreeBSD repository catalogue... | |
Fetching meta.txz: 100% 944 B 0.9k/s 00:01 | |
Fetching digests.txz: 100% 2 MB 688.7k/s 00:03 | |
Fetching packagesite.txz: 100% 5 MB 1.3M/s 00:04 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# | |
# install minimal tor jail | |
# | |
# prerequisites: | |
# | |
# * pkg(8) for pkg info and pkg query | |
# | |
# * security/tor package built with STATIC_TOR enabled | |
# or |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh -efu | |
usage() { | |
printf >&2 "usage: %s [-hvm] filesystem\n" "$0"; exit 1 | |
} | |
help() { | |
printf "usage: %s [-v] [-m] <filesystem>\n" "$0" | |
printf "recursively for all zfs filesystems starting with <filesystem>:\n" | |
printf " if property 'written' is not '0' and snapshots exists:\n" |