gist |
---|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# Ensure you have authenticated with the GitHub CLI | |
if ! gh auth status &>/dev/null; then | |
echo "Please authenticate with GitHub CLI using 'gh auth login'." | |
exit 1 | |
fi | |
# Get the current authenticated username | |
username=$(gh api user --jq '.login') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name ChatGPT | |
// @version 0.1 | |
// @description Allow deleting multiple chats at a time. | |
// @match https://chat.openai.com/* | |
// @icon https://www.google.com/s2/favicons?sz=64&domain=openai.com | |
// @grant none | |
// ==/UserScript== | |
(function() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import google_auth_oauthlib.flow | |
import googleapiclient.discovery | |
import googleapiclient.errors | |
scopes = ["https://www.googleapis.com/auth/youtube.readonly"] | |
def main(): | |
# Disable OAuthlib's HTTPS verification when running locally. | |
# *DO NOT* leave this option enabled in production. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import requests | |
import json | |
import argparse | |
# Set up command-line argument parsing | |
parser = argparse.ArgumentParser(description='Check for duplicate metrics in Prometheus.') | |
parser.add_argument('url', help='The URL of the Prometheus server.') | |
args = parser.parse_args() | |
# Get all metric names |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
all_probe_paths=() | |
for ns in $(kubectl get namespaces -o jsonpath='{.items[*].metadata.name}'); do | |
readiness_probes=$(kubectl -n $ns get deployments -o jsonpath='{range .items[*]}{.spec.template.spec.containers[0].readinessProbe.httpGet.path}{","}{end}') | |
liveness_probes=$(kubectl -n $ns get deployments -o jsonpath='{range .items[*]}{.spec.template.spec.containers[0].livenessProbe.httpGet.path}{","}{end}') | |
if [ ! -z "$readiness_probes" ]; then | |
all_probe_paths+=${readiness_probes} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
source progressbar.sh | |
# bar customization | |
bar_size=70 | |
bar_char_done="|" | |
bar_char_todo=" " | |
bar_percentage_scale=4 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
!/bin/bash | |
# Set source and destination folders | |
SOURCE_FOLDER="/efs-new/aws-backup-restore_2023-03-27T00-28-30-414788Z/csi/" | |
DESTINATION_FOLDER="/efs-new/csi/" | |
DRY_RUN=false | |
if [ "$1" == "--dry-run" ]; then | |
DRY_RUN=true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Token Utilities |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
apiVersion: monitoring.coreos.com/v1 | |
kind: PrometheusRule | |
metadata: | |
namespace: pulsar | |
creationTimestamp: null | |
labels: | |
app: kube-prometheus-stack | |
release: prometheus-operator | |
name: pleaseignore | |
spec: |