Skip to content

Instantly share code, notes, and snippets.

View grafuls's full-sized avatar
🐍
Hissing

Gonzalo Rafuls grafuls

🐍
Hissing
  • Red Hat, Inc
  • Czech Republic
View GitHub Profile
@grafuls
grafuls / openclaw-setup.sh
Created March 29, 2026 21:20
Openclaw auto setup and hardening
#!/usr/bin/env bash
set -euo pipefail
# =============================================================================
# OpenClaw Setup Script
# Automated setup for OpenClaw personal AI assistant gateway
# Converted from: https://github.com/amanaiproduct/openclaw-setup/blob/main/PROMPT.md
# =============================================================================
RED='\033[0;31m'
@grafuls
grafuls / main.py
Created October 24, 2025 10:16
host metadata import from inventory yml
#! /usr/bin/env python3
import yaml
import urllib3
import os
from dotenv import load_dotenv
from quads_lib import QuadsApi
load_dotenv()
@grafuls
grafuls / quads_llm.md
Last active September 23, 2025 13:43
Quads LLM inference design document

QUADS LLM Inference Architecture Design Document

Document Information

  • Version: 1.1
  • Date: September 2025
  • Author: Perf/Scale DevOps Team
  • Status: Draft

Table of Contents

  1. Overview
@grafuls
grafuls / hostname2meta.py
Created April 9, 2025 14:01
Quads hostname2meta converter
#! /usr/bin/env python3
import re
from quads.quads_api import QuadsApi
from quads.config import Config
quads = QuadsApi(Config)
hosts = quads.get_hosts()
pattern = r"^(?P<rack>[^-]+)-(?P<uloc>[^-]+)-(?P<blade>[^-]+)-(?P<host_type>[^.]+)\.(?P<domain>.+)$"
@grafuls
grafuls / hue_master_switch.ino
Created December 6, 2024 08:12
Controlling HUE lights via D1 mini
#define POTENTIOMETER_PIN A0
#define CHANGE_THRESHOLD 2
#include <ESP8266WiFi.h>
#include <WiFiClientSecure.h>
#include <ArduinoJson.h>
#include <ESP8266HTTPClient.h>
// Replace with your network credentials
const char* ssid = "{SSID}";
@grafuls
grafuls / brave.sh
Last active November 11, 2024 11:01
Finds and brings to front a google meet tab on brave browser
/usr/bin/brave-browser-stable %U --remote-debugging-port=9222 --remote-allow-origins=http://localhost:9222
@grafuls
grafuls / meat.py
Created October 18, 2024 15:49
Find a firefox window, scroll tabs till it finds a google meet one, press ctrl+d to unmute.
#! /usr/bin/env python
import subprocess
from subprocess import CalledProcessError
import time
def get_active_window_title():
try:
window_title = subprocess.check_output("xdotool getactivewindow getwindowname", shell=True).decode('utf-8').strip()
return window_title
- model: Dell R630
quantity: 45
specs:
- 2x Intel Xeon E5-2683 v3 (28 total cores, 56 threads)
- 128GB
- 2x 1TB Disk
- model: Dell R640
quantity: 334
specs:
@grafuls
grafuls / commander.py
Created May 3, 2024 13:30
Command Design Pattern
from functools import partial
class CommandException(Exception):
def __init__(self, message):
self.message = message
class Command:
"""
@grafuls
grafuls / main.py
Created March 4, 2024 15:44
Semantic search on MongoDB
#! /usr/bin/env python
from llama_index.core import SummaryIndex
from llama_index.readers.mongodb import SimpleMongoReader
from langchain_community.llms import HuggingFaceEndpoint
import os
os.environ["HUGGINGFACEHUB_API_TOKEN"] = {HUGGINGFACE_API_TOKEN}