Skip to content

Instantly share code, notes, and snippets.

View itxtoledo's full-sized avatar
🏠
Working from home

Gustavo itxtoledo

🏠
Working from home
View GitHub Profile
@itxtoledo
itxtoledo / solana-volume-bot.ts
Last active July 10, 2025 19:29
Bot to create random trades
import {
Connection,
Keypair,
PublicKey,
VersionedTransaction,
TOKEN_PROGRAM_ID,
sendAndConfirmTransaction,
type Commitment
} from "@solana/web3.js";
import {
@itxtoledo
itxtoledo / typebot-coolify.yaml
Last active July 30, 2025 12:50
Docker Compose for deploying a Typebot instance on Coolify with little to no configuration
x-typebot-common: &typebot-common
depends_on:
postgresql:
condition: service_healthy
# redis:
# condition: service_healthy
maildev:
condition: service_started
x-typebot-env: &typebot-env
@itxtoledo
itxtoledo / desktop-easy-setup-linux-vm.sh
Last active July 14, 2025 23:39
Optimized automation script for installing xRDP and LXDE, a minimal desktop environment, on Ubuntu VPS systems, enabling remote desktop access with low resource usage.
#!/bin/bash
# Script for installing Lightweight Desktop (Xfce) + xRDP on Ubuntu/Debian
# Author: Gustavo Toledo (modified for X11 display and authorization fix)
set -e
# Global variables
GENERATED_PASSWORD=""
CREATED_USERNAME=""
@itxtoledo
itxtoledo / wg-easy-setup-oracle-vm.sh
Last active August 8, 2025 18:23
Optimized script to install wg-easy on Oracle Linux (Oracle Cloud) in a VPS with 1 GB of RAM
#!/bin/bash
# Check if running as root
if [[ $EUID -ne 0 ]]; then
echo "Error: This script must be run as root. Use sudo."
exit 1
fi
# Initial settings
set -euo pipefail
@itxtoledo
itxtoledo / smtp-config-schema.json
Created December 4, 2024 20:44
JSON Schema for validating SMTP configurations. This schema ensures that each configuration in an array contains the required properties (host, port, user, and pass) with the correct data types and disallows additional properties.
{
"$schema": "http://json-schema.org/draft-07/schema#",
"type": "array",
"items": {
"type": "object",
"properties": {
"host": {
"type": "string"
},
"port": {
@itxtoledo
itxtoledo / gerar_resumo_de_noticias_ia.js
Created March 23, 2024 22:52
Script para gerar resumo das melhores noticias do site The Defiant e obter um resumo do mercado pela api do Coinsamba
import Parser from "rss-parser";
import OpenAI from "openai";
import axios from "axios";
import clipboardy from "clipboardy";
let parser = new Parser();
const api = new OpenAI({
apiKey: "paste_here",
});
@itxtoledo
itxtoledo / Dockerfile
Created December 23, 2023 03:00
Dockerfile nodejs yarn
FROM node:18.0.0-alpine
ARG SSH_KEY
RUN apk add --no-cache dumb-init
ENTRYPOINT ["/usr/bin/dumb-init", "--"]
WORKDIR /usr/src/app
@itxtoledo
itxtoledo / pearson.html
Created February 9, 2021 14:30
Correlação de Pearson em JavaScript
<html>
<head>
<meta charset="utf-8">
<title>Correlação de Pearson</title>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.2.1/css/bootstrap.min.css" integrity="sha384-GJzZqFGwb1QTTN6wy59ffF1BuGJpLSa9DkKMp0DgiMDm4iYMj70gZWKYbI706tWS" crossorigin="anonymous">
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.6/umd/popper.min.js" integrity="sha384-wHAiFfRlMFy6i5SRaxvfOCifBUQy1xHdJ/yoi7FRNXMRBu5WHdZYu1hA6ZOblgut" crossorigin="anonymous"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.2.1/js/bootstrap.min.js" integrity="sha384-B0UglyR+jN6CkvvICOB2joaf5I4l3gm9GU6Hc1og6Ls7i6U/mkkaduKaBhlAXv9k" crossorigin="anonymous"></script>
</head>
@itxtoledo
itxtoledo / pmginx.sh
Last active June 13, 2020 23:31
Instalar pacotes para deploy de uma API Node.js com NGINX e PM2
#!/bin/bash
# executar com sudo
# wget -O - thisUrl | bash
apt-get install apt-transport-https -y
apt-get update -y && apt-get upgrade -y && apt-get install curl -y
curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -
echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list
@itxtoledo
itxtoledo / rabbitmq-install.sh
Last active December 23, 2019 15:13
RabbitMQ Install Script, tested on Ubuntu 16.04
#! /bin/bash
# sudo curl -s https://gist.githubusercontent.com/xxx/xxx/raw/3xxx/rabbitmq-install.sh | bash -s
rabbit_deb=rabbitmq-server_3.6.15-1_all.deb
wget https://www.rabbitmq.com/releases/rabbitmq-server/v3.6.15/"$rabbit_deb"
dpkg -i "$rabbit_deb"
sudo apt-get -f -y install
rm "$rabbit_deb"
#rabbitmq wants this dir in ubuntu, but things should work without it exist
sudo mkdir /etc/rabbitmq/rabbitmq.conf.d