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
| (async () => { | |
| // === CONFIG === | |
| const COUNT = 500; // how many from the top to remove | |
| const PER_ITEM_TIMEOUT = 8000; // ms to wait for menu items per video | |
| const BETWEEN_CLICKS_DELAY = 400; // ms delay between actions | |
| // === UTILITIES === | |
| const sleep = (ms) => new Promise(res => setTimeout(res, ms)); | |
| const waitFor = async (predicate, {timeout = 5000, interval = 100} = {}) => { |
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 | |
| # when a command fails, bash exits instead of continuing with the rest of the script | |
| set -o errexit | |
| # make the script fail, when accessing an unset variable | |
| set -o nounset | |
| # pipeline command is treated as failed, even if one command in the pipeline fails | |
| set -o pipefail | |
| # enable debug mode, by running your script as TRACE=1 | |
| if [[ "${TRACE-0}" == "1" ]]; then set -o xtrace; fi |
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 | |
| for ns in $(kubectl get ns -o=jsonpath='{.items[*].metadata.name}' | sort); do | |
| echo Namespace: $ns | |
| kubectl get vs \ | |
| -n $ns ${ns}-master \ | |
| -o=jsonpath='{" Destination: "}{.spec.http[*].route[*].destination.host}{"\n Regex mapping:\n "}{range .spec.http[*].match[*]}{.uri.regex}{"\n "}{end}{"\n"}{"\n Prefix mapping:\n "}{range .spec.http[*].match[*]}{.uri.prefix}{"\n "}{end}' 2>/dev/null \ | |
| || echo "No istio virtual services" | |
| echo | |
| echo |
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 kube_context() { | |
| # could have used $?, but it was easier with a string compare | |
| local ctx=$(kubectl config current-context 2>&1) | |
| if [ "${ctx}" != "error: current-context is not set" ]; then | |
| echo -n "<${ctx}> " | |
| fi | |
| } | |
| function parse_git_branch() { | |
| git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e "s/* \(.*\)/\1/" |
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 | |
| type wget >/dev/null 2>&1 || { echo >&2 "I require wget but it's not installed."; exit 1; } | |
| type mdless >/dev/null 2>&1 || { echo >&2 "I require mdless but it's not installed."; exit 1; } | |
| TOOL=${1:?Usage: hack.sh <toolname> [--refresh]} | |
| REFRESH=${2:-no} | |
| RAW_MD_URL="https://raw.github.com/hazeorid/devhints.io/gh-pages/${TOOL}.md" |
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
| provider "aws" { | |
| region = "eu-west-1" | |
| } | |
| resource "aws_instance" "stage1" { | |
| instance_type = "t2.micro" | |
| ami = "ami-a8d2d7ce" | |
| vpc_security_group_ids = ["${aws_security_group.stage1-sec-group.id}"] |
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
| provider "aws" { | |
| region = "eu-west-1" | |
| } | |
| resource "aws_instance" "stage1" { | |
| instance_type = "t2.micro" | |
| ami = "ami-a8d2d7ce" | |
| vpc_security_group_ids = ["${aws_security_group.stage1-sec-group.id}"] |
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
| provider "aws" { | |
| region = "eu-west-1" | |
| } | |
| resource "aws_instance" "stage1" { | |
| instance_type = "t2.micro" | |
| ami = "ami-a8d2d7ce" | |
| tags { | |
| Name = "stage1" |
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
| provider "aws" { | |
| region = "eu-west-1" | |
| } | |
| resource "aws_instance" "simple" { | |
| instance_type = "t2.micro" | |
| ami = "ami-a8d2d7ce" | |
| } |
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
| provider "aws" { | |
| region = "eu-west-1" | |
| } |
NewerOlder