Skip to content

Instantly share code, notes, and snippets.

View rajat-peloton's full-sized avatar

rajat-peloton

View GitHub Profile
@rajat-peloton
rajat-peloton / proxy.py
Last active March 31, 2025 23:20
This mitmproxy Python script captures and logs HTTP(S) API calls made to any subdomain of onepeloton.com. It extracts request and response details (including GraphQL operation names), ensures uniqueness, assigns a sequence number to each entry, and saves the results to a CSV file.
import csv
import signal
import re
import time
from mitmproxy import http
from multiprocessing import Manager
import json
# mitmdump -s proxy.py -p 8080
# set browser proxy (use firefox with foxy proxy extenstion) to localhost:8080
@rajat-peloton
rajat-peloton / inventory_multi_cluster.py
Created March 25, 2025 22:55
Extracts ingress info for each application in argocd in the multicluster
import json
import subprocess
import csv
import yaml
LOGIN_ARGOCD_CLI = "argocd login argocd.fleet.k8s.pelotime.com --sso --grpc-web"
GET_CLUSTER_CLI = "argocd cluster list -o json --grpc-web"
GET_ALL_SERVICES_CLI = "argocd app list -o json --grpc-web"
GET_MANIFEST_FOR_APP= "argocd app manifests {app_name}"
@rajat-peloton
rajat-peloton / service-inventory-internal-or-external-from-argocd.py
Created January 9, 2025 21:09
for each service in argoCD gets ingress information and categorizes to internal or external service. Also extracts host information.
import json
import subprocess
import csv
import yaml
LOGIN_ARGOCD_CLI = "argocd login ui.argocd.build.k8s.pelotime.com --sso --grpc-web"
GET_CLUSTER_CLI = "argocd cluster list -o json --grpc-web"
GET_ALL_SERVICES_CLI = "argocd app list -o json --grpc-web"
GET_MANIFEST_FOR_APP= "argocd app manifests {app_name}"
@rajat-peloton
rajat-peloton / inventory.py
Created June 26, 2024 18:00
Service to Cluster Mapping Using ArgoCD CLI
import json
import subprocess
import csv
LOGIN_ARGOCD_CLI = "argocd login ui.argocd.build.k8s.pelotime.com --sso --grpc-web"
GET_CLUSTER_CLI = "argocd cluster list -o json --grpc-web"
GET_ALL_SERVICES_CLI = "argocd app list -o json --grpc-web"
def login_to_argocd():
# Call the CLI command and capture the output
@rajat-peloton
rajat-peloton / gist:5c3569576118e19f8a6b561336d3a0db
Created June 26, 2024 17:58
Service to Cluster Mapping Using ArgoCD CLI
import json
import subprocess
import csv
LOGIN_ARGOCD_CLI = "argocd login ui.argocd.build.k8s.pelotime.com --sso --grpc-web"
GET_CLUSTER_CLI = "argocd cluster list -o json --grpc-web"
GET_ALL_SERVICES_CLI = "argocd app list -o json --grpc-web"
def login_to_argocd():
# Call the CLI command and capture the output