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 -eu | |
| set -o pipefail | |
| readonly USER_ID=0 | |
| list_packages() { | |
| local flags="${1:-}" | |
| local cmd=(adb shell cmd package list packages --user "${USER_ID}") | |
| [[ -n "${flags}" ]] && cmd+=("${flags}") |
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
| curl -s https://xxx.yyy.com:18080/api/v1/applications/app-zzz-123/stages | \ | |
| jq '[ .[] | .executorCpuTime // 0 ] | add / 1e6' |
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
| export AWS_PROFILE=$(grep -B20 "${ACCOUNT_ID}" ~/.aws/config | \ | |
| grep "^\[" | tail -1 | tr -d "[]" | awk '{print $NF}') |
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
| mkdir -p xxx | |
| cd ./xxx | |
| git init -q | |
| git remote add origin git@aaa.zzz.com:yyy/xxx.git | |
| git fetch origin "${SHA}" | |
| git checkout -q FETCH_HEAD |
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
| echo 'public class X{public static void main(String[]a)throws Exception{System.out.println(java.net.InetAddress.getLocalHost().getCanonicalHostName());}}' > X.java \ | |
| && javac X.java && java X && rm X.java X.class |
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
| provision() { | |
| xx() { | |
| : | |
| } | |
| yy() { | |
| : | |
| } | |
| zz() { |
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
| locals { | |
| broker_fqdns = [for broker in split(",", aws_msk_cluster.kafka.bootstrap_brokers_tls) : | |
| trimsuffix(broker, ":${var.msk_port}")] | |
| broker_addrs = { for broker in data.dns_a_record_set.brokers : broker.addrs[0] => broker.host } | |
| pl_relevant_enis = (var.enable_privatelink ? [for eni in data.aws_network_interface.brokers : | |
| merge({ public_fqdn = local.broker_addrs[eni["private_ip"]] }, eni) | |
| if contains(keys(local.broker_addrs), eni["private_ip"])] : []) |
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
| class EndpointFilter(Filter): | |
| """A generic way to filter out web endpoints from the logs.""" | |
| # pylint: disable=too-few-public-methods | |
| def __init__( | |
| self, | |
| path: str, | |
| *args, | |
| **kwargs, |
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 itertools import islice | |
| from subprocess import run | |
| from tempfile import NamedTemporaryFile | |
| from time import sleep | |
| from typing import NamedTuple | |
| import kubernetes.client | |
| import kubernetes.config | |
| import prometheus_client |
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
| # shellcheck disable=SC2086 | |
| docker images -q "${DOCKER_REPO_FULL}" | \ | |
| grep -v "$(docker images -q ${DOCKER_IMAGE})" | \ | |
| xargs --no-run-if-empty docker rmi -f |
NewerOlder