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
SERVICE_ACCOUNT_NAME="example-sa" | |
GOOGLE_PROJECT_NAME="example-google-project" | |
GOOGLE_PROJECT_ID="123456" | |
PROVIDER_NAME="example-provider" | |
POOL_NAME="example-pool" | |
cat >ksa.json <<EOF | |
{ | |
"type": "external_account", | |
"audience": "//iam.googleapis.com/projects/${GOOGLE_PROJECT_ID}/locations/global/workloadIdentityPools/${PROVIDER_NAME}/providers/${POOL_NAME}", | |
"subject_token_type": "urn:ietf:params:oauth:token-type:jwt", |
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 -Eeuo pipefail | |
# gather error codes | |
# https://gist.github.com/matti/3d2f04b1a9485a3a15d0267a68b341ba#gather-exit-codes-of-backgrounded-processes | |
export NO_COLOR="1" | |
export TF_CLI_ARGS="-no-color" |
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 | |
if [ $# -ne 2 ]; then | |
echo "Usage: $0 file partSizeInMb"; | |
exit 0; | |
fi | |
file=$1 | |
if [ ! -f "$file" ]; then |
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
{ | |
"Version": "2012-10-17", | |
"Statement": [ | |
{ | |
"Effect": "Allow", | |
"Principal": { | |
"Federated": "arn:aws:iam::MY_AWS_ACCOUNT_ID:oidc-provider/MY_PROVIDER_URL" | |
}, | |
"Action": "sts:AssumeRoleWithWebIdentity", | |
"Condition": { |
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
require 'net/http' | |
errors = 0 | |
successes = 0 | |
begin | |
Kernel.loop do | |
begin | |
request = Net::HTTP.get_response("35.236.26.249", "/productpage") | |
if request.is_a?(Net::HTTPSuccess) |
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 | openssl s_client -showcerts -servername google.com -connect google.com:443 | |
``` |
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
--- | |
apiVersion: v1 | |
kind: Namespace | |
metadata: | |
name: hello-1 | |
--- | |
apiVersion: v1 | |
kind: Service | |
metadata: | |
name: hello-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
openssl x509 -in certificate.crt -text -noout |
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
openssl req -x509 -out localhost.crt -keyout localhost.key \ | |
-newkey rsa:2048 -nodes -sha256 \ | |
-subj '/CN=localhost' -extensions EXT -config <( \ | |
printf "[dn]\nCN=localhost\n[req]\ndistinguished_name = dn\n[EXT]\nsubjectAltName=DNS:localhost\nkeyUsage=digitalSignature\nextendedKeyUsage=serverAuth") |
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
RG7RUXhgLBbmWwoWfakQwjaPugnbJDMEZ3 |
NewerOlder