Skip to content

Instantly share code, notes, and snippets.

View rodjjo's full-sized avatar

Rodrigo Antônio de Araújo rodjjo

View GitHub Profile
@rodjjo
rodjjo / install_llama_cpp.sh
Created November 2, 2025 19:29
Install llama cpp python with cuda support in ubuntu 22.04
#!/bin/sh
export CC=/usr/bin/gcc CXX=/usr/bin/g++ CUDA_PATH=/usr/local/cuda CUDACXX=/usr/local/cuda/bin/nvcc
export LD_LIBRARY_PATH=/usr/lib/gcc/$(gcc -dumpmachine)/$(gcc -dumpversion):$LD_LIBRARY_PATH
CMAKE_ARGS="-DGGML_CUDA=on \
-DLLAMA_BUILD_EXAMPLES=OFF \
-DLLAMA_BUILD_TESTS=OFF" FORCE_CMAKE=1 CUDA_TOOLKIT_ROOT_DIR=/usr/local/cuda \
pip install llama-cpp-python==0.3.9 --no-cache-dir --force-reinstall --upgrade
@rodjjo
rodjjo / chroma_inpainting_pipeline.py
Created November 1, 2025 20:13
Chroma inpainting pipeline based on the flux pipeline
"""
ChromaInpaintPipeline implements a text-guided image inpainting pipeline for the lodestones/Chroma1-HD model,
based on the ChromaPipeline from Hugging Face Diffusers:contentReference[oaicite:0]{index=0} and the Stable Diffusion inpainting approach:contentReference[oaicite:1]{index=1}.
"""
import gc
import time
import torch
from typing import List, Union, Optional
from diffusers.models import AutoencoderKL
def load_models(self, loras: list = None, use_accelerator: bool = False, accelerator_steps: int = 8, for_inpainting: bool = False):
modified = any([
self.transformer is None,
self.vae is None,
self.text_encoder is None,
self.tokenizer is None,
self.processor is None,
self.scheduler is None,
self.pipe is None,
self.loras != loras,
@rodjjo
rodjjo / sha1.au3
Created April 11, 2020 20:23
Display a message box with file sha1 information
; compile this script to generate sha1.exe
; drag the file to executable to compute it's sha1
#include <Crypt.au3>
$sha1 = _Crypt_HashFile ($CmdLine[1], $CALG_SHA1)
MsgBox(0, 'Sha1 of ' & $CmdLine[1], $sha1)
@rodjjo
rodjjo / terraria-worlds-terrafirma.au3
Last active April 11, 2020 21:07
Generate random worlds and check if they have required items. Keep Seeds and sha1 hash.
#include <String.au3>
#include <AutoItConstants.au3>
#include <Crypt.au3>
; CODED WITH LOVE AND EXTREME GO HORSE METHOD
; Este script gera mapas do terraria usando o cliente até que os mapas tenha todos itens do array
; Leave terraria opened in window mode at world generation screen.
const $window_w = 1110
@rodjjo
rodjjo / card.js
Last active March 11, 2020 14:35
Find card's brand by given card number using it's prefix.
/*
Creates a mapping like:
{
'2': { # length 2
'33': 'Card X'
},
'1': { # length 1
'4': 'Card Y',
}
}
@rodjjo
rodjjo / popup-blocker.au3
Last active March 31, 2020 16:13
Opens firefox and close any window that open after the first one. must replace firefox path
#include <MsgBoxConstants.au3>
#include <Array.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#include <WinAPISysWin.au3>
Func RunWaitFirefox()
Run('D:\Mozilla Firefox\firefox.exe')
Sleep(1000)
@rodjjo
rodjjo / install_kvm_and_minikube.sh
Created June 13, 2019 20:13
Instala minekube e kvm (verifica se já instalou antes de baixar cada elemento)
#!/bin/bash
mkdir -p "temp"
# install kubectl
kubectl version > /dev/null
if [ $? -eq 127 ]; then
curl -LO https://storage.googleapis.com/kubernetes-release/release/$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)/bin/linux/amd64/kubectl
chmod +x ./temp/kubectl
sudo mv ./temp/kubectl /usr/local/bin/kubectl
fi