Skip to content

Instantly share code, notes, and snippets.

View harivemula's full-sized avatar

Hari Krishna Vemula harivemula

View GitHub Profile
@harivemula
harivemula / import-kibana-dashboard-aws-opensearch.sh
Created July 29, 2022 02:05
Import kibana dashboard to AWS OpenSearch
curl \
-k \
-X POST \
-b auth.txt \
-H 'osd-xsrf: true' \
-H 'Content-Type: application/json' \
'https://<URL>/_dashboards/api/opensearch-dashboards/dashboards/import?exclude=index-pattern&force=true' \
-d@metricbeat-7.12.1-linux-x86_64/kibana/7/dashboard/Metricbeat-system-overview.json
@harivemula
harivemula / opensearch-api-login.sh
Created July 29, 2022 02:01
Login to AWS OpenSearch with API
curl -k -X POST https://<URL>/_dashboards/auth/login -H "osd-xsrf:true" -H "content-type:application/json" \
-d '{"username":"<username>", "password":"<password>"}' -c auth.txt
@harivemula
harivemula / delete-namespace.md
Last active September 3, 2021 05:51
Deleting the namespace stuck in 'terminating' state.

Deleting the Kubernetes Namespace if it is stuck with finalizers

kubectl get ns <your-name-space> | kubectl neat > temp-ns.json

Note: The kubectl neat is optional.

Output of the above might looks like below content, remove the "kubernetes" under finalizers array and save the file.

{
# Source: https://gist.github.com/48f44d3974db698d3127f52b6e7cd0d3
###########################################################
# Automation of Everything #
# How To Combine Argo Events, Workflows, CD, and Rollouts #
# https://youtu.be/XNXJtxkUKeY #
###########################################################
# Requirements:
# - k8s v1.19+ cluster with nginx Ingress
@harivemula
harivemula / application.yaml
Last active June 26, 2021 15:17
Connecting to MongoDB cluster with Spring Boot Application
spring:
data:
mongodb:
uri: mongodb://${MONGODB_USERNAME}:${MONGODB_PASSWORD}@mongo-mongodb-0.mongo-mongodb-headless.mongodb.svc:27017,mongo-mongodb-1.mongo-mongodb-headless.mongodb.svc:27017,mongo-mongodb-2.mongo-mongodb-headless.mongodb.svc:27017/test
logging:
level:
org:
springframework:
data.mongodb: INFO
boot.autoconfigure.mongo: INFO
@harivemula
harivemula / cert-manager-gcp-nginx.md
Last active June 1, 2023 12:44
Installing Cert manager in GCP GKE cluster on Nginx Ingress.

Installing & Configuring 'cert-manager' on GKE cluster with Nginx ingres

Confirm before running the below for installing ingress (nginx)

  • helm repo add ingress-nginx https://kubernetes.github.io/ingress-nginx
  • helm install quickstart ingress-nginx/ingress-nginx

Install a sample service

  • kubectl apply -f https://netlify.cert-manager.io/docs/tutorials/acme/example/deployment.yaml
  • kubectl apply -f https://netlify.cert-manager.io/docs/tutorials/acme/example/service.yaml
@harivemula
harivemula / convert_mov_to_mp4.sh
Created May 16, 2021 05:26
Convert mov files to mp4 in a directory using ffmpeg in mac
## zsh
brew install ffmpeg
## If you have any spaces in file name, run below command to replace
#
for FILE in *.mov; do mv "$FILE" `echo $FILE | tr ' ' '_'` ; done
## If you are running from a different directory, you may use ${FILE:t:r} to just keep the filename without path and extension
@harivemula
harivemula / handling_multiple_github_accounts.md
Created May 6, 2021 02:11 — forked from Jonalogy/handling_multiple_github_accounts.md
Handling Multiple Github Accounts on MacOS

Handling Multiple Github Accounts on MacOS

The only way I've succeeded so far is to employ SSH.

Assuming you are new to this like me, first I'd like to share with you that your Mac has a SSH config file in a .ssh directory. The config file is where you draw relations of your SSH keys to each GitHub (or Bitbucket) account, and all your SSH keys generated are saved into .ssh directory by default. You can navigate to it by running cd ~/.ssh within your terminal, open the config file with any editor, and it should look something like this:

Host *
 AddKeysToAgent yes

> UseKeyChain yes

@harivemula
harivemula / ssh-to-supervisor-or-guest-cluster-node.sh
Created April 5, 2021 04:44
Login to Supervisor cluster Nodes / Guest Cluster Nodes - vSphere with Tanzu
# *Supervisor Cluster*
# Login to vCenter server and run the below command to retrieve the Supervisor cluster IP and password
/usr/lib/vmware-wcp/decryptK8Pwd.py
# Use the username as 'root' and password provided by above command to login to Supervisor node(s).
# IP returned by above commmand is VIP of cluster api servers.
ssh root@<supervisor-node-ip>
### *Guest Clusters*
@harivemula
harivemula / tkgi-admin-scope-fix.md
Last active February 23, 2021 14:24
Fix TKGi UAA admin user scope by DB method

NOTE: don't use this method if you have alternate way to fix it by using any other user with clients.write scope

If you have removed uaa.admin scope from TKGi 'admin' user, here are the steps to fix it by db method

  • bosh -d <pks...> ssh pks-db/0
  • sudo su -
  • mysql --socket=/var/vcap/sys/run/pxc-mysql/mysqld.sock -u uaa -p
  • <password should be from TKGi tile 'Cf Mysql Uaa Db Password'>
  • use uaa;