I hereby claim:
- I am tcely on github.
- I am tcely (https://keybase.io/tcely) on keybase.
- I have a public key ASCepDrTFuNbJ51KamisH6cg9iNJN90f5vFYyIQYJ4nTWgo
To claim this, I am signing this object:
#!/bin/sh | |
docker run --rm -it perl:5-threaded \ | |
perl -e 'print(q{Enter pass phrase: }); system("stty -echo"); chomp($pt = <>); system("stty echo"); print(qq{\n}, crypt($pt, q{$1$YCCaQNAP$}), qq{\n});' |
#!/bin/bash | |
# *Temporarily* force Bash into POSIX compatibility mode, where `unset` cannot | |
# be shadowed, which allows us to undefine any `unset` *function* as well | |
# as other functions that may shadow crucial commands. | |
# Note: Fortunately, POSIXLY_CORRECT= works even without `export`, because | |
# use of `export` is not safe at this point. | |
# By contrast, a simple assignment cannot be tampered with. | |
POSIXLY_CORRECT= |
I hereby claim:
To claim this, I am signing this object:
#!/bin/bash | |
conditional_get_etag() { | |
local _url _file _tmpdir | |
local _awk_program='/^ETag:/ {$1=""; printf "If-None-Match: %s", substr($0, 2, length($0)-2); exit;}' | |
for _url; do | |
if [ '--file=' = "${_url:0:7}" ]; then | |
_file="${_url:7}" | |
continue |
#!/usr/bin/awk -f | |
function limit_seeker(a, b, direction) { | |
_record=b; | |
if (isarray(a)) { | |
for (k in a) { | |
_record=limit_seeker(a[k], _record, direction); | |
} | |
} else { |
#!/usr/bin/awk -f | |
#!/usr/bin/awk -E | |
# | |
# If you have an awk version that doesn't support the -f flag, | |
# then you are just out of luck. | |
# | |
# If you just have no clue where awk will be, or you prefer to use -E, | |
# then you can try this bash snippet to launch awk for you. | |
# | |
# You might think the -E tests below are overly complex. You'd be wrong. |
As I originally outlined in this comment there is a work around for the problem of having shared credentials and keys on the various backup "clients" so that they push their contents to your restic server.
I have implemented this solution, but it took a fair amount of work. I am putting this work up for bounty, so if you are interested please contact me to arrange payment and when the goal is reached, I will send my solution to everyone who chipped in.
Thank you very much!
#!/bin/sh | |
github_email_to_login() { | |
local url='https://api.github.com/search/users' | |
local filter='.items|.[]|select(.type == "User")|.login' | |
local email="${1}" | |
curl -sSL "${url}?q=in:email+${email}" | jq -r "${filter}" | |
} |
"Optimize for the inexperience newcomers rather than the experience gurus." As explained in this post there are a few quirks when dealing with shell variables that do not use the curly braces. For example: $pkgver
Instead of expecting new contributors to already know about all of the pitfalls involved with using that syntactic sugar, it is better to just always use the braces. Shell variables are quoted when assigned and used, when accessed they are quoted and surrounded by curly braces. For example: pkgname='bind'
or pkgdesc="${pkgname} tools"
and "${pkgname}"
The characters that do and do not extend the name of the variable are not a concern when the intention of what the variable name should be is made clear by using this explicit syntax. Users don't need to remember which of _
, -
, or .
will change the variable name and lead to an empty value be
#!/usr/bin/env sh | |
secho() { | |
_arg="${1}"; | |
_fmt='%s'; | |
_sentinel='--'; | |
case "${_arg}" in | |
(-e|-en|-ne) _fmt='%b'; shift ;; | |
(-n|-En|-nE) shift ;; |