Skip to content

Instantly share code, notes, and snippets.

View shivanshs9's full-sized avatar
Unlimited Code Works! ⚔️

Shivansh Saini shivanshs9

Unlimited Code Works! ⚔️
View GitHub Profile
shivanshs9 / patch-argo-notif-cm.yaml
Created May 29, 2024 14:38
Adds git commit author + message to deployment notification with this ArgoCD patch
apiVersion: v1
kind: ConfigMap
name: argocd-notifications-cm
namespace: argocd
data: |
subject: New version of an application {{}} is up and running.
shivanshs9 /
Created March 5, 2024 06:22
Approve/Raise/Check a Github PR
set -e
# Function to display help
display_help() {
echo "Usage: $0 [command] [args]"
echo "Command:"
echo " approve Approves the specified PR in format of URL"
echo " create Creates a new PR from specified args"
echo "Options:"
set -e
# Function to display help
display_help() {
echo "Usage: $0 [options] org repo"
echo "Options:"
echo " -d, --default-branch BRANCH Set the default branch for the repository"
echo " -t, --teams TEAMS Set repository access permissions for specified teams"
echo " -j, --rule-json JSON Set ruleset for the repository"
shivanshs9 / caddyl4.Dockerfile
Last active December 31, 2023 15:32
Bastion for private EKS with Caddy reverse proxy
# syntax=docker/dockerfile:1
FROM golang:1.21-alpine AS builder
RUN apk add --no-cache git ca-certificates
RUN go install
RUN xcaddy build --with --output /usr/bin/caddy && chmod +x /usr/bin/caddy
FROM alpine:3.15
RUN apk add --no-cache ca-certificates mailcap
RUN apk add bash
"description": "TheFaker NFT minted for DCX training",
"external_url": "",
"image": "",
"name": "TheFaker",
"attributes": []
shivanshs9 /
Created September 1, 2023 10:31
Bitbucket to Github migration
# How to use?
## bash competition-service
prepare_repo() {
# Assume sudo by default
[ $(id -u) -eq 0 ] || exec sudo $0 $@
for bin in /var/lib/rancher/k3s/data/**/bin/; do
[ -d $bin ] && export PATH=$PATH:$bin:$bin/aux
set -x
shivanshs9 / System
Created February 2, 2021 22:59 — forked from vasanthk/System
System Design Cheatsheet

System Design Cheatsheet

Picking the right architecture = Picking the right battles + Managing trade-offs

Basic Steps

  1. Clarify and agree on the scope of the system
  • User cases (description of sequences of events that, taken together, lead to a system doing something useful)
    • Who is going to use it?
    • How are they going to use it?
shivanshs9 / gist:b321f21bf78cedd660ee94f1d4352eb1
Created September 5, 2020 22:17
Script to simultaneously reassign owner of all tables in a given DB (source:
### Use:
# reassign_owner dbName newOwner oldOwner/root dbHost
reassign_owner() {
local pw
echo -n "Password: " > /dev/tty
shivanshs9 / git-backcommit
Last active July 22, 2020 08:12
Wraps 'git commit' command to override AuthorDate and CommitDate (if date is provided)
#!/usr/bin/env bash
## Copyright 2020 Shivansh Saini<>
# Licensed under MIT
usage() {
cat << EOD
Usage: `basename $0` [options] [date] -- [commit args]