Skip to content

Instantly share code, notes, and snippets.

View Jarmos-san's full-sized avatar
👉
Helping Entrepreneurs with Their Technical Business Endeavours

Somraj Saha Jarmos-san

👉
Helping Entrepreneurs with Their Technical Business Endeavours
View GitHub Profile
@Jarmos-san
Jarmos-san / install-postgresql-using-cloudinit.md
Last active March 4, 2024 12:19
Install PostgreSQL using `cloud-init`

How to Install PostgreSQL Using cloud-init

cloud-init allows customising and configuring deployed server instances on most popular cloud service providers easily without requiring the use of other related tools like Ansible. Since cloud-init is such a reliable tool, this brief write-up will document the exact steps and procedures to install and setup PostgreSQL on a Debian 12 (Bookworm) server instance.

Get the Key ID From the Public Key

wget -qO- https://www.postgresql.org/media/keys/ACCC4CF8.asc \
  | gpg --with-fingerprint --with-colons \
  | awk -F: '/^fpr/ { print $10 }'
@Jarmos-san
Jarmos-san / Dockerfile
Last active April 15, 2024 02:21
An example multi-stage Dockerfile for use Python's poetry package manager
# Set the working directory globally
ARG SOURCEDIR="app"
# Pin the Python version to use
# See the following article to learn more about choosing the right base image
# https://pythonspeed.com/articles/base-image-python-docker-images
ARG PYTHONVERSION="3.11-slim-bookworm"
# Createh the base image for generating the requirements file
FROM python:${PYTHONVERSION} AS builder
@Jarmos-san
Jarmos-san / main.py
Last active June 10, 2024 14:32
A simple FastAPI project with a health check route
"""Entrypoint to invoke the FastAPI application service with."""
from fastapi import FastAPI, status
from pydantic import BaseModel
import uvicorn
app = FastAPI()
class HealthCheck(BaseModel):