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
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:
AWS serverless öğrenmek isteyenlere şunları tavsiye edebilirim:
This project is a tiny compiler for a very simple language consisting of boolean expression.
The language has two constants: 1
for true and 0
for false, and 4 logic gates:
!
(not), &
(and), |
(or), and ^
(xor).
It can also use parentheses to manage priorities.
Here is its grammar in BNF format:
expr ::= "0" | "1"
Name,Type,Level,Duration,Cost,Lang,Description | |
Security on AWS,Quest,,27 minutes,Free,,"This quest is designed to teach you how to apply AWS Identity and Access Management, in concert with several other AWS Services, to address real-world application and service security management scenarios." | |
Serverless Web Apps using Amazon DynamoDB,Quest,,5 hours,3 Credits,,"Serverless architectures allow you to build and run applications and services without needing to provision, manage, and scale infrastructure. This quest will show how to design, build, and deploy interactive serverless web applications, using a simple HTML/JavaScript web interface which uses Amazon API Gateway calls to send requests to AWS Lambda backends that query Amazon DynamoDB data." | |
Alexa Skills Development,Quest,,4 hours,30 Credits,,"In this Quest, you will learn how to create Alexa skills that respond to voice commands and which can be used on the Amazon Echo, Dot, and Tap devices. You will create back-end functions in AWS Lambda, and then conn |
from datetime import datetime, timedelta | |
import time | |
import requests | |
import sys | |
import os | |
second = 1000 | |
minute = second * 60 | |
hour = minute * 60 | |
day = hour * 24 |
WARNING: interfaces can enumarate differently:
ufw status
#iptables -F
#iptables --table nat --append POSTROUTING --out-interface wlxe0b94db737c9 -j MASQUERADE
#iptables --table nat --append POSTROUTING --out-interface enp0s20u1u1 -j MASQUERADE
iptables --table nat --append POSTROUTING --out-interface enp0s20u1u2 -j MASQUERADE
#iptables --append FORWARD --in-interface enx1cba8c9bbeb5 -j ACCEPT
#iptables --append FORWARD --in-interface enx9884e391a556 -j ACCEPT
iptables --append FORWARD --in-interface enx9884e391a559 -j ACCEPT
This is a RESTful Rails controller, implementing all 7 RESTful actions. In my Rails apps, 9 out of 10 controllers will end up looking like this.
class PostsController < ApplicationController
load_and_authorize_resource
def create
@post.save and redirect_to(@post) or render(:new)
end
Recently CSS has got a lot of negativity. But I would like to defend it and show, that with good naming convention CSS works pretty well.
My 3 developers team has just developed React.js application with 7668
lines of CSS (and just 2 !important
).
During one year of development we had 0 issues with CSS. No refactoring typos, no style leaks, no performance problems, possibly, it is the most stable part of our application.
Here are main principles we use to write CSS for modern (IE11+) browsers:
#!/bin/bash | |
# | |
# run this script on your linux host computer to connect to the bbb and forward your internet. | |
# be sure to replace "enp0s20u1" with the appropriate usb device for your bbb, which can be found | |
# by doing an "ifconfig" on your host computer. | |
# | |
sudo -- sh -c 'echo 1 > /proc/sys/net/ipv4/ip_forward' | |
sudo iptables -A POSTROUTING -t nat -j MASQUERADE |