Skip to content

Instantly share code, notes, and snippets.

View vadirajks's full-sized avatar

Vadiraj K.S vadirajks

View GitHub Profile
@Prajithp
Prajithp / aws-cli-filtering.md
Created July 16, 2018 14:56 — forked from carlessanagustin/aws-cli-filtering.md
Filtering AWS results

Via AWS CLI using jq

(https://github.com/mwilliamson/jq.py)

aws ec2 describe-instances | jq '.Reservations[].Instances[] | select(.KeyName == "MyKey") | select(.State.Code != 48) | select(.Tags[]|select(.Key=="Name")|select(.Value=="InstanceName")) | [ .PublicIpAddress]'
 
aws ec2 describe-instances | jq '.Reservations[].Instances[] | select(.KeyName == "MyKey") | select(.State.Code != 48) | select(.Tags[]|select(.Key=="Name")|select(.Value=="InstanceName")) | [ .PublicIpAddress, (.Tags[]|select(.Key=="Name").Value)]'

aws ec2 describe-instances | jq '.Reservations[].Instances[] | select(.KeyName == "MyKey") | select(.State.Code != 48) | select(.Tags[]|select(.Key=="InventoryGroup").Value) | [ .PublicIpAddress, (.Tags[]|select(.Key=="Name").Value)]'
@namrata4
namrata4 / admin.sql
Last active March 16, 2024 17:24
Handy PostgreSQL Monitoring Scripts
-- turn off paging (less/more)
psql> \pset pager off
/*
Pager usage is off.
*/
-- find an object name by id
SELECT OID, relname
@mtds
mtds / lvn.md
Last active August 14, 2025 10:17
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              |
@angristan
angristan / single-node-es.md
Last active July 12, 2025 16:46
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"}}' 
@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'
@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}" \
@niainaLens
niainaLens / __memo
Last active September 24, 2025 08:17
memo
###
PERSONAL COLLECTION OF MEMO
by https://github.com/niainaLens
###
@Mr-LiuDC
Mr-LiuDC / pipeline-syntax.gdsl
Last active September 8, 2025 08:01
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())
@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)
@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]