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
| #!/bin/sh | |
| # sysprofiler.sh — Compact system profile for LLM agents | |
| # Pure POSIX sh | Read-only | Zero-install | Linux only | |
| # Usage: sh sysprofiler.sh | |
| # Output: structured key=value sections, optimized for LLM token economy | |
| LC_ALL=C; export LC_ALL | |
| PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:${PATH}" | |
| _t0=$(date +%s 2>/dev/null) |
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
| func convertToUTF8(str string, origEncoding string) string { | |
| strBytes := []byte(str) | |
| byteReader := bytes.NewReader(strBytes) | |
| reader, _ := charset.NewReaderLabel(origEncoding, byteReader) | |
| strBytes, _ = ioutil.ReadAll(reader) | |
| return string(strBytes) | |
| } |
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
| #!/bin/bash | |
| set -euo pipefail | |
| docker exec -e ETCDCTL_API=3 $(docker ps -q --filter name=k8s_etcd) \ | |
| etcdctl --cacert=/etc/kubernetes/pki/etcd/ca.crt \ | |
| --cert=/etc/kubernetes/pki/etcd/peer.crt \ | |
| --key=/etc/kubernetes/pki/etcd/peer.key \ | |
| snapshot save /var/lib/etcd/snapshotdb | |
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
| #!/bin/bash | |
| GLOBALRESOURCES="${GLOBALRESOURCES:-"storageclass clusterrole clusterrolebinding customresourcedefinition"}" | |
| RESOURCETYPES="${RESOURCETYPES:-"deployment daemonset configmap secrets service ingress networkpolicy statefulset cronjob pvc"}" | |
| CONTEXT="${KUBE_CONTEXT:-$(kubectl config current-context)}" | |
| [ -d "${CONTEXT}" ] || mkdir -p "${CONTEXT}" | |
| kube_export() { | |
| local NS=$1 |