I hereby claim:
- I am hilbix on github.
- I am hilbix (https://keybase.io/hilbix) on keybase.
- I have a public key ASCx_F6R2C8_UowExr0c1ZZ6Fp37u8N3Jb0EjAoUWYNoUQo
To claim this, I am signing this object:
# Redirect lines of stdin/stdout to some other function | |
# outfn and errfn get following arguments | |
# "cmd args.." "one line full of output" | |
: catch outfn errfn cmd args.. | |
catch() | |
{ | |
local ret o1 o2 tmp | |
tmp=$(mktemp "catch_XXXXXXX.tmp") | |
mkfifo "$tmp.out" | |
mkfifo "$tmp.err" |
I hereby claim:
To claim this, I am signing this object:
server { | |
server_tokens off; | |
server_name _; | |
listen 80 default_server; | |
listen [::]:80 default_server; | |
set_real_ip_from 127.0.0.1; | |
real_ip_header X-Forwarded-For; | |
access_log /var/log/nginx/access.log; |
# This function keeps IO redirection and commandline arguments | |
# when you want to debug some executable. | |
# | |
# Just type "debug" in front of the call: | |
# "b u g" "${p[@]}" < <(in) 1> >(out) 2> >(two) 3> >(three) | |
# debug "b u g" "${p[@]}" < <(in) 1> >(out) 2> >(two) 3> >(three) | |
# | |
# All you need is a /dev/tty | |
debug() |
#!/bin/bash | |
VERS="$1" | |
OOPS() { echo "$*" >&2; exit 23; } | |
o() { "$@" || OOPS "exec $?: $*"; } | |
v() { local -n __var__="$1"; __var__="$("${@:2}")" || OOPS "exec $?: $*"; } | |
[ -n "$VERS" ] || read -p 'Version (like: 9.3.0): ' VERS || exit |
#!/bin/bash | |
# | |
# Public Domain | |
# | |
# If you follow https://wiki.debian.org/CrossGrading you might get stuck | |
# at the "apt-get install -f" step. Either you are doomed, or use this script here. | |
# | |
# Just run it to find out the troublesome :i386 packages. | |
# Then paste those packagenames to the script here to install the amd64 counterpart. | |
# Or press just return to run "apt-get install -f", |
#!/bin/bash | |
STDOUT() { local e=$?; printf '%q' "$1"; [ 1 -lt $# ] && printf ' %q' "${@:2}"; printf '\n'; return $e; } | |
STDERR() { STDOUT "$@" >&2; } | |
OOPS() { STDERR OOPS: "$@"; exit 23; } | |
x() { "$@"; } | |
o() { x "$@" || OOPS fail $?: "$@"; } | |
ID=72ECF46A56B4AD39C907BBB71646B01B86E50310 | |
RING=/etc/apt/trusted.gpg.d/yarnpkg.gpg |
git config --global alias.exec '!exec ' | |
git config --global alias.top '!f() { GIT_TOP="${GIT_DIR%%/.git/modules/*}"; [ ".$GIT_TOP" != ".$GIT_DIR" ] && cd "$GIT_TOP"; exec "$@"; }; f' | |
# THIS IS PUBLIC DOMAIN. | |
# | |
# `git exec` executes something in the current GIT module's base directory. `git exec pwd` gives this base. | |
# Stolen from http://stackoverflow.com/questions/957928/is-there-a-way-to-get-the-git-root-directory-in-one-command/957978#comment9747528_957978 | |
# | |
# `git top` is like `git exec`, but executes in the topmost GIT directory, even from within a GIT submodule. |
# $key = hex2bin(rfc4648tohex('AAAAAAAAAAAAAAAA')); # Your secret Auth-Key | |
# $token = googleauth($key, floor(time()/30)); | |
function googleauth($key, $stamp) | |
{ | |
$mac = hash_hmac('SHA1', substr(chr(0).chr(0).chr(0).chr(0).chr(0).chr(0).chr(0).pack('N', floor($stamp)),-8), $key, true); | |
$val = unpack('N', substr($mac, (ord(substr($mac, -1)) & 15), 4)); | |
$val = $val[1]&0x7fffffff; | |
return substr("000000$val", -6); | |
} |
#!/bin/bash | |
# | |
# mongoexportall [directory [connection-options..]] | |
# | |
# This Works is placed under the terms of the Copyright Less License, | |
# see file COPYRIGHT.CLL. USE AT OWN RISK, ABSOLUTELY NO WARRANTY. | |
# (CLL is more free than Public Domain, as it disallows Copyrights.) | |
OOPS() { { printf 'OOPS:'; printf ' %q' "$@"; printf '\n'; } >&2; exit 23; } |