Skip to content

Instantly share code, notes, and snippets.

View Souheil-Yazji's full-sized avatar

Souheil Souheil-Yazji

View GitHub Profile
@Souheil-Yazji
Souheil-Yazji / KFProfileUsers.sh
Created October 23, 2024 19:03
Kubeflow Rolebinding Email Puller
#!/bin/bash
# List all Kubeflow profiles, get name (profiles are 1:1 with namespaces)
PROFILES=$(kubectl get profiles -o jsonpath='{.items[*].metadata.name}')
# Iterate over each profile and get RoleBindings, extract user name
for ns in $PROFILES; do
echo "Namespace: $ns"
kubectl get rolebindings -n $ns -o json | jq '
.items[] | select(.subjects[]?.kind == "User") | {
export OM_version=openmpp_ubuntu_mpi_20231115
export model_dir=/home/jovyan/buckets/aaw-unclassified/oncosim/ #<ModelNameHere>
export OM_ROOT=/home/jovyan/buckets/aaw-unclassified/OMPP-1.15.16/openmpp_ubuntu_mpi_20231115 #<PathToOmpp>
cd $model_dir
rm -rf ompp-linux
make OM_MSG_USE=MPI RELEASE=1 all publish
@Souheil-Yazji
Souheil-Yazji / install-tools.sh
Last active November 4, 2023 01:22
K8s DevOps essentials installer
# Make the script executable
# chmod +x install-tools.sh
# Run the script
# ./install-tools.sh
KUBECTL_VERSION=latest # vX.XX.XX should be atleast +/- 1 version of your kubernetes version
KUBECTL_URL=https://dl.k8s.io/release/${KUBECTL_VERSION}/bin/linux/amd64/kubectl
KUBECTL_CHECKSUM=https://dl.k8s.io/release/$(KUBECTL_VERSION)/bin/linux/amd64/kubectl.sha256
@Souheil-Yazji
Souheil-Yazji / decode_secrets.sh
Last active June 30, 2023 18:48
K8s Decode Secrets - Lists all namespaces/secrets, retrieves their manifests then Base64 decodes them. Requires kubectl and jq. Run `chmod +x decode_secrets.sh` prior to use
#!/bin/bash
# ██ ██ █████ ██████ ███ ██ ██ ███ ██ ██████
# ██ ██ ██ ██ ██ ██ ████ ██ ██ ████ ██ ██
# ██ █ ██ ███████ ██████ ██ ██ ██ ██ ██ ██ ██ ██ ███
# ██ ███ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██
# ███ ███ ██ ██ ██ ██ ██ ████ ██ ██ ████ ██████
#
#
# This will print SECRETS as PLAIN TEXT to your terminal.
@Souheil-Yazji
Souheil-Yazji / K8sBench.py
Last active June 21, 2023 19:00
K8sBench is a python script designed to test and calculate the pass rate for requests made to a kubernetes API server. The 'NoClient` version can be used if encountering issues with the k8s client creation.
import kubernetes
from kubernetes.client.rest import ApiException
import time
import os
# Set the path to the kubeconfig file
#kubeconfig_path = "~/#/config" # "/path/to/your/kubeconfig"
# Set the KUBECONFIG environment variable
#os.environ["KUBECONFIG"] = kubeconfig_path