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 | |
| set -euo pipefail | |
| ip_ranges="$(curl -fsL https://ip-ranges.amazonaws.com/ip-ranges.json | jq -r '.prefixes')" | |
| python3 - "${1}" <<-EOF | |
| from sys import stdin, argv | |
| from ipaddress import ip_address, ip_network | |
| for network in $(echo "${ip_ranges}" | jq -r 'tojson'): | |
| if ip_address(argv[1]) in ip_network(network["ip_prefix"]): |
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 | |
| set -euo pipefail | |
| REGIONS="GLOBAL,ap-east-1,ap-southeast-1" | |
| SERVICES="CLOUDFRONT" | |
| curl -fsL https://ip-ranges.amazonaws.com/ip-ranges.json | jq -r '($regions_raw | split(",")) as $regions | ($services_raw | split(",")) as $services | .prefixes[] | select(.region as $region | $regions | contains([$region])) | select(.service as $service | $services | contains([$service])) | "add address=\(.ip_prefix) comment=\"aws/\(.region | ascii_downcase)/\(.service | ascii_downcase)\" list=aws_net"' --arg regions_raw "${REGIONS}" --arg services_raw "${SERVICES}" |
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
| { | |
| "vnix": [ | |
| { | |
| "name": "VNIX HCM", | |
| "items": [ | |
| { | |
| "asn": 23962, | |
| "ip_subnet": "218.100.14.0/24", | |
| "ip_family": "IPv4" | |
| }, |
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
| package keyring | |
| import ( | |
| "fmt" | |
| "golang.org/x/crypto/ssh" | |
| ) | |
| type SignType byte | |
| const ( |
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
| package keyring | |
| import ( | |
| "errors" | |
| "fmt" | |
| "go.nobidev.com/ssh-agent/pkg/schema" | |
| "golang.org/x/crypto/ssh/agent" | |
| "net" | |
| ) |
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
| package keyring | |
| import ( | |
| "errors" | |
| "fmt" | |
| "go.nobidev.com/ssh-agent/pkg/api" | |
| "golang.org/x/crypto/ssh" | |
| "golang.org/x/crypto/ssh/agent" | |
| ) |
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 | |
| set -e | |
| data="$(cat values.yaml | yq -r 'tojson')" | |
| origin_state="$(echo "${data}" | jq -r '.partner | { stage1: (.lotteryConfigStage1 | fromjson), stage2: (.lotteryConfigStage2 | fromjson) }')" | |
| state="${origin_state}" | |
| changes=0 | |
| while true; do | |
| printf 'Nhap stage muon thay doi (Go n de exit): ' |
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 | |
| set -e | |
| for item in $(docker ps --filter label=com.docker.swarm.service.name=fpt-play-tv_peer -q); do | |
| if [ $(docker logs ${item} | grep -c MaxListenersExceededWarning) -gt 0 ]; then | |
| name=$(docker inspect ${item} --format '{{ .Name }}') | |
| echo "Kill ${name} by MaxListenersExceededWarning on $(date)" | |
| # docker kill ${item} | |
| fi | |
| done |
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 | |
| set -e | |
| touch /tmp/images-up-to-dated | |
| for item in $(docker service ls -q); do | |
| image=$(docker service inspect "${item}" | jq -r '.[].Spec.TaskTemplate.ContainerSpec.Image') | |
| if [ $(cat /tmp/images-up-to-dated | grep -wc "${image}") -gt 0 ]; then | |
| continue | |
| 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 | |
| set -e | |
| ssh -T ef-mytel-s1 bash <<-EOF | |
| set -e | |
| docker service update myid_go_prod_gateway --log-driver none --update-parallelism 32 | |
| docker service update myid_go_prod_game --log-driver none --update-parallelism 8 | |
| docker service update myid_go_prod_lb --log-driver none --update-parallelism 8 --force | |
| EOF |
NewerOlder