This is an opinionated handbook on how I migrated all my Rails apps off the cloud and into VPS.
This is how I manage real production loads for my Rails apps. It assumes:
- Rails 7+
- Ruby 3+
- PostgreSQL
- Ubuntu Server 24.04
- Capistrano, Puma, Nginx
| #!/bin/bash | |
| # Ensure the script is run as root | |
| if [ "$(id -u)" -ne 0 ]; then | |
| echo -e "${RED}ERROR: This script must be run as root.${NC}" | |
| exit 1 | |
| fi | |
| # Define aesthetics | |
| RED='\033[0;31m' |
This is an opinionated handbook on how I migrated all my Rails apps off the cloud and into VPS.
This is how I manage real production loads for my Rails apps. It assumes:
| #!/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 |
| #!/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 |
| # 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 |
This tutorial will teach you how to set up a Telegram MTProxy on an Ubuntu 22.04 sever using AWS Lightsail, although you can use any other Linux distribution and cloud provider.
Using a Telegram proxy is a safe, easy and effective way of overcoming Telegram bans. It's useful, for example, to keep using Telegram under tyrannical regimes, or to circumvent judges' decisions to block Telegram.
Telegram proxies are a built-in feature in all Telegram apps (both mobile and desktop). It allows Telegram users to connect to a proxy in just one or two clicks / taps.
Telegram proxies are safe: Telegram sends messages using their own MTProto secure protocol, and the proxy can only see encrypted traffic – there's no way for a proxy to decrypt the traffic and read the messages. The proxy does not even know which Telegram users are using the proxy, all the proxy sees is just a list of IPs.
| #!/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 --- |
| #!/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; |
| #!/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 |
| #!/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' |