Skip to content

Instantly share code, notes, and snippets.

View kwmiebach's full-sized avatar

kwmiebach kwmiebach

View GitHub Profile
@kwmiebach
kwmiebach / odoo-auth.md
Created December 19, 2025 12:37
Odoo authentication

¿Cómo funciona la autenticación "mágica" de Odoo.sh?

Es un mecanismo bien diseñado de Single Sign-On (SSO) o autenticación basada en tokens temporales. Aunque el código fuente exacto de la plataforma Odoo.sh es propietario, el comportamiento se basa en prácticas estándar que se pueden deducir y que son comunes en la gestión de instancias en la nube.

El flujo aproximado es el siguiente:

  1. Generación del Token: Cuando haces clic en el botón "Connect" en el panel de control de Odoo.sh, el servidor de Odoo.sh (que tiene control total sobre el contenedor donde corre tu instancia) genera una URL especial.

  2. Inyección o Acceso a la Base de Datos: Odoo.sh tiene acceso al sistema de archivos y a la base de datos de tu contenedor. El sistema puede establecer una sesión válida directamente en el almacenamiento de sesiones de Odoo (Redis o sistema de archivos) o utilizar un módulo preinstalado que acepta un token temporal.

@kwmiebach
kwmiebach / .tmux.conf
Last active December 10, 2025 06:33
.tmux.conf
# V2
# This file versioned as gist:https://gist.github.com/kwmiebach/b0d03afde427a33acf62f994c8f960fa
# For the latest version go to above link, then click `raw`, then copy paste from the browser.
# Deep linking it does not work.
# Install from gist as tmux conf file if none exists yet (this could probably fetch an old version):
# [ ! -f ~/.tmux.conf ] && curl https://gist.githubusercontent.com/kwmiebach/b0d03afde427a33acf62f994c8f960fa/raw/.tmux.conf > ~/.tmux.conf
# Reload: tmux source-file ~/.tmux.conf
@kwmiebach
kwmiebach / odoo18_website_settings_and_fields.py
Last active September 15, 2025 10:48
Available website settings and website fields in Odoo 18
'''
Find out available website settings and website fields.
The fields are recognized with a fuzzy algorythm, so there might be
too many and some might be missing?
Run this in an odoo shell of the odoo instance:
'''
installed_langs = env['res.lang'].search([('active', '=', True)])
print("Installed languages:", installed_langs.mapped('code'))
@kwmiebach
kwmiebach / .tmux.conf
Last active October 5, 2025 10:53
Clean up byobu config for dumb terminals
# tmux source-file ~/.tmux.conf
# find . -name "*tmux.conf"
# ./.config/byobu/.tmux.conf
# vim $(find . -name "*tmux.conf")
# tmux source-file $(find . -name "*tmux.conf")
# use ctrl-a as prefix which conflicts with:
# - vim to increase a number in the text
# - fish to go to beginning of line
unbind-key C-b
@kwmiebach
kwmiebach / stylebot.css
Created May 11, 2025 07:50
Odoo 18 remove background image
body.o_web_client.o_home_menu_background {
background-image: none !important;
}
@kwmiebach
kwmiebach / install-lazydocker.sh
Last active February 1, 2025 22:46
install lazydocker
curl https://raw.githubusercontent.com/jesseduffield/lazydocker/master/scripts/install_update_linux.sh | bash
echo 'export PATH=$HOME/.local/bin:$PATH' >> ~/.bashrc
source ~/.bashrc
@kwmiebach
kwmiebach / Makefile
Last active January 1, 2025 16:05
Demo Makefile: 'Make help' with awk. Targets source .env and pass vars to docker compose. Vars are escaped with '$$'. Instructions: save and run 'make help'.
.PHONY: help
help:
# Keep this comment line, it is imortant so awk ignores the help target.
@echo "Available targets:"
@echo " help\t\t Show this help message"
@awk '/^[^.][a-zA-Z0-9_-]+:/{t=$$1;getline;if($$0~"@echo"){gsub(/^[^"]*"|".*$$/,"",$$0);printf " %-20s %s\n",substr(t,1,length(t)-1),$$0}}' $(MAKEFILE_LIST)
.PHONY: it
it:
@echo "Start bash in the container as user 1000"
@kwmiebach
kwmiebach / pack.sql
Created December 27, 2024 14:44
pack tmp
select
a.Artikelnummer,
a.ArtBruttoGewicht,
a.ArtOptimaleFertigungsmenge1,
p.PosBezeichnung1,
p3m.PosMenge1
/* p.* */
@kwmiebach
kwmiebach / v17.css
Created December 18, 2024 12:42
Styles V17
/* chrome n3 */
a.fw-bold.text-truncate {
font-size: 30px
}
span.min-w-0.text-truncate {
font-size: 30px
}
@kwmiebach
kwmiebach / addkeys.sh
Last active January 11, 2025 01:45
Add public keys for a user to ~/.ssh/authorized_keys
#!/bin/bash
# GitHub SSH Key Updater
# ---------------------
# SECURITY WARNING: This script grants SSH access to your machine!
# Only add keys from GitHub users you absolutely trust with full SSH access to your system.
# Each added public key will allow that user to log into your machine via SSH.
#
# Purpose:
# Fetches and merges public SSH keys from a GitHub user into your ~/.ssh/authorized_keys file,