How CSRF Tokens work in Ruby on Rails?

Category: Ruby :: Published at: 16.12.2024

All modern frameworks offer protection against CSRF attacks, so these attacks are not as common anymore.
However, this does not mean we don't need to understand what they are and how to protect ourselves from them.

In this article, I will explain what a Rails engineer needs to know about CSRF.

Read more

How to easily connect your docker container with a postgres on EC2 instance

Category: Ruby :: Published at: 11.10.2024

Let's say, you have a Rails app packed inside docker container. You also have a pg server installed directly on your virtual machine (well, just to save your money). This can be a problem, because on production you should allow only specific ips to have a connection to your database.

How you can do it then? This is a tutorial.

Read more

How to renew SSL certificates with Certbot

Category: Ruby :: Published at: 29.09.2024

If you are using Amazon Linux 2 and want to install SSL Certificate for your domains, certbot is a right call.

This is how you can do it, and also additional info about how you can renew existing certificate

Read more

Run one spec multiple times

Category: Ruby :: Published at: 22.05.2023

Simple code to run one spec multiple times:

for i in `seq 10`; do rspec spec; done

How to use basic Redis commands?

Category: Ruby :: Published at: 30.01.2023

Redis is quite easy to use, it's just basic key->value database which can be used in many different cases.

Let's assume, we already have Redis server setup in our application, and only need to use it.

Read more

Cheatsheet about extending Ruby classes

Category: Ruby :: Published at: 10.06.2022

Here is my small cheatsheet which will help you to extend any Ruby class.

I found out it very helpful and i hope, it will also be a nice help for you.

Read more