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
defmodule Task do | |
defp await_one(tasks, timeout \\ 5_000) when is_list(tasks) do | |
awaiting = | |
Map.new(tasks, fn %Task{ref: ref, owner: owner} = task -> | |
if owner != self() do | |
raise ArgumentError, invalid_owner_error(task) | |
end | |
{ref, true} | |
end) |
import Ecto.Changeset | |
@spec validate_email(Ecto.Changeset.t(), atom) :: Ecto.Changeset.t() | |
def validate_email(changeset, field) when is_atom(field) do | |
changeset | |
|> validate_length(field, max: 160) | |
|> validate_change(field, &validate_email_rfc5322/2) | |
end | |
defp validate_email_rfc5322(field, email) do |
# THIS LINUX SETUP SCRIPT HAS MORPHED INTO A WHOLE PROJECT: HTTPS://OMAKUB.ORG | |
# PLEASE CHECKOUT THAT PROJECT INSTEAD OF THIS OUTDATED SETUP SCRIPT. | |
# | |
# | |
# Libraries and infrastructure | |
sudo apt update -y | |
sudo apt install -y \ | |
docker.io docker-buildx \ | |
build-essential pkg-config autoconf bison rustc cargo clang \ |
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:
Crossplane is an Open-Source project that enables management of almost anything in the Cloud via the Kubernetes API.
Crossplane version 1.14 released November 1, 2023, is one of the most consequential releases in the project's history.
While Composition Functions and Provider performance improvements are headline features, there are substantial updates across the project: from a focus on developer and operator experience, Upbound's code donation to the CNCF, to API maturation.
This Document was updated November 7, 2023.
defmodule NestedWeb.FormLive do | |
use NestedWeb, :live_view | |
require Logger | |
defmodule Form do | |
use Ecto.Schema | |
import Ecto.Changeset | |
embedded_schema do | |
field :name, :string |
Note: I have moved this list to a proper repository. I'll leave this gist up, but it won't be updated. To submit an idea, open a PR on the repo.
Note that I have not tried all of these personally, and cannot and do not vouch for all of the tools listed here. In most cases, the descriptions here are copied directly from their code repos. Some may have been abandoned. Investigate before installing/using.
The ones I use regularly include: bat, dust, fd, fend, hyperfine, miniserve, ripgrep, just, cargo-audit and cargo-wipe.
#lang racket/base | |
;; Generate a form email to let someone know their SPF records are misconfigured for their current email provider. | |
;; | |
;; Run (fill-report "domain.com" "1.2.3.4") where the 2nd arg is the sending email server's IP address. | |
;; It will copy the completed report to the clipboard for you. | |
;; Only works on Windows for now. | |
(require net/dns |