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 awk -f | |
# usage: ere2bre <ere> | |
function bracket( \ | |
pattern, i, | |
c, c2, term, len, end \ | |
) { | |
++i # skip opening bracket | |
# ignore [] 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
user [email protected] |
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 | |
set -eu | |
set -o pipefail 2>/dev/null || : | |
aws_regions="\ | |
af-south-1 ap-east-1 ap-northeast-1 ap-northeast-2 ap-northeast-3 | |
ap-south-1 ap-southeast-1 ap-southeast-2 ca-central-1 eu-central-1 eu-north-1 | |
eu-south-1 eu-west-1 eu-west-2 eu-west-3 me-south-1 sa-east-1 us-east-1 | |
us-east-2 us-west-1 us-west-2 |
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 | |
set -eu | |
if [ $# = 0 ]; then | |
printf "usage: %s file [opts]\n" "$(basename "$0")" >&2 | |
exit 2 | |
fi | |
f=$1 | |
shift | |
if gpac -i "$f" inspect | grep -q DolbyVision; then | |
set -- -ab dby1 "$@" |
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 | |
grep -ro "http[^ )>']*" "$1" | grep -v "[{}]" | cut -d: -f 2- | sort | uniq |
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
/** @type {import('jscodeshift').Transform} */ | |
module.exports = function (file, api) { | |
const j = api.jscodeshift; | |
const root = j(file.source); | |
return root | |
.find(j.CallExpression, { callee: { property: { name: "forEach" } } }) | |
.replaceWith((path) => { | |
const call = path.value; | |
const callee = /** @type {import('jscodeshift').MemberExpression} */ ( |
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 | |
set -euo pipefail | |
root= | |
while getopts D: opt; do | |
case $opt in | |
D) root=$OPTARG ;; | |
?) exit 2 | |
esac | |
done |
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 | |
# usage: lstcp [options] [port] | |
lstcp() ( | |
while getopts : o; do opts="$opts -$OPTARG"; done; shift $((OPTIND-1)) | |
lsof -i tcp"${1+:}$1" -s tcp:listen $opts | |
) | |
# usage: lsudp [options] [port] | |
lsudp() ( |
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 | |
# usage: forward host port [localport] | |
forward() { | |
ssh -NL ${3-$2}:localhost:$2 $1 | |
} |
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 | |
set -eux | |
# Enable multi-instance operation | |
sudo postmulti -e init | |
mkdir -p ~/.config ~/.local/state/spool | |
# Create a new local instance |