mirror of
https://git.valherun.com/valherun/pxe_boot_alma.git
synced 2026-10-15 19:42:03 -04:00
- restructure boot/kickstarts/scripts/docs into homelab/ - docs: alma9->10 breaking changes, CIS hardening, kickstart changes - add find_cron_entries.sh helper and codex running memory notes Co-Authored-By: Claude Fable 5 <[email protected]>
52 lines
1.2 KiB
Bash
Executable File
52 lines
1.2 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
set -euo pipefail
|
|
|
|
ROOT=/usr/local/valherun/pxe_boot_alma
|
|
DB=/home/valherun/.config/Code/User/globalStorage/state.vscdb
|
|
KEY=saoudrizwan.claude-dev
|
|
|
|
profile="${1:-local-mistral}"
|
|
|
|
case "$profile" in
|
|
local|local-mistral|mistral)
|
|
preset="$ROOT/scripts/cline-presets/local-mistral-openai.json"
|
|
;;
|
|
remote|remote-qwen|qwen)
|
|
preset="$ROOT/scripts/cline-presets/remote-qwen-openai.json"
|
|
;;
|
|
*)
|
|
echo "usage: $0 {local-mistral|remote-qwen}" >&2
|
|
exit 1
|
|
;;
|
|
esac
|
|
|
|
python3 - "$DB" "$KEY" "$preset" <<'PY'
|
|
import json
|
|
import sqlite3
|
|
import sys
|
|
|
|
db_path, key, preset_path = sys.argv[1:4]
|
|
with open(preset_path, "r", encoding="utf-8") as f:
|
|
preset = json.load(f)
|
|
|
|
conn = sqlite3.connect(db_path)
|
|
cur = conn.cursor()
|
|
row = cur.execute("select value from ItemTable where key=?", (key,)).fetchone()
|
|
state = {}
|
|
if row and row[0]:
|
|
try:
|
|
state = json.loads(row[0])
|
|
except Exception:
|
|
state = {}
|
|
|
|
state.update(preset)
|
|
value = json.dumps(state, separators=(",", ":"))
|
|
cur.execute(
|
|
"insert into ItemTable(key, value) values(?, ?) on conflict(key) do update set value=excluded.value",
|
|
(key, value),
|
|
)
|
|
conn.commit()
|
|
conn.close()
|
|
print(value)
|
|
PY
|