Change Action Mailer Settings From Rails Console

In Rails applications, ActionMailer is a powerful module used to send emails. It’s essential to configure your ActionMailer settings correctly to ensure that your application can send emails reliably through your chosen SMTP server. Typically, these settings are configured in your environment files (e.g., config/environments/production.rb). However, there may be instances where you need to override these settings temporarily through the Rails console—for example, when testing a custom configuration or troubleshooting email delivery issues.

Test Scanner (scanner emulator) in SANE - Linux

2024 Hacktoberfest has begun, and I decided to dive into some open-source contributions! One project that caught my eye was the Scanner Server. It offers a web interface for using scanners, which seemed pretty interesting.

I was eager to contribute but quickly realized I didn’t have a scanner to test it with 😅. Fortunately, Linux’s SANE (Scanner Access Now Easy) software comes to the rescue! It includes a feature that lets you select a test scanner model. With this, you always have a virtual scanner called “test” available. While it only scans a black image, it behaves just like a real scanner for all practical purposes.

Using Docker to export & import data from Amazon RDS

Docker is an efficient way to use command-line tools without needing to install them or their required libraries. Recently, I had a use case where I needed to take an SQL dump of a schema from a PostgreSQL database. The problem was that the PostgreSQL DB was version 16.3, while my local DB was only version 15. Using my local pg_dump to access the remote database resulted in a version incompatibility error. To fix this, I would either need to upgrade pg_dump or have both versions installed simultaneously on my machine. I didn’t want to do either. This is where Docker came to the rescue.

AWS ECR Lifecycle Policy

Amazon Elastic Container Registry (ECR) is a service provided by Amazon for hosting our Docker/container images. The cost of downloading these images to a server or ECS (Elastic Container Service) within the same zone is free. However, downloading or uploading from the public internet incurs costs, as does storage space usage.

During the development and deployment of your project, you may find yourself building images as frequently as every 30 minutes. This frequency reflects my own experience. Whenever new code is merged with the master branch, it triggers a code build pipeline. This pipeline ultimately pushes the latest image to ECR, typically tagged as “latest.” Consequently, the previous image remains in the repository but becomes untagged. While retaining a few versions of older deployments facilitates easy rollbacks, after a day or two, they tend to become redundant. At this juncture, they serve no purpose other than incurring storage costs.

Handle SSH Idle Connections Freezing shell or Getting Disconnected

As someone who has been working with servers for over a decade and a half, I feel embarrassed to admit that I only recently stumbled upon this setting. Throughout my years of connecting to remote servers over the internet, I’ve encountered instances where connections freeze or break after a period of inactivity. Sometimes it happens more frequently, while other times it never occurs at all. When I was in the US connecting to Amazon servers, there were occasions when the connection remained stable for days on end. This led me to believe that the issue might be related to the internet or the complexity of the network routing required to reach the server.