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
<%@ language="Javascript" %> | |
<script language="javascript" runat="server" src='json2.js'></script> | |
<script language="javascript" runat="server" src='stringExtensions.js'></script> | |
<script language="javascript" runat="server" src='contentNego.js'></script> | |
<script language="javascript" runat="server"> | |
(function() { | |
// In an ASP scenario, this fn gets "exported" |
WITH RECURSIVE transitive_dependencies AS ( | |
SELECT package_id AS dependency_id, package_id AS root_id | |
FROM dependencies | |
WHERE kind = 'runtime' | |
UNION ALL | |
SELECT d.package_id, td.root_id | |
FROM dependencies d | |
JOIN transitive_dependencies td ON td.dependency_id = d.package_id AND td.dependency_id <> td.root_id -- Avoid self-joins | |
WHERE d.kind = 'runtime' | |
), |
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:
#include <stdio.h> | |
#include <sys/inotify.h> | |
#include <sys/time.h> | |
#include <sys/epoll.h> | |
#include <errno.h> | |
#include <linux/memfd.h> | |
#include <sys/mman.h> | |
#include <sys/syscall.h> |
The list would not be updated for now. Don't write comments.
The count of contributions (summary of Pull Requests, opened issues and commits) to public repos at GitHub.com from Wed, 21 Sep 2022 till Thu, 21 Sep 2023.
Because of GitHub search limitations, only 1000 first users according to amount of followers are included. If you are not in the list you don't have enough followers. See raw data and source code. Algorithm in pseudocode:
githubUsers
Vsocks are a means of providing socket communication (either stream or datagram) directly between VMs and their host operating system. The host and each VM have a 32 bit CID (Context IDentifier) and may connect or bind to a 32 bit port number. Ports < 1024 are privileged ports.
#!/bin/bash | |
TARGETDIR=$1 | |
if [ "$TARGETDIR" = "" ]; then | |
TARGETDIR=$(python -c 'import os; print os.path.realpath("local")') | |
fi | |
mkdir -p $TARGETDIR | |
libevent() { | |
curl -LO https://github.com/libevent/libevent/releases/download/release-2.0.22-stable/libevent-2.0.22-stable.tar.gz | |
tar -zxvf libevent-2.0.22-stable.tar.gz |
// First, let's look at the traditional visitor pattern | |
// This is how we might implement a simple expression evaluator | |
// Traditional Visitor Pattern | |
namespace Traditional { | |
// Abstract base class for expressions | |
abstract class Expr { | |
abstract accept<T>(visitor: ExprVisitor<T>): T; | |
} |
You can take the same source code package that Ubuntu uses to build jq, compile it again, and realize 90% better performance.
I use jq
for processing GeoJSON files and other open data offered in JSON format. Today I am working with a 500MB GeoJSON file that contains the Alameda County Assessor's parcel map. I want to run a query that prints the city for every parcel worth more than a threshold amount. The program is
#include <stdlib.h> | |
#include <stdio.h> | |
#include <sys/ipc.h> | |
#include <sys/shm.h> | |
#include <xcb/xcb.h> | |
#include <xcb/shm.h> | |
#include <xcb/xcb_image.h> |