Skip to content

Instantly share code, notes, and snippets.

View vadirajks's full-sized avatar

Vadiraj K.S vadirajks

View GitHub Profile
@sayle-doit
sayle-doit / bq_per_table_storage_billing_recommendation.sql
Last active March 4, 2024 11:37
BigQuery storage billing model recommender on a per table basis
/*
* This query will look at a single project (by default in US multi-region) and
* calculate the logical and physical billing prices for each table in all datasets
* contained inside of it then provide a recommendation on if it is better to put it
* into a dataset that uses the logical (uncompressed) or physical (compressed)
* storage billing models.
*
* Physical (also called compressed) Storage went GA on July 5, 2023. It is set at
* the dataset level, so if two or more tables are better suited for different
* billing models in the same dataset it may be best to split them into separate
@vadirajks
vadirajks / gke-ingress-manged-tls.md
Created August 2, 2023 06:22 — forked from pydevops/gke-ingress-manged-tls.md
Create a GCP managed TLS certificate for the GKE ingress

GKE ingress in a nutshell

Solution #1 (ManagedCertificate CRD in GKE)

  • GKE with Google-managed SSL certificates
    • Use ManagedCertificate CRD to create a object.
    • Associate the ManagedCertificate object to an Ingress by adding an annotation networking.gke.io/managed-certificates to the Ingress. This annotation is a comma-separated list of ManagedCertificate resources, cert1,cert2,cert3 for example.

Solution #2 (Google Cloud SSL Certificate)

Assumption

@jonico
jonico / Jenkinsfile
Last active September 3, 2024 00:13
Jenkinsfile showing advanced Postman CLI, portman (contract test generation) and newman integration including custom reporters and reporting status back to Postman
def checkout () {
context="continuous-integration/jenkins/"
context += isPRMergeBuild()?"pr-merge/checkout":"branch/checkout"
def scmVars = checkout scm
setBuildStatus ("${context}", 'Checking out completed', 'SUCCESS')
if (isPRMergeBuild()) {
prMergeRef = "refs/pull/${getPRNumber()}/merge"
mergeCommit=sh(returnStdout: true, script: "git show-ref ${prMergeRef} | cut -f 1 -d' '")
echo "Merge commit: ${mergeCommit}"
return [prMergeRef, mergeCommit]
@mikesparr
mikesparr / gcp-shared-vpc-multi-env.sh
Last active April 9, 2022 12:46
Example multi-env secure setup with Argo CD and Argo Rollouts
#!/usr/bin/env bash
# REF: https://cloud.google.com/docs/enterprise/best-practices-for-enterprise-organizations
export PROJECT_ID=$(gcloud config get-value project)
export PROJECT_USER=$(gcloud config get-value core/account) # set current user
export PROJECT_NUMBER=$(gcloud projects describe $PROJECT_ID --format="value(projectNumber)")
export IDNS=${PROJECT_ID}.svc.id.goog # workflow identity domain
export GCP_REGION="us-west4" # CHANGEME (OPT)
@Mr-LiuDC
Mr-LiuDC / pipeline-syntax.gdsl
Last active September 19, 2024 00:57
GDSL supporting jenkins pipeline.
/**
* JENKINS_HOST/job/pipeline-job/pipeline-syntax/gdsl
* https://gist.github.com/Mr-LiuDC/8a1fbe27e8fbd42361185b06085ef4c3
*
* All pipeline steps can be found here: https://www.jenkins.io/doc/pipeline/steps/
*/
// The global script scope
def ctx = context(scope: scriptScope())
@niainaLens
niainaLens / __memo
Last active November 12, 2024 14:06
memo
###
PERSONAL COLLECTION OF MEMO
by https://github.com/niainaLens
###
@mik-laj
mik-laj / a.sh
Last active June 19, 2023 20:13
API Request to GKE cluster using curl
GCP_CLUSTER_NAME=europe-west1-fluffy-bcad8335-gke
GCP_CLUSTER_ZONE=europe-west1-b
curl --cacert <(gcloud container clusters describe "${GCP_CLUSTER_NAME}" \
--zone "${GCP_CLUSTER_ZONE}" \
--format='value(masterAuth.clusterCaCertificate)' | base64 -d\
) \
--header "Authorization: Bearer $(gcloud auth print-access-token)" \
https://$(gcloud container clusters describe "${GCP_CLUSTER_NAME}" \
--zone "${GCP_CLUSTER_ZONE}" \
@jona7o
jona7o / initCognitoUser.sh
Created February 22, 2019 18:10
Bash script for the following cognito workflow: Sign Up User with Username and Mail --> Confirm User --> Login User --> Print Access Token
#!/bin/bash
debug=0
if [[ $# -eq 0 ]] ; then
echo 'usage: initCognitoUser [parameters]'
echo 'paramters:'
echo '-c --clientId: Cognito ClientId'
echo '-i --poolId: Cognito UserPoolId'
echo '-u --username: Username of new User'
echo '-p --password: Password of new User'
@angristan
angristan / single-node-es.md
Last active November 4, 2024 17:40
Elasticsearch settings for single-node cluster (1 shard, 0 replica)

Elasticsearch settings for single-node cluster

1 shard, 0 replica.

For future indices

Update default template:

curl -X PUT http://localhost:9200/_template/default -H 'Content-Type: application/json' -d '{"index_patterns": ["*"],"order": -1,"settings": {"number_of_shards": "1","number_of_replicas": "0"}}' 
@mtds
mtds / lvn.md
Last active September 20, 2024 23:06
Linux Virtual Networking

Virtual Networking on Linux

In the Linux Kernel, support for networking hardware and the methods to interact with these devices is standardized by the socket API:

                +----------------+
                |   Socket API   |
                +-------+--------+
                        |
User space              |