Skip to content

Instantly share code, notes, and snippets.

View Natgho's full-sized avatar
🐍
Dreaming

Sezer Bozkır Natgho

🐍
Dreaming
View GitHub Profile
@narate
narate / docker-compose.yml
Created November 22, 2022 09:23
Docker compose file for PostgreSQL with tuning config example
version: '3'
services:
db:
restart: always
image: postgres:14-alpine
shm_size: 256mb
healthcheck:
test: ['CMD', 'pg_isready', '-U', 'postgres']
volumes:
- ./postgres14:/var/lib/postgresql/data
@gilangvperdana
gilangvperdana / README.md
Last active April 1, 2025 16:39
Pritunl behind Nginx Reverse Proxy

Install Pritunl

sudo apt-get update
sudo apt-get -y upgrade

echo "deb http://repo.pritunl.com/stable/apt focal main" | sudo tee /etc/apt/sources.list.d/pritunl.list
echo "deb [ arch=amd64,arm64 ] https://repo.mongodb.org/apt/ubuntu focal/mongodb-org/4.4 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-4.4.list
curl -fsSL https://www.mongodb.org/static/pgp/server-4.4.asc | sudo apt-key add -
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com --recv 9DA31620334BD75D9DCB49F368818C72E52529D4
sudo apt update
kind: ServiceAccount
apiVersion: v1
metadata:
name: restart-deploy
namespace: testns
---
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
@ismailyenigul
ismailyenigul / timescaledb-timescaledb-postgresql-adaptor-docker-compose.yml
Last active October 10, 2024 17:27
docker compose for timescaledb and postgresql-adaptor
I choosed host path mapping for postgresql data directory in a separate OS disk to be able to resize partition later.
You can use docker standart volumes too.
# mkdir -p /data/timescaledb
# cat docker-compose.yml
version: '3'
services:
@KamalakannanRM
KamalakannanRM / sonarq.nginx.conf
Created November 29, 2019 13:57
SonarQube reverse proxy through Nginx with SSL
ssl_certificate /etc/nginx/ssl/sonar.domain.tld/cert.pem;
ssl_certificate_key /etc/nginx/ssl/sonar.domain.tld/privkey.pem;
upstream sonar {
server 127.0.0.1:9000 fail_timeout=0;
}
server {
listen 80;
server_name sonar.domain.tld;
@pythoneast
pythoneast / permissions.py
Created September 18, 2019 05:20
Group based permissions for Django Rest Framework
from django.contrib.auth.models import User, Group
from rest_framework import permissions
def is_in_group(user, group_name):
try:
return Group.objects.get(name=group_name).user_set.filter(id=user.id).exists()
except Group.DoesNotExist:
return False
class HasGroupPermission(permissions.BasePermission):
@bradtraversy
bradtraversy / docker_wordpress.md
Last active April 29, 2025 09:07
Docker Compose FIle For Wordpress, MySQL & phpmyadmin

Wordpress & Docker

This file will setup Wordpress, MySQL & PHPMyAdmin with a single command. Add the code below to a file called "docker-compose.yaml" and run the command

$ docker-compose up -d

# To Tear Down
$ docker-compose down --volumes
@gmolveau
gmolveau / how_to_reverseproxy_proxypass_nginx_letsencrypt.md
Last active April 30, 2025 03:12
How to use nginx as a reverse-proxy with letsencrypt

How to use nginx as a reverse-proxy with letsencrypt

Your infrastructure

generated via plantuml

Imgur

Requirements

Siyah ş’utz’e ш1уц1э
Beyaz fıjı фыжьы
Kırmızı ptlıjı плъыжьы
Kahverengi haptlı хьаплъы
Yeşil vıtzışo уцышъо
@prodeveloper
prodeveloper / deploying_simple_api.md
Last active May 21, 2023 06:21
Deploying your RESTful API to heroku

In this session, we are going to mimic a posts api that we worked on in a previous class. Typecode provides the free sample api.

APIs are what enable the backend, frontend and your mobile application to work together. We have also seen how to build basic REST api using Django Rest Framework

To get the post API to work we will need to work on four modules: