Skip to content

Instantly share code, notes, and snippets.

View rameerez's full-sized avatar
✨
creating

Javi rameerez

✨
creating
View GitHub Profile
@rameerez
rameerez / telegram_mtproxy_stats_1yr.txt
Created April 20, 2025 23:53
Telegram MTProxy stats after 1 year running
pid 5126
start_time 1745121601
current_time 1745192772
uptime 71171
tot_idle_time 71108.817
average_idle_percent 99.913
recent_idle_percent 99.218
active_network_events 0
time_after_epoll 0.000023
epoll_calls 2168530
@rameerez
rameerez / kamal-production-server-setup.sh
Last active November 11, 2026 00:39
Set up a Ubuntu 24.04/26.04 server to deploy Kamal 2.x Docker containers to, hardened security and production ready
#!/bin/bash
# ─────────────────────────────────────────────────────────────────────────────
# Production Docker Host Setup & Hardening Script — v3.2.1
# For Ubuntu Server 24.04 LTS (Noble) and 26.04 LTS (Resolute)
# Suitable for both Kamal 2.x deployment hosts and remote builder hosts
#
# Part of RailsFast (https://railsfast.com) — free & open source, MIT licensed.
#
# Usage (as root, on a fresh server):
@rameerez
rameerez / postgres-production-setup.sh
Last active December 4, 2026 15:13
PostgreSQL Production Server Setup - Set up a new Ubuntu Server 24.04 LTS machine to run a production Postgres server
#!/bin/bash
# This script takes a clean Ubuntu Server 24.04 LTS image and installs and configures
# everything needed to deploy a production-ready PostgreSQL server.
set -euo pipefail
# --- AESTHETICS ---
GREEN='\033[0;32m'
@rameerez
rameerez / listmonk-setup.sh
Last active June 13, 2025 05:32
Set up a production Listmonk instance on a previously Docker-configured Ubuntu Server machine
#!/bin/bash
# Production-Ready Listmonk Setup Script
# This script sets up Listmonk with Docker Compose, Nginx reverse proxy, and automatic SSL
set -euo pipefail
# Function to generate a secure random password
generate_password() {
openssl rand -base64 32 | tr -d /=+ | cut -c -32
@rameerez
rameerez / umami-setup.sh
Last active July 23, 2026 17:33
Production Umami self-hosted analytics setup (v2) — app layer only: Umami + Postgres (docker compose) + nginx + Let's Encrypt. Run https://setup.railsfast.com first to harden the host and install Docker.
#!/bin/bash
# ─────────────────────────────────────────────────────────────────────────────
# Umami Self-Hosted Analytics — App-Layer Setup Script v2.0.0
# For Ubuntu Server 24.04 LTS (Noble) and 26.04 LTS (Resolute)
#
# COMPANION to the RailsFast host hardening script (https://setup.railsfast.com).
# Run that FIRST — it hardens the host (SSH, ufw, fail2ban, sysctl, journald,
# unattended-upgrades, swap) and installs Docker CE + the compose plugin from
# Docker's official apt repository. This script deliberately does NONE of that;
@rameerez
rameerez / docker-host-production-setup-ubuntu-server.sh
Last active February 15, 2026 19:36
This script sets up a secure, production-ready Docker host on Ubuntu Server 22.04 LTS
#!/bin/bash
# Production Docker Host Setup Script
# This script sets up a secure, production-ready Docker host on Ubuntu Server 22.04 LTS
# It includes security hardening, performance optimizations, and best practices
# CAUTION: This script makes significant system changes. Use at your own risk.
set -euo pipefail
# --- AESTHETICS ---
@rameerez
rameerez / telegram-mtproxy.md
Last active November 11, 2026 00:39
Telegram Proxy How-To: complete and up-to-date MTProxy tutorial

How to set up a Telegram Proxy (MTProxy)

Telegram proxies can help people connect when Telegram is blocked. Telegram apps support them directly, so sharing a proxy can be as simple as sending someone a link.

I've used MTProxy to run my public Telegram proxy, which you can use if you don't want to set up your own.

A proxy cannot simply decrypt Telegram's encrypted message traffic, but it can observe client IP addresses, connection times, traffic volume and destinations. Its logs may retain that information. MTProxy is not a VPN or an anonymity guarantee, and it does not turn ordinary Telegram cloud chats into end-to-end encrypted Secret Chats. Choose an operator you trust.

Read this before choosing the software

@rameerez
rameerez / download_controlnet.py
Created February 15, 2024 02:39
Download all CrontrolNet models to Automatic1111
# Meant to be ran inside a `download.ipynb` notebook inside
# the `/workspace/stable-diffusion-webui/extensions/sd-webui-controlnet/models/` folder
# of an Automatic1111 installation
# !pip install requests
import requests
import os
# List of file names to download
@rameerez
rameerez / aws-ubuntu-server-ec2-instance-setup-for-rails-docker-kamal-deployment.sh
Last active December 31, 2024 16:41
Docker - Configure a clean Ubuntu Server instance to deploy Rails apps using Kamal
#!/bin/bash
sudo adduser --disabled-password docker
sudo chmod 755 /home/docker
sudo usermod -aG docker ${USER}
sudo apt-get update -y
sudo apt-get upgrade -y
sudo apt-get install -y ufw
@rameerez
rameerez / aws-amazon-linux-al2023-ec2-instance-setup-for-rails-docker-kamal-deployment.sh
Last active January 14, 2024 20:27
Configure an AWS EC2 instance running Amazon Linux 2023 to deploy Rails apps using Kamal (Docker)
#!/bin/bash
# This scrips takes a clean AWS Amazon Linux 2023 AMI and installs and configures
# everything needed to deploy a Rails app to it using Kamal.
# The resulting state is a clean instance ready to accept Kamal (Dockerized) apps.
# --- AESTHETICS ---
# Define the color code for green for echo messages