Skip to content

Instantly share code, notes, and snippets.

View indradhanush's full-sized avatar

Indradhanush Gupta indradhanush

View GitHub Profile
@indradhanush
indradhanush / change-ns.sh
Created October 21, 2022 10:41
A bash function to switch namespaces in the current Kubernetes cluster
change-ns () {
namespace=$1
if [ -z "${namespace}" ]
then
namespace="default"
fi
context=$(kubectl config current-context)
kubectl config set-context "${context}" --namespace "${namespace}" > /dev/null
yellow="\033[1;93m"
green="\033[1;92m"
@indradhanush
indradhanush / README.md
Last active December 30, 2022 03:55
A Python scipt to fetch all public and user affliiated repos with visibility: all

README

Requirements

  • python3.6
  • python-requests
  • GitHub Public Access Token

What this does

@indradhanush
indradhanush / repo-clone-modes.md
Created February 27, 2023 08:33
Sourcegraph: Where do we ensure that uncloned repositories are cloned? And how often? And why?

Where do we ensure that uncloned repositories are cloned? And how often? And why?

Modes of cloning a repo

In gitserver we may clone a repo if it receives a request to one of the following endpoints:

  1. /exec or /archive: If any of the allowed exec commands (gitCmdAllowList) are "executed" on a repo through we may clone the repo in maybeStartClone
  2. /repo-update: If a request to update a repo is received and it is not cloned, then we will clone a repo
  3. /repo-clone: If a request to clone the repo is received
  4. /search: If a search is made in a repo and the repo is not cloned
@indradhanush
indradhanush / example.json
Created August 8, 2025 17:36
Code coverage example
{}