Skip to content

Instantly share code, notes, and snippets.

View LukaPrebil's full-sized avatar
🇺🇦

Luka Prebil Grintal LukaPrebil

🇺🇦
View GitHub Profile
@LukaPrebil
LukaPrebil / claude-code-account-switching.md
Created April 8, 2026 06:19
Switch Claude Code accounts automatically based on directory

Switching Claude Code accounts by directory

Claude Code uses ~/.claude/ as its config directory by default, which includes your login credentials in .claude.json. You can override this with the CLAUDE_CONFIG_DIR environment variable to point at a different config directory, enabling automatic account switching based on where you run claude.

Setup

1. Create a separate config directory for your second account:

mkdir ~/.claude-personal
@LukaPrebil
LukaPrebil / claude-workflow.md
Created April 4, 2026 20:10
Managing Home Assistant with Claude Code — workflow, tooling, and a worked example

Managing Home Assistant with Claude Code

This document describes the workflow and tooling used to manage a Home Assistant (HAOS) instance through Claude Code, Anthropic's AI-powered CLI assistant. It covers the integration architecture, documentation practices, the types of work achieved, established patterns, and a worked example.

Toolchain

HA-MCP (Home Assistant MCP Server)

The core integration is ha-mcp, a Docker container deployed via Ansible that exposes the Home Assistant API as an MCP (Model Context Protocol) server. MCP is a protocol that lets AI assistants call external tools — in this case, it exposes the HA REST API as discrete operations (read entity state, create automation, update script, etc.) that Claude Code can invoke directly during a conversation.

@LukaPrebil
LukaPrebil / guide.md
Last active June 24, 2026 02:23
Upgrading immich postgres major version (14 -> 18) for a docker environment

PostgreSQL Major Version Upgrades (Docker)

Major PostgreSQL upgrades (e.g., 14→18) require a full dump and restore — the data files are not compatible across major versions.

Note: Immich requires vector extensions, and they supply an image with them bundled in as ghcr.io/immich-app/postgres:18-vectorchord0.5.3-pgvector0.8.1

Procedure

  1. Dump: docker exec -t <container> pg_dumpall --clean --if-exists --username=<user> | gzip > dump.sql.gz
  2. Stop the stack: docker compose down
@LukaPrebil
LukaPrebil / immich_ml_890m_fix.md
Last active March 20, 2026 07:27
Immich machine learning fix on Ryzen AI 9 370 HX (Radeon 890M, RDNA 3.5, gfx1150)

Immich machine learning fix on Ryzen AI 9 370 HX (Radeon 890M, RDNA 3.5, gfx1150)

Update (2026-03-20): This workaround is no longer needed as of Immich v2.6.0+

Immich v2.6.0 (PR #26178) ships with ROCm 7.2 and replaces the old ROCM ONNX Runtime provider with the MIGraphX backend. ROCm 7.2 natively supports gfx1150/gfx1151 (RDNA 3.5), so the custom Dockerfile and HSA_OVERRIDE_GFX_VERSION hack are no longer necessary. See the v2.6.0+ instructions below.


Legacy workaround (Immich ≤ v2.5.x)