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
| [[ $- =~ i ]] && INTERACTIVE=1 | |
| # enum() | |
| # Creates an enum from passed in list variable name. | |
| # Usage: | |
| # STATUS=( | |
| # OK | |
| # FAIL | |
| # ) && enum "${STATUS[@]}" | |
| # echo "$OK is 0" |
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
| FROM bitnami/mysql:5.7 AS initial | |
| ENV ALLOW_EMPTY_PASSWORD=yes | |
| ENV MYSQL_MODE="" | |
| USER root | |
| RUN apt update && \ | |
| apt install -y unzip && \ | |
| apt-get clean && \ |
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
| UNAME_M=$(uname -m) | |
| UNAME_S=$(uname -s) | |
| UNAME_S=${UNAME_S,,} | |
| [[ $UNAME_M =~ amd64|x86_64 ]] && ARCH=x86_64 || ARCH=aarch64 | |
| URL_GITHUB_DOCKER_COMPOSE_RELEASES_API="https://api.github.com/repos/docker/compose/releases/latest" | |
| URL_GITHUB_DOCKER_COMPOSE_RELEASES_DOWNLOAD_PREFIX="https://github.com/docker/compose/releases/download" | |
| DOCKER_COMPOSE_LATEST_VERSION=$(curl -s "${URL_GITHUB_DOCKER_COMPOSE_RELEASES_API}" | grep '.tag_name' | sed -r 's/^[^:]*:.*\"(.*)\".*/\1/') | |
| URL_GITHUB_DOCKER_COMPOSE_DOWNLOAD="${URL_GITHUB_DOCKER_COMPOSE_RELEASES_DOWNLOAD_PREFIX}/${DOCKER_COMPOSE_LATEST_VERSION}/docker-compose-${UNAME_S}-${ARCH}" | |
| BIN_DOCKER_COMPOSE=${DOCKER_CONFIG:-$HOME/.docker/cli-plugins/docker-compose} |
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
| cd ~/src | |
| git clone git@github.com:grafana/loki.git | |
| cd loki | |
| make LOKI_DOCKER_DRIVER=loki PLUGIN_TAG=latest docker-driver | |
| make LOKI_DOCKER_DRIVER=loki PLUGIN_TAG=latest docker-driver-enable |
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
| function logbashrc() { | |
| [[ $- =~ i ]] && echo "$1" | |
| return 0 | |
| } | |
| function pathadd() { | |
| local option="" | |
| local retval=0 | |
| if [[ "${1:0:1}" = "-" ]]; then | |
| option=$1 && shift |
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
| logbashrc() { | |
| [[ $- =~ i ]] && echo "$1" | |
| return 0 | |
| } | |
| pathadd() { | |
| local option="" | |
| local retval=0 | |
| if [[ "${1:0:1}" = "-" ]]; then | |
| option=$1 && shift |
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/bash | |
| # May be required to avoid SSL certificate validation. | |
| # NOTE: manually validate the CA in this case. | |
| export INSECURE=${INSECURE:-true} | |
| # Set to user id for access: | |
| OPENCONNECT_USER="USERNAME" | |
| # Set to server without scheme, use what's configured in client config: |
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/bash | |
| # | |
| # REQUIRES | |
| # - netstat - to retrieve network stack details | |
| # - sysctl - to retrieve/modify kernel settings | |
| # - bc - for math | |
| # | |
| # MIT License | |
| # | |
| # Copyright 2020 John H Patton, JH Patton Consulting, LLC |
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
| -- -*- location: /etc/nginx/conf.d/cve_2021_44228.lua; -*- | |
| -- -*- mode: lua; -*- | |
| -- -*- author: John H Patton; -*- | |
| -- -*- email: jhpattonconsulting@gmail.com; -*- | |
| -- -*- license: MIT License; -*- | |
| -- | |
| -- Copyright 2021 JH Patton Consulting, LLC | |
| -- | |
| -- 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 |
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
| logbashrc() { | |
| (( INTERACTIVE )) && echo "$1" | |
| return 0 | |
| } | |
| pathdedup() { | |
| local retval=0 | |
| local opt= dir= deduped= | |
| # default to PATH |
NewerOlder