../test-internal-redirects.conf
location = /real1 { try_files /real1.txt =404; }
location = /real2 { try_files /real2.txt =404; }
#!/usr/bin/env bash | |
split() { | |
local IFS="$1" | |
shift | |
set -- $* | |
echo "$@" | |
} | |
join() { |
#!/bin/sh | |
# create remote origin and push | |
# use 'trunk' unless init.defaultBranch is set | |
default_branch=$(git config init.defaultBranch || echo 'trunk') | |
remote_host='your-remote-host' | |
# assuming the remote host has a directory in $HOME named git | |
toplevel=$(git rev-parse --show-toplevel) | |
remote_repo_path="git/${toplevel##*/}.git" |
The shell used in the following examples is bash, but the commands can be adapted for other shells.
The goal here is to have a performant way to determine if we are in a git repo without printing anything.
git status --porcelain --untracked-files=no &>/dev/null && \
#!/usr/bin/env awk -f | |
BEGIN { | |
FS = ":" | |
RS = "\r\n" | |
OFS = "\t" | |
} | |
/BEGIN:VTODO/ { | |
my_status = "" |
#!/bin/bash | |
dmg_path="$1" | |
# use process redirection to capture the mount point and dev entry | |
IFS=$'\n' read -rd '\n' mount_point dev_entry < <( | |
# mount the diskimage (leave out -readonly if making changes to the file system) | |
hdiutil attach -readonly -plist "$dmg_path" | \ |
#!/usr/bin/perl -w | |
use Getopt::Long; | |
# use diagnostics; | |
sub usage { | |
my $name = $0; | |
$name =~ s/.*\///; | |
print <<EOT; | |
Usage: $name [options] in-list other-list |
#!/bin/bash | |
get_data() { | |
# if the parameter is a local file just cat it (for testing) otherwise try curl | |
{ test -r "$1" && cat "$1" || curl -s "$1"; } | \ | |
jq --raw-output \ | |
'.[] | "\(.symbol | ascii_downcase) \(.price_usd)"' | |
} | |
process() { |
## setting up a personal git repository that you can push change sets to | |
## ssh-host: a host defined in ~/.ssh/config (see: ssh_config(5)) | |
## camaro: the name of the repo | |
# on a remote host or local filesystem: | |
git init --bare camaro.git # (option: use --shared if there are other contributors) | |
# on local host cd to camaro directory: | |
git remote add origin ssh-host:[path/]camaro.git | |
# (for origin on local filesystem: git remote add origin file:///media/volume-name/camaro.git) |