Skip to content

Instantly share code, notes, and snippets.

@hilkinr
Forked from sj26/LICENSE.md
Created December 30, 2022 18:36
Show Gist options
  • Select an option

  • Save hilkinr/2bd4dd55cb835b2a7c4f35223317f0db to your computer and use it in GitHub Desktop.

Select an option

Save hilkinr/2bd4dd55cb835b2a7c4f35223317f0db to your computer and use it in GitHub Desktop.

Revisions

  1. @sj26 sj26 revised this gist Dec 8, 2022. 1 changed file with 21 additions and 4 deletions.
    25 changes: 21 additions & 4 deletions LICENSE.md
    Original file line number Diff line number Diff line change
    @@ -1,7 +1,24 @@
    Copyright (c) 2022 Samuel Cochran <[email protected]>
    This is free and unencumbered software released into the public domain.

    Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
    Anyone is free to copy, modify, publish, use, compile, sell, or
    distribute this software, either in source code form or as a compiled
    binary, for any purpose, commercial or non-commercial, and by any
    means.

    The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
    In jurisdictions that recognize copyright laws, the author or authors
    of this software dedicate any and all copyright interest in the
    software to the public domain. We make this dedication for the benefit
    of the public at large and to the detriment of our heirs and
    successors. We intend this dedication to be an overt act of
    relinquishment in perpetuity of all present and future rights to this
    software under copyright law.

    THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
    THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
    EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
    MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
    IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
    OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
    ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
    OTHER DEALINGS IN THE SOFTWARE.

    For more information, please refer to <https://unlicense.org>
  2. @sj26 sj26 revised this gist Sep 5, 2022. 1 changed file with 7 additions and 0 deletions.
    7 changes: 7 additions & 0 deletions LICENSE.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,7 @@
    Copyright (c) 2022 Samuel Cochran <[email protected]>

    Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

    The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

    THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  3. @sj26 sj26 created this gist Dec 8, 2016.
    32 changes: 32 additions & 0 deletions retry.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,32 @@
    # Retry a command up to a specific numer of times until it exits successfully,
    # with exponential back off.
    #
    # $ retry 5 echo Hello
    # Hello
    #
    # $ retry 5 false
    # Retry 1/5 exited 1, retrying in 1 seconds...
    # Retry 2/5 exited 1, retrying in 2 seconds...
    # Retry 3/5 exited 1, retrying in 4 seconds...
    # Retry 4/5 exited 1, retrying in 8 seconds...
    # Retry 5/5 exited 1, no more retries left.
    #
    function retry {
    local retries=$1
    shift

    local count=0
    until "$@"; do
    exit=$?
    wait=$((2 ** $count))
    count=$(($count + 1))
    if [ $count -lt $retries ]; then
    echo "Retry $count/$retries exited $exit, retrying in $wait seconds..."
    sleep $wait
    else
    echo "Retry $count/$retries exited $exit, no more retries left."
    return $exit
    fi
    done
    return 0
    }