Skip to content

Instantly share code, notes, and snippets.

View carlosgrillet's full-sized avatar
💭
Another nvim god

Carlos Grillet carlosgrillet

💭
Another nvim god
View GitHub Profile
@carlosgrillet
carlosgrillet / .goreleaser.yaml
Created June 30, 2026 11:00
Config GoReleaser in private github repositories
# Legend:
# <tool_name> the name of your binary, e.g. gotool
# <owner> the owner of the tool repository, e.g. privGo
# <repo> the tool repository
# <tap_owner> the owner of the homebrew tap repository
# <tap> the name of the homebrew tap
# <license> the license of your tool
# <project_description> description of your tool
#
# Example:
@carlosgrillet
carlosgrillet / README.md
Created April 15, 2026 21:00
This guide outlines the "Fedora Way" for deploying manual services. It covers standard Linux permissions (DAC) and the stricter SELinux controls (MAC) required for Fedora 43.

Fedora Service Deployment Guide

1. System User Setup

Never run a service as root or a standard login user. Create a dedicated system user.

# -r: System account (no aging, UID in system range)
# -s /sbin/nologin: No interactive login shell for security
# -U: Create a group with the same name as the user
# -m -d: Create and set the home directory
sudo useradd -rs /sbin/nologin -Umd /var/lib/myservice myservice
@carlosgrillet
carlosgrillet / README.md
Created March 23, 2026 17:05
Rust Ownership: The Complete Mental Model

Rust Ownership: The Complete Mental Model

Rust rules are simple to understand but can confusing to implement.

Part 1: ELI5 (Explain Like I'm 5)

The Apartment Analogy

Think of every value in Rust as a physical apartment key — not a copy, the only key.

@carlosgrillet
carlosgrillet / main.rs
Created March 20, 2026 19:45
Linked list, but is Rust so nobody can read it.
use std::fmt;
struct Node<T> {
value: T,
next: Option<Box<Node<T>>>,
}
pub struct List<T> {
head: Option<Box<Node<T>>>,
len: usize,
@carlosgrillet
carlosgrillet / create.bash
Last active June 26, 2026 20:38
My small script to create new simple C projects.
#!/usr/bin/env bash
set -euo pipefail
if [[ $# -eq 0 ]]; then
echo "Error: Please provide a project name." >&2
echo "Usage: $0 <name>" >&2
exit 1
fi
@carlosgrillet
carlosgrillet / cloud-config.yaml
Last active December 25, 2025 15:31
Install Mirkotik RouterOS on Hetzner Cloud - cloud-init
# cloud-config
users:
- name: mikrotik
groups: sudo
shell: /bin/bash
packages:
- wget
- gzip
@carlosgrillet
carlosgrillet / README.md
Created November 1, 2025 12:49
Strace 6.1 handy help

strace - System Call Tracer

Synopsis

strace [OPTIONS] { -p PID | PROG [ARGS] }
strace -c [OPTIONS] { -p PID | PROG [ARGS] }

@carlosgrillet
carlosgrillet / README.md
Created August 17, 2025 12:21
Coreutils cheat sheet

📂 File & Directory Operations

ls: List directory contents

$ ls
Desktop  Documents  Downloads

cp: Copy files or directories

@carlosgrillet
carlosgrillet / README.md
Created July 18, 2025 11:52
This guide explains how to configure HAProxy as a load balancer for Kubernetes clusters.

How to Set Up HAProxy as a Load Balancer for Kubernetes High Availability (HA) Clusters

This guide explains how to configure HAProxy as a load balancer for Kubernetes clusters.

Why Use a Load Balancer?

A load balancer is important for Kubernetes clusters because:

  1. High Availability: It ensures that if one control plane node fails, traffic is redirected to other working nodes.
  2. Better Performance: It distributes traffic evenly across multiple nodes, preventing overload on a single node.
  3. Simplified Access: Instead of connecting to individual control plane nodes, you can use a single entry point (the load balancer).

How to Set Up a Centralized NFS Server for Kubernetes Storage

This guide will walk you through setting up an NFS server to provide centralized storage for your Kubernetes cluster. We'll use a Docker container as the NFS server and configure it to work seamlessly with Kubernetes. This setup is very useful if you have an on-premise Kubernetes cluster and you're looking for a centralized storage solution.

Overview

  1. What is NFS?

    • NFS (Network File System) allows you to share files between machines over a network. It's commonly used in Kubernetes to provide persistent storage that can be accessed by multiple pods.
  2. Why Use This Setup?