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 [email protected]: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
| logbashrc() { | |
| (( INTERACTIVE )) && echo "$1" | |
| return 0 | |
| } | |
| pathdedup() { | |
| local retval=0 | |
| local opt= dir= deduped= | |
| # default to PATH |
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 bash | |
| ARCH=$(uname -m) | |
| TEMPDIR=/tmp | |
| echo "Installing some python packages..." | |
| python --version | |
| python -m pip install azure-cli | |
| python -m pip install ansible |
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 bash | |
| TEMPDIR=$(mktemp -d) | |
| pushd "${TEMPDIR}" | |
| [ ! -d "$HOME/bin" ] && mkdir -p "$HOME/bin" | |
| echo "Installing homebrew..." | |
| /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" |
NewerOlder