This file contains hidden or 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 python3 | |
# /// script | |
# requires-python = ">=3.12" | |
# dependencies = [ | |
# "click", | |
# ] | |
# /// | |
""" | |
This script compares CrateDB cluster settings against default values. |
This file contains hidden or 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 uv python | |
""" | |
CrateDB Settings Extractor | |
This tool extracts settings from CrateDB's documentation and outputs them | |
in either JSON or Markdown format, or the SQL statements to set the default value. | |
It parses the HTML structure of the documentation to identify settings, their | |
descriptions, default values, and whether they're runtime configurable. | |
Author: wolta |
This file contains hidden or 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
# /// script | |
# requires-python = ">=3.12" | |
# dependencies = [ | |
# "beautifulsoup4", | |
# "requests", | |
# ] | |
# /// | |
""" | |
Generates a JSON File from the documentation |
This file contains hidden or 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 json | |
import re | |
# Load the JSON data | |
with open('cratedb_settings.json', 'r') as f: | |
settings = json.load(f) | |
# Print header | |
print(f"SQL Statements for Runtime Configurable CrateDB Settings") | |
print("=" * 60) |
This file contains hidden or 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
# /// script | |
# requires-python = ">=3.12" | |
# dependencies = [ | |
# "aiodns", | |
# "argparse", | |
# "asyncio", | |
# "loguru", | |
# ] | |
# /// | |
import asyncio |
This file contains hidden or 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
# /// script | |
# requires-python = ">=3.12" | |
# dependencies = [ | |
# "argparse", | |
# "kubernetes<=31.0", | |
# "loguru", | |
# ] | |
# /// | |
import re |
This file contains hidden or 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 python3 | |
import argparse | |
import time | |
import sys | |
from kubernetes import client, config | |
from kubernetes.config.config_exception import ConfigException | |
import logging | |
import logging.handlers | |
import subprocess | |
import boto3 |
This file contains hidden or 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 boto3 | |
from botocore.exceptions import ClientError | |
import logging | |
import time | |
import os | |
from prometheus_client import start_http_server, Gauge | |
# Configure logging | |
logging.basicConfig(level=logging.INFO, format='%(asctime)s - %(levelname)s - %(message)s') | |
logger = logging.getLogger(__name__) |
This file contains hidden or 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
package main | |
import ( | |
"bytes" | |
"encoding/json" | |
"flag" | |
"fmt" | |
"io" | |
"os" | |
"os/exec" |
This file contains hidden or 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
package main | |
import ( | |
"bytes" | |
"context" | |
"crypto/tls" | |
"encoding/json" | |
"flag" | |
"fmt" | |
"io/ioutil" |
NewerOlder