-
install dlv debugger inside build image
RUN go get github.com/go-delve/delve/cmd/dlv -
copy dlv to final docker image
COPY --from=build-env /go/bin/dlv /app/dlv -
build go binary with these 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
| # install aws cli first and configure it with credentials and default region | |
| # the script will iterate over all regions of AWS | |
| for region in `aws ec2 describe-regions --output text | cut -f4` | |
| do | |
| echo -e "\nListing Instances in region:'$region'..." | |
| aws ec2 describe-instances --query "Reservations[*].Instances[*].{IP:PublicIpAddress,ID:InstanceId,Type:InstanceType,State:State.Name,Name:Tags[0].Value}" --output=table --region $region | |
| 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
| srv1 = ssh -i key-file-path ubuntu@10.10.10.10 | |
| srv2 = ssh -i key-file-path ubuntu@10.10.10.11 | |
| srv3 = ssh -i key-file-path ubuntu@10.10.10.12 |
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 main | |
| import ( | |
| "cluster-manager/constants" | |
| "crypto/tls" | |
| "github.com/aws/aws-sdk-go/aws" | |
| "github.com/aws/aws-sdk-go/aws/credentials" | |
| "github.com/aws/aws-sdk-go/aws/session" | |
| "github.com/aws/aws-sdk-go/service/s3" | |
| "github.com/urfave/cli" |
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 | |
| #name=${1:-docundotapvpc1} | |
| #region=${2:-us-east-1} | |
| #id=${1:-vpc-08343443447ef34b} | |
| #aws ec2 describe-vpcs --region ${region} | jq -r ".Vpcs[] | select(.VpcId | contains(\"${id}\")) | .VpcId" 2>/dev/null | | |
| name=testingnetwork | |
| region=ap-southeast-1 | |
| aws ec2 describe-vpcs --region ${region} | jq -r ".Vpcs[] | select(.Tags[].Value | contains(\"${name}\")) | .VpcId" 2>/dev/null | |
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
| for ROLEIN in $(cat remaining-roles-2 | jq -r ".Roles[] | .RoleName"); do | |
| ## filter role on pattern | |
| ROLE=$(echo $ROLEIN | grep -E "\-SR|\-MR|M-CP-X|M-CP-Y") | |
| if [ -z "$ROLE" ] | |
| then | |
| echo "" | |
| else | |
| echo role ${ROLE} |
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 main | |
| import ( | |
| "fmt" | |
| "github.com/anaskhan96/soup" | |
| "github.com/dustin/go-humanize" | |
| "io" | |
| "io/ioutil" | |
| "net/http" | |
| "os" |
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
| for ROLEIN in $(cat remaining-roles-2 | jq -r ".Roles[] | .RoleName"); do | |
| ## filter role on pattern | |
| ROLE=$(echo $ROLEIN | grep -E "\-SR|\-MR|M-CP-X|M-CP-Y") | |
| if [ -z "$ROLE" ] | |
| then | |
| echo "" | |
| else | |
| echo role ${ROLE} |
https://coderwall.com/p/tk_pwa/ssh-into-a-secured-host-through-a-jump-server-and-forward-ports
ssh -v -t -L 10443:localhost:20443 <jump_server> ssh -t -L 20443:localhost:443 user@<target_server>
ssh -v -t -L 9292:localhost:9292 cloud1@10.10.10.10 ssh -t -L 9292:localhost:9292 cloud10@192.168.48.110