Skip to content

Instantly share code, notes, and snippets.

View gubatron's full-sized avatar

Angel Leon gubatron

View GitHub Profile
@gubatron
gubatron / venezuela_regime_change_strategy_debate.md
Last active October 14, 2025 03:14
Venezuela Regime Change Strategy Debate

Venezuela Regime Change Strategy Debate

Demonstrating Multi-Agent Council Collaboration

Powered by cloudllm 0.4.0

Setting up council agents...

Council configured with 5 agents

Question:

@gubatron
gubatron / libtorrent_performance_opportunities.md
Created October 12, 2025 17:27
libtorrent performace optimization opportunity

Top 5

  1. Cache POSIX file handles inside posix_storage::read/write to avoid reopening on every block and collapse syscall churn on Linux/macOS builds.
  2. Replace disk_buffer_pool’s per-buffer malloc + global mutex with an actual freelist/slab allocator to cut allocator latency and cross-thread contention.
  3. Make piece_picker::pick_pieces’ ignored-piece bookkeeping O(1) to remove quadratic scans in large swarms.
  4. Back peer_connection’s request queue with a queue/deque structure so front removals stop mem-moving full vectors on every send.
  5. Drop the hot socket.available() ioctl inside peer_connection::on_receive_data and rely on buffered reads to avoid extra syscalls.

[Title]: Cache file handles in posix_storage to eliminate per-block fopen/fclose Component(s): src/posix_storage.cpp, src/storage_utils.cpp, include/libtorrent/aux_/posix_storage.hpp

@gubatron
gubatron / dbtc_newsletter_stories_getter
Created October 7, 2025 14:31
Tool to extract the text of the articles pointed by our DiarioBitcoin newsletter, done by Codex autonomously in 5 minutes
#!/usr/bin/env bash
set -euo pipefail
if [ "$#" -ne 1 ]; then
echo "Usage: $(basename "$0") <newsletter_url>" >&2
exit 1
fi
NEWSLETTER_URL="$1"
@gubatron
gubatron / embed_tweet_html.php
Last active September 27, 2025 11:28
PHP function to return HTML to embed a tweet like publish.x.com would
<?php
/**
* Returns HTML to embed a tweet like publish.x.com would
*/
function embed_tweet_html(string $tweet_url) : ?string {
// Encode the tweet URL for the query parameter
$encoded_url = urlencode($tweet_url);
// Construct the oEmbed API URL
$api_url = "https://publish.twitter.com/oembed?url=" . $encoded_url;
@gubatron
gubatron / gist:2cf9ed6d9b76ade18f4d699ba8aa6bf3
Created July 31, 2025 03:36
Elusive crash, seen on x86_64
Maybe there's a symbol missing.
The class 'NSOpenPanel' overrides the method identifier. This method is implemented by class 'NSWindow'
Exception in thread "AWT-EventQueue-0" java.lang.UnsatisfiedLinkError: 'long com.frostwire.jlibtorrent.swig.libtorrent_jni.session_handle_find_torrent__SWIG_0(long, com.frostwire.jlibtorrent.swig.session_handle, long, com.frostwire.jlibtorrent.swig.sha1_hash)'
at com.frostwire.jlibtorrent.swig.libtorrent_jni.session_handle_find_torrent__SWIG_0(Native Method)
at com.frostwire.jlibtorrent.swig.session_handle.find_torrent(session_handle.java:95)
at com.frostwire.jlibtorrent.SessionManager.find(SessionManager.java:452)
at com.frostwire.bittorrent.BTEngine.download(BTEngine.java:303)
at com.frostwire.gui.bittorrent.BTDownloadMediator.lambda$openTorrentFile$2(BTDownloadMediator.java:654)
at java.desktop/java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:318)
@gubatron
gubatron / rust projects default Makefile
Last active September 25, 2025 16:04
Makefile for rust projects
# Makefile
.PHONY: build release clean fmt check test install doc help tasks
default: help
# Default target (ensures formatting before building)
build: fmt ## Build the project in release mode (runs fmt first)
cargo build --release
@gubatron
gubatron / A National Singularity Fund for High Universal Income: Redefining Work, Empowering Passions, and Embracing a Post-Labor Future.md
Last active January 21, 2025 02:29
A National Singularity Fund for High Universal Income: Redefining Work, Empowering Passions, and Embracing a Post-Labor Future

A National Singularity Fund for High Universal Income:

Redefining Work, Empowering Passions and Embracing a Post Labor Future

Introduction

As Artificial General Intelligence (AGI) surpasses human-level cognition and super-dexterous robots automate vast swaths of manual and knowledge-intensive work, billions of people risk losing their traditional jobs. This scenario is often painted in stark terms—one of displacement, unemployment, and fear. Yet, a deeper truth lies in the fact that a future of abundant automation can liberate society from rote or uninspiring labor, allowing individuals to pursue creativity, innovation, personal growth, and genuine passions.

To prevent social unrest and ensure equitable benefits, we propose a National Singularity Fund (NSF). The NSF collects and manages revenue from automation taxes, equity grants, and targeted investments in exponential technologies (AGI, quantum computing, fusion energy). By distributing High Universal Income (HUI) to

@gubatron
gubatron / ssh-git-signing.md
Last active September 18, 2025 01:55
Signing github commits with your SSH key

GPG gives a lot of shit on macos for some reason.

It's best to just add the same SSH authentication key you have on github as a "Signing Key"

$ git config [--global] gpg.format ssh
$ git config [--global] user.signingkey ~/.ssh/id_rsa.pub
$ git config [--global] commit.gpgsign true
@gubatron
gubatron / RAG Frameworks.md
Created November 1, 2024 19:41
RAG Frameworks comparison
Framework Description Key Features Language Support Integration Capabilities Deployment Options License
RaLLe A framework for developing and optimizing retrieval-augmented large language models (R-LLMs) for knowledge-intensive tasks. - Development and evaluation of R-LLMs
- Optimization tools for knowledge-intensive applications
Python - Compatible with various LLMs
- Supports integration with external knowledge bases
Local and cloud deployment MIT License
BERGEN A benchmarking library that standardizes experiments and provides tools for evaluating RAG pipelines. - Standardized benchmarking
- Comprehensive evaluation tools
- Support for various RAG components
Python - Integrates with multiple retrieval and generation models Local deployment Apache 2.0 License
RAGFlow An open-source RAG engine based on deep document un
@gubatron
gubatron / Building-libbittcoin-network-on-macos-arm64.md
Last active October 23, 2024 00:04
Building libbitcoin-network on macos with arm64 chip, clang 16

Building libbitcoin-network on macos arm64

$ clang --version
Apple clang version 16.0.0 (clang-1600.0.26.3)
Target: arm64-apple-darwin23.5.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin

$ uname -a