Skip to content

Instantly share code, notes, and snippets.

View frgomes's full-sized avatar

Richard Gomes frgomes

View GitHub Profile
@frgomes
frgomes / install_tailscale.sh
Created October 3, 2025 10:35
linux :: install and configure tailscale
#!/bin/bash
cat << EOD > /etc/sysctl.d/99-tailscale.conf
net.ipv4.ip_forward = 1
net.ipv6.conf.all.forwarding = 1
EOD
systemctl restart sysctl
sudo systemctl start sysctl
@frgomes
frgomes / estoria-0001.txt
Created September 27, 2025 18:26
creator :: estoria-0001
Faminto, ele entra no restaurante para pedir comida. O jovem rico o vê e, só
para humilhá-lo, manda ele cantar para a plateia. Mas ninguém esperava que daquela voz sairia a canção que mudaria
a vida de todos. O frio da noite era uma criatura viva que doía através do
moletom poído. Para Francisco, de 10 anos, o frio não era apenas uma sensação, era um inimigo constante que
travava uma batalha diária pelo corpo frágil de sua irmãzinha, Clara. Ele se
encolheu no canto escuro do seu abrigo, um vão esquecido sob a estrutura de uma borracharia abandonada, e ouviu. A tosse
de clara, seca e persistente, rasgava o silêncio da madrugada. Cada acesso de
tosse era como uma agulha perfurando o coração de Francisco. Ao lado deles, em
um colchão fino e manchado, sua mãe, Marta se mexia em seu sono inquieto.
Mesmo dormindo, as mãos dela procuravam no escuro, tentando encontrar o braço de Clara, um gesto de proteção que a
@frgomes
frgomes / svelte_create_monorepo_module.md
Last active September 25, 2025 10:53
Svelte+skeletonUI :: create new module under a monorepo

I built my monorepo based on the link you suggested: https://vercel.com/templates/svelte/turborepo-sveltekit-starter

There's a folder apps/web, which we are NOT going to change.

Suggest a monorepo organization, containing another project called chatbot, which follows the architecture: Svelte + Sveltekit + Typescript + SkeletonUI.

Show which files need to be changed in order to make sure the new project chatbot is included properly into the Vite build.

In addition, provide a "Hello World" for a typical SkeletonUI app, so that I can test the build in the browser.

@frgomes
frgomes / pyproject.toml
Last active September 19, 2025 11:11
python :: pyproject.toml - template with static compilation and other lint checks
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
[project]
name = "my-project"
dynamic = ["version"]
description = "Your friendly assistant"
readme = "README.md"
requires-python = ">=3.12"
@frgomes
frgomes / aisuite_ollama_fastapi_moonshine_gemma_kokoto.sh
Last active August 31, 2025 16:25
AI :: aisuite_ollama_fastapi_moonshine_gemma_kokoto.sh
#!/bin/bash
##
## This script creates a FastRTC server which is well suited for audio conversations.
##
## Credits: https://www.youtube.com/watch?v=NthuElhWDk0
###
function aisuite_check_python3() {
@frgomes
frgomes / install_headscale.sh
Last active August 30, 2025 11:50
bash : install headscale onto Debian
#!/bin/bash -x
function headscale_globals() {
HEADSCALE_VERSION="0.26.1"
HEADSCALE_ARCH="amd64"
HEADSCALE_USER="headscale" ## DO NOT CHANGE THIS!!!
HEADSCALE_GROUP="headscale" ## DO NOT CHANGE THIS!!!
HEADSCALE_CONFIG=/etc/headscale ## DO NOT CHANGE THIS!!!
@frgomes
frgomes / python-bootstrap.sh
Last active April 5, 2025 23:44
python :: bootstrap development environment
#!/bin/bash
####################################################################################
# This file is intended to be sourced by a CI server, or used in development mode. #
####################################################################################
# Install uv :: https://pypi.org/project/uv/
curl -LsSf https://astral.sh/uv/install.sh | sh
export PATH="$PATH:${HOME}/.local/bin"
@frgomes
frgomes / proxmox_openwrt.txt
Last active March 16, 2024 22:08
proxmox: install openwrt
proxmox / local / CT Templates
------------------------------
Download from URL: https://images.linuxcontainers.org/images/openwrt/23.05/amd64/default/20240316_11%3A57/rootfs.tar.xz
SHA-256: d6df8e1abeb24965146e22186b7aa767e3d42fac7fd71be0805cbc0c82377917
proxmox console
---------------
pct create 201 /var/lib/vz/template/cache/openwrt-20240316.tar.xz --arch amd64 --hostname openwrt --rootfs local-lvm:201 --memory 1024 --cores 2 --ostype unmanaged --unprivileged 1 --net0 name=eth0 --net1 name=eth1 --storage local-lvm
@frgomes
frgomes / RuntimeTypeTag.scala
Last active February 25, 2023 01:42
Scala / Spark: allows obtaining schema from runtime TypeTag obtained from class loaded over the wire
import scala.reflect.runtime.universe._
import scala.reflect.api
def runtimeTypeTagOf(name: String, parent: ClassLoader, url: java.net.URL): TypeTag[_] =
runtimeTypeTagOf(name, parent, Seq(url))
def runtimeTypeTagOf(name: String, parent: ClassLoader, urls: Seq[java.net.URL]): TypeTag[_] =
runtimeTypeTagOf(name, new java.net.URLClassLoader(urls.toArray, parent))
def runtimeTypeTagOf(name: String, cl: ClassLoader): TypeTag[_] = {
val c = Class.forName(name, true, cl)
val mirror: Mirror = runtimeMirror(cl)
@frgomes
frgomes / TypeTag2ClassTag.scala
Last active January 31, 2023 12:52
Scala: obtain ClassTag from TypeTag
import reflect.runtime.universe._
import reflect.ClassTag
def typeTag2ClassTag[T: TypeTag]: ClassTag[T] = {
ClassTag[T]( typeTag[T].mirror.runtimeClass( typeTag[T].tpe ) )
}