Skip to content

Instantly share code, notes, and snippets.

View WalBeh's full-sized avatar

Walter Behmann WalBeh

  • 07:31 (UTC +02:00)
View GitHub Profile
@WalBeh
WalBeh / compare_settings.py
Last active April 24, 2025 16:17
Compares the cluster settings with the default settings of a cratedb cluster
#!/usr/bin/env python3
# /// script
# requires-python = ">=3.12"
# dependencies = [
# "click",
# ]
# ///
"""
This script compares CrateDB cluster settings against default values.
@WalBeh
WalBeh / soup2.py
Last active April 11, 2025 11:55
Get a condensed view on the cratedb documentation...
#!/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
# /// script
# requires-python = ">=3.12"
# dependencies = [
# "beautifulsoup4",
# "requests",
# ]
# ///
"""
Generates a JSON File from the documentation
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)
# /// script
# requires-python = ">=3.12"
# dependencies = [
# "aiodns",
# "argparse",
# "asyncio",
# "loguru",
# ]
# ///
import asyncio
# /// script
# requires-python = ">=3.12"
# dependencies = [
# "argparse",
# "kubernetes<=31.0",
# "loguru",
# ]
# ///
import re
@WalBeh
WalBeh / jfr.py
Last active December 2, 2024 15:03
automate jfr+heapdump handling
#!/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
@WalBeh
WalBeh / aws_usage_quota_exporter.py
Last active November 13, 2024 15:58
Exports Quota and Usage on selected VPC, EC, ELB resources
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__)
@WalBeh
WalBeh / trivy_db_updater.go
Created November 9, 2024 17:34
trivy db updater for cache-dir
package main
import (
"bytes"
"encoding/json"
"flag"
"fmt"
"io"
"os"
"os/exec"
package main
import (
"bytes"
"context"
"crypto/tls"
"encoding/json"
"flag"
"fmt"
"io/ioutil"