Skip to content

Instantly share code, notes, and snippets.

View macedot's full-sized avatar

Thiago Macedo macedot

View GitHub Profile
@macedot
macedot / qwen3.5_chat_template.jinja
Created March 7, 2026 14:20 — forked from sudoingX/qwen3.5_chat_template.jinja
Patched Jinja template for Qwen 3.5 27B - fixes developer role crash + preserves thinking mode (thinking = 1). Drop-in replacement for agent tools (OpenCode, Claude Code, Continue, Cursor, Aider). Without this patch, --chat-template chatml silently kills thinking mode.
{%- set image_count = namespace(value=0) %}
{%- set video_count = namespace(value=0) %}
{%- macro render_content(content, do_vision_count, is_system_content=false) %}
{%- if content is string %}
{{- content }}
{%- elif content is iterable and content is not mapping %}
{%- for item in content %}
{%- if 'image' in item or 'image_url' in item or item.type == 'image' %}
{%- if is_system_content %}
{{- raise_exception('System message cannot contain images.') }}
@macedot
macedot / rename_proxmox.sh
Last active January 11, 2026 16:54
Proxmox Node Rename Script
#!/bin/bash
# Proxmox Node Rename Script v1.6 - FUSE/Bypass Fix for Standalone
# Usage: ./rename_proxmox.sh [OPTIONS] <FULL_HOSTNAME>
# Example: ./rename_proxmox.sh -n horus.localdomain
set -e
DRY_RUN=false
FULL_HOSTNAME=""
@macedot
macedot / ai-jail.sh
Created January 10, 2026 21:16
Bash sandbox from akitaonrails
#!/bin/bash
## https://akitaonrails.com/2026/01/10/ai-agents-garantindo-a-protecao-do-seu-sistema/
## usage: ai-jail --map ~/Projects/test --map ~/Projects/test2 crush
# Configuration
PROJECT_DIR=$(pwd)
REAL_HOME_CONFIG="$HOME/.config"
SPARSE_HOME=$(mktemp -d /tmp/bwrap-home.XXXXXX)
TEMP_HOSTS=$(mktemp /tmp/bwrap-hosts.XXXXXX)
@macedot
macedot / go-color-test.go
Created April 9, 2025 20:22
Color Test Generator
package main
import (
"flag"
"fmt"
"math/bits"
"os"
"strconv"
"github.com/veandco/go-sdl2/sdl"
@macedot
macedot / sudoku-solver.cpp
Created November 28, 2023 23:18
Sudoku Solver
#include <array>
#include <iostream>
#include <filesystem>
#include <fstream>
#include <string>
#include <vector>
constexpr auto BOARD_RADIX = 9;
using Board = std::array<uint8_t, BOARD_RADIX * BOARD_RADIX>;
@macedot
macedot / bn_strassen.cpp
Created February 16, 2023 09:30 — forked from hamsham/bn_strassen.cpp
Bignum multiplication of numbers with arbitrary bases, using the Schönhage-Strassen algorithm.
/**
* Bignum multiplication of numbers with arbitrary bases, using the
* Schonhage-Strassen algorithm.
*
* g++ -std=c++11 -Wall -Wextra -Werror -pedantic-errors bn_strassen.cpp -o bn_strassen
*
* usage: bn_strassen.exe 123456789 987654321
*
* Sources:
@macedot
macedot / WindowsSpyBlocker.txt
Created January 31, 2023 17:15
WindowsSpyBlocker - Hosts spy rules
! Source: https://raw.githubusercontent.com/crazy-max/WindowsSpyBlocker/master/data/hosts/spy.txt
! WindowsSpyBlocker - Hosts spy rules
! License: MIT
! Updated: 2022-05-16T13:25:00Z02:12
! Donate: https://github.com/sponsors/crazy-max ; https://www.paypal.me/crazyws
! More info: https://github.com/crazy-max/WindowsSpyBlocker
||1oavsblobprodcus350.blob.core.windows.net^
||37bvsblobprodcus311.blob.core.windows.net^
||a.ads1.msn.com^
@macedot
macedot / backup.sh
Created April 11, 2022 14:33
Simple bash command for backup using 7z
#!/bin/bash
SRC=$1
[[ -z "${SRC}" ]] && exit 0
[[ -e "${SRC}" ]] || exit 1
input=$(realpath "${SRC}")
date=$(date '+%Y%m%d_%H%M%S')
7z a "${input}_${date}.7z" ${input}
@macedot
macedot / YuvConvertor.java
Created March 23, 2022 18:06 — forked from mebjas/YuvConvertor.java
YUV_420_888 Image to Bitmap using ScriptIntrinsicYuvToRGB
class YuvConvertor {
private final Allocation in, out;
private final ScriptIntrinsicYuvToRGB script;
static {
System.loadLibrary("yuv2rgb-lib");
}
public YuvConvertor(Context context, int width, int height) {
RenderScript rs = RenderScript.create(context);
@macedot
macedot / stat.hpp
Last active September 16, 2022 19:18
Basic descriptive statistics
//https://quick-bench.com/q/Y2QpDoIqxox3feajud-PlrQQeMM
//https://godbolt.org/z/TqzeGWMh1
#include <algorithm>
#include <iostream>
#include <numeric>
#include <vector>
#include <cmath>
template<typename _Tx>