Posts
-
Securing Directories with Nginx Basic Auth
Protecting Your Web Content
Sometimes you have content on your website that you don’t want to be publicly accessible. Whether it’s a private section for family and friends, or a staging area for a new project, Nginx’s basic authentication is a simple and effective way to password-protect parts of your site.
In this post, we’ll walk through how to protect a directory called
/privateand everything inside it.1. Creating the Password File
First, we need to create a
.htpasswdfile that will store our username and password. The password needs to be encrypted. We can use thehtpasswdcommand-line tool for this. If you don’t have it, you can usually install it withapache2-utils. -
Blame the AI
Isn’t that nice and easy? I can just add a small note that a text or a piece of source code was created with the help of AI and then blame every mistake in my publication on the AI ;-)

-
#hex My public Hex Packages
Today I stumbled upon my old Github repository called hexpack-examples. It demonstrates the usage of several useful Elixir hex packages. Let’s take a closer look at them.
The repository provides examples for the following packages:
- data_source: This package provides a unified way to access data from various sources.
- bucketier: A simple and effective rate-limiter.
- timewrap: A package to handle time-related operations.
- exconfig: A package to manage application configuration. (deprecated)
The repository is a great resource for learning how to use these packages in a real-world scenario. The examples are well-tested and provide a good starting point for integrating these packages into your own projects.
-
#hex The 'data_source' Hex Package

In the Elixir ecosystem, managing data access is a crucial part of building robust applications. The
data_sourcehex package aims to simplify this by providing a unified interface for interacting with various data sources.While Elixir has excellent tools like
Ectofor database access,data_sourcecan be useful in scenarios where you need to fetch data from different types of sources, not just databases. It provides a consistent API, making your code cleaner and easier to maintain. -
#hex Working with Time in Elixir using 'timewrap'
Dealing with time in software development can be tricky. The
timewraphex package for Elixir provides a convenient way to work with time-related operations, especially in testing.timewrapacts as a “Time-Wrapper” that allows you to access different time sources in Elixir and Erlang. One of its most powerful features is the ability to freeze and unfreeze timers. This is incredibly useful for writing deterministic tests for time-dependent code.Instead of relying on the system clock, you can use
timewrapto control the flow of time in your tests, making them more reliable and easier to reason about.