Skip to content

Instantly share code, notes, and snippets.

View muhammad-asn's full-sized avatar
🎯
Focusing

Nuga muhammad-asn

🎯
Focusing
View GitHub Profile
@muhammad-asn
muhammad-asn / script.sh
Created October 6, 2025 02:28
One Liner get kubernetes pvcs and their zone
#!/bin/bash
echo "NAMESPACE PVC PV ZONE"; kubectl get pvc -A -o jsonpath='{range .items[*]}{.metadata.namespace}{" "}{.metadata.name}{" "}{.spec.volumeName}{"\n"}{end}' | while read ns pvc pv; do echo -n "$ns $pvc $pv "; kubectl get pv "$pv" -o jsonpath='{.spec.nodeAffinity.required.nodeSelectorTerms[*].matchExpressions[?(@.key=="topology.kubernetes.io/zone")].values[*]}' 2>/dev/null; echo; done | column -t
@muhammad-asn
muhammad-asn / deployment-dind.yaml
Last active September 12, 2025 06:30
Use Docker Internal Registry in Kubernetes (DIND)
apiVersion: apps/v1
kind: Deployment
metadata:
name: docker-dind
namespace: docker
labels:
app: docker-dind
spec:
replicas: 1
selector:
@muhammad-asn
muhammad-asn / script.sh
Created August 14, 2025 06:12
Check and list bitnami in kubernetes
kubectl get pods --all-namespaces -o jsonpath="{..image}" | tr -s '[[:space:]]' '\n' | sort -u | grep -i bitnami
@muhammad-asn
muhammad-asn / readme.md
Last active July 2, 2025 06:02
Check Timeout Related Configuration PostgreSQL (TimescaleDB)
  1. Check TimescaleDB/Postgres Config in Kubernetes

    kubectl exec -it <pod-name> -- psql -U <username> -d <database>
  2. Run this

    SHOW statement_timeout;
@muhammad-asn
muhammad-asn / file.txt
Created June 24, 2025 06:42
Code & Coffee
Good reading: https://medium.com/code-and-coffee
@muhammad-asn
muhammad-asn / file.md
Last active May 28, 2025 09:08
Observe Java Heap by PID
@muhammad-asn
muhammad-asn / gist:4889bf6503bc8a36ce8a101fac0bd7cc
Last active May 20, 2025 03:00
Enable fzf (fuzzy finder)

Mac OS

$ brew install fzf
# To install useful key bindings and fuzzy completion:
$ $(brew --prefix)/opt/fzf/install
@muhammad-asn
muhammad-asn / gist:b599405a16969d2ad4b518e3b5650bdb
Created May 17, 2025 07:34
Rancher Desktop Fix Cannot Start on Macbook M4 (ARM based)

Context: rancher-sandbox/rancher-desktop#797

$ mv ~/Library/Application\ Support/rancher-desktop/lima ~/.rdlima
$ ln -s ~/.rdlima ~/Library/Application\ Support/rancher-desktop/lima
@muhammad-asn
muhammad-asn / script.sh
Created May 11, 2025 06:29
Debug Thanos Distroless Image
#/bin/bash
kubectl debug -it thanos-storegateway-0 -n thanos --image=ubuntu:latest --share-processes --copy-to=thanos-debug --same-node
@muhammad-asn
muhammad-asn / deployment.tcp.yaml
Created April 28, 2025 03:43
Test UDP and TCP Connection in Kubernetes
## TCP Connection
apiVersion: v1
kind: Service
metadata:
name: nginx-service
namespace: monitoring
spec:
type: ClusterIP
selector:
app: nginx