Skip to content

Instantly share code, notes, and snippets.

@oleander
oleander / design.md
Created January 10, 2026 15:31
Kubernetes Rails Deployment Specifications - OVH Migration

Design Document: Kubernetes Rails Deployment

Overview

This design describes the architecture for deploying a Rails application on OVH Kubernetes with separate containers for the web server, delayed job workers, and Kafka consumers. The solution uses Docker multi-stage builds to create separate container images for each process type from a single Dockerfile. Each build target contains the appropriate CMD to start its specific process in the foreground with proper signal handling, health checks, and JSON logging for Logz.io integration.

Migration from ECS Build Server Model

Previous Deployment Architecture (Deprecated)

@oleander
oleander / spec.yml
Created March 2, 2025 01:03
Home Assistant OpenAPI 3.1 REST API
openapi: 3.1.0
info:
title: Home Assistant REST API
version: 1.0.0
description: |
Official Home Assistant REST API specification based on documentation.
Authentication requires a Long-Lived Access Token that can be generated from the Home Assistant profile page.
All API calls must use the Bearer token in the Authorization header.
main.swift:55:7: error: ambiguous reference to member 'init'
self.init(x)
^~~~
Swift.Array<Element>:49:12: note: found this candidate
public init<S>(_ s: S) where S : Sequence, S.Iterator.Element == Element
^
Swift.RangeReplaceableCollection:22:24: note: found this candidate
public convenience init<S>(_ elements: S) where S : Sequence, S.Iterator.Element == Self.Iterator.Element
@oleander
oleander / Makefile
Created April 6, 2017 12:26
How to use the Swift Package Manager and CocoaPods within the same XCode application
APP="MyApp"
CONSTRUCT=xcodebuild -workspace $(APP).xcworkspace -scheme $(APP) clean
install_deps:
pod install
create_config:
swift package fetch
swift package generate-xcodeproj
wipe:
rm -rf .build $(APP).xcodeproj $(APP).xcworkspace Package.pins Pods Podfile.lock
  • Ta med
    • Tävling
      • Simning
        • Våtdräkt
        • Simglasögon
      • Cykel
        • Vattenflaskor
        • Kolsyrepatroner
        • Kolsyrepump
  • Cykelskor
  • Google Maps
  • Sverigekarta
  • Cykling
    • 1102km
      • 276km
        • Umeå -> Sundsvall, 276km
      • 289km
        • Sundsvall -> Bollnäs, 169km
        • Bollnäs -> Falun, 120km
  • 184km
Handler/Comment.hs:25:29:
Couldn't match type `Text' with `Entity Post'
Expected type: Field (HandlerT App IO) (Entity Post)
Actual type: Field (HandlerT App IO) Text
In the first argument of `areq', namely `textField'
In the second argument of `(<$>)', namely
`areq textField "Post" (Just post)'
In the second argument of `(<*>)', namely
`(entityKey <$> areq textField "Post" (Just post))'
Handler/Comment.hs:25:29:
Couldn't match type `Text' with `Entity Post'
Expected type: Field (HandlerT App IO) (Entity Post)
Actual type: Field (HandlerT App IO) Text
In the first argument of `areq', namely `textField'
In the second argument of `(<$>)', namely
`areq textField "Post" (Just post)'
In the second argument of `(<*>)', namely
`(entityKey <$> areq textField "Post" (Just post))'
require "pp"
a = "A\s+(.+?)"
b = "[\n]+B\s+(.+?)"
c = "[\n]+C\s+(.+?)"
d = "[\n]+D\s+((?=E)[^E]+|[^\n]+)"
e = "[(?=[\n]+E\s+)[\n]+E\s+(.+?)\n]?"
pp File.read("ord.txt").scan(/(^\d{1,2})\.\s+(.+?(?=A\s+))#{a}#{b}#{c}#{d}#{e}/m).to_a