Skip to content

Instantly share code, notes, and snippets.

View luqasn's full-sized avatar

Lucas Romero luqasn

View GitHub Profile
@mikeslattery
mikeslattery / .idea-lazy.vim
Last active May 15, 2025 13:21
LazyVim mappings for Jetbrains IDEs
" ~/.idea-lazy.vim
" LazyVim mappings for Jetbrains IDEs
" Required plugins. https://plugins.jetbrains.com/bundles/7-ideavim-bundle
" IDEAVim
" Which-Key
" IdeaVim-Sneak
" To install, add this to the top of your ~/.ideavimrc:
CREATE OR REPLACE PROCEDURE upgrade_serial_to_identity(tbl regclass, col name)
LANGUAGE plpgsql
AS $$
DECLARE
colnum smallint;
count int;
maxval int;
cmd text;
r RECORD;
BEGIN
# Based on https://gist.github.com/antifuchs/e30d58a64988907f282c82231dde2cbc
{ config, lib, pkgs, ... }:
let
cfg = config.boot.initrd.network.tailscale;
# TODO: This uses old-style non-nftables iptables; ideally, we wouldn't have to opt out of that.
# Enabling nftables compat means having to shuffle the list of
# modules down in availableKernelModules; that's a bunch of work
# (deploying to a linux machine & rebooting to see what doesn't
@supechicken
supechicken / root_mi_box_s_2nd_gen.md
Last active May 5, 2025 17:53
A tutorial for rooting Xiaomi TV Box S 2nd Gen (jaws) without UART/teardown

Rooting Xiaomi TV Box S 2nd Gen (jaws) without UART/teardown

Table of contents

  • Prerequisites
  • Step 1: Download the stock ROM for Xiaomi TV Box S 2nd Gen
  • Step 2: Extract boot image from the OTA archive
  • Step 3: Update the system with downloaded OTA archive
  • Step 4: Patch boot image with Magisk
  • Step 5: Unlock bootloader with fastboot
  • Step 6: Reboot to system and complete setup

Rewrite "import then re-export" to a direct "re-export" approach via ast-grep.

Rule file see in file-import-to-export.yml

Preview Effect

- import Form, {
+ export {
@dasniko
dasniko / _keycloak-cluster-config.md
Last active March 31, 2025 18:27
How to configure a Keycloak cluster properly (Quarkus edition)

Keycloak Cluster Configuration (How to)

This is a short and simple example on how to build a proper Keycloak cluster, using DNS_PING as discovery protocol and an NGINX server as reverse proxy.

If you prefer to use JDBC_PING, see @xgp's example gist here: https://gist.github.com/xgp/768eea11f92806b9c83f95902f7f8f80


Please see also my video about Keycloak Clustering: http://www.youtube.com/watch?v=P96VQkBBNxU
NOTE: The video covers JDBC_PING protocol and uses the legacy Keycloak Wildfly distribution!

@xgp
xgp / Dockerfile
Last active April 23, 2025 11:17
Keycloak 17 example using JGroups JDBC_PING discovery protocol for Infinispan
FROM quay.io/keycloak/keycloak:17.0.0 as builder
ENV KC_METRICS_ENABLED=true
ENV KC_FEATURES=preview
ENV KC_DB=postgres
ENV KC_HTTP_RELATIVE_PATH=/auth
# specify the custom cache config file here
ENV KC_CACHE_CONFIG_FILE=cache-ispn-jdbc-ping.xml
# copy the custom cache config file into the keycloak conf dir
@onlurking
onlurking / programming-as-theory-building.md
Last active May 6, 2025 06:16
Programming as Theory Building - Peter Naur

Programming as Theory Building

Peter Naur

Peter Naur's classic 1985 essay "Programming as Theory Building" argues that a program is not its source code. A program is a shared mental construct (he uses the word theory) that lives in the minds of the people who work on it. If you lose the people, you lose the program. The code is merely a written representation of the program, and it's lossy, so you can't reconstruct

@MatthewFlamm
MatthewFlamm / Alarm system.md
Last active April 16, 2025 20:18
Esp32 home alarm system with home assistant and esphome

Alarm system using esp32 with esphome and home assistant

@tarnacious
tarnacious / build-qcow2.nix
Last active November 6, 2024 21:23
Build a bare bones bootable nixos qcow2 image suitable for running with libvirt/qemu/kvm.
{ config, lib, pkgs, ... }:
with lib;
{
imports =
[
<nixpkgs/nixos/modules/installer/cd-dvd/channel.nix>
./machine-config.nix
];