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
/private
and everything inside it.1. Creating the Password File
First, we need to create a
.htpasswd
file that will store our username and password. The password needs to be encrypted. We can use thehtpasswd
command-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_source
hex package aims to simplify this by providing a unified interface for interacting with various data sources.While Elixir has excellent tools like
Ecto
for database access,data_source
can 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
timewrap
hex package for Elixir provides a convenient way to work with time-related operations, especially in testing.timewrap
acts 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
timewrap
to control the flow of time in your tests, making them more reliable and easier to reason about. -
Bucketier: A Simple Key/Value Store in Elixir
bucketier
is a simple key/value store for Elixir. It provides a straightforward way to store and retrieve data in named buckets.The main purpose of
bucketier
is to offer a simple and easy-to-use API for managing key/value data. You can create named buckets, put data into them, and get it back when you need it.It’s a great choice for situations where you need a simple in-memory storage solution without the overhead of a full-fledged database. It can be useful for caching, session management, or any other scenario where you need to store temporary data.
-
Review of the Remarkable Paper Pro
I’ve been using the Remarkable Paper Pro since 2021, and it has become an indispensable part of my daily routine. As someone who loves the feel of writing on paper but needs the convenience of digital notes, the Remarkable has been a game-changer.
The Writing Experience
The first thing that struck me about the Remarkable is how natural it feels to write on. The textured surface of the screen and the pressure-sensitive stylus create an experience that is remarkably close to writing on paper. There’s no lag, and the “ink” flows smoothly from the stylus. It’s a joy to use for everything from jotting down quick notes to long-form writing.
-
Why I'm All In to Elixir and Phoenix
I’ve been a software developer for a long time, and I’ve worked with many different languages and frameworks over the years. But for the past few years, I’ve found myself reaching for the same two tools for almost every project: Elixir and Phoenix.
In this post, I want to share some of the reasons why I’ve fallen in love with this powerful combination, and why I think it’s a great choice for modern web development.