Skip to content

Instantly share code, notes, and snippets.

View rochi88's full-sized avatar
:octocat:

Raisul Islam rochi88

:octocat:
View GitHub Profile
@rochi88
rochi88 / postgres-production-setup.sh
Created October 15, 2025 16:14 — forked from rameerez/postgres-production-setup.sh
PostgreSQL Production Server Setup - Set up a new Ubuntu Server 24.04 LTS machine to run a production Postgres server
#!/bin/bash
# This script takes a clean Ubuntu Server 24.04 LTS image and installs and configures
# everything needed to deploy a production-ready PostgreSQL server.
set -euo pipefail
# --- AESTHETICS ---
GREEN='\033[0;32m'

Github Emojis

A List of GitHub Flavoured Markdown Emoji Markup

A full list can be found here: https://api.github.com/emojis

Contributing

If an emoji is missing from this gist, please comment in the following format to let me know, and I will add it.

Increasing the amount of inotify watchers

If you are not interested in the technical details and only want to get Listen to work:

  • If you are running Debian, RedHat, or another similar Linux distribution, run the following in a terminal:
echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p
@rochi88
rochi88 / partitioning_functions.sql
Created December 4, 2024 02:00 — forked from habibutsu/partitioning_functions.sql
Postgresql / Sharding & Partitioning
create or replace
function partition_insert_trigger() returns trigger
language 'plpgsql' as $$
declare
column_name text := TG_ARGV[0];
columnt_format text := TG_ARGV[1];
column_value timestamp;
table_name text;
insert_stmt_tpl text := 'insert into %I select ($1).*';
insert_stmt text;
@rochi88
rochi88 / PostgreSQL-EXTENSIONs.md
Created December 4, 2024 01:59 — forked from joelonsql/PostgreSQL-EXTENSIONs.md
1000+ PostgreSQL EXTENSIONs

🗺🐘 1000+ PostgreSQL EXTENSIONs

This is a list of URLs to PostgreSQL EXTENSION repos, listed in alphabetical order of parent repo, with active forks listed under each parent.

⭐️ >= 10 stars
⭐️⭐️ >= 100 stars
⭐️⭐️⭐️ >= 1000 stars
Numbers of stars might not be up-to-date.

@rochi88
rochi88 / min-linux.md
Created October 28, 2024 12:33 — forked from bluedragon1221/min-linux.md
Create a minimal linux from scratch with initramfs and busybox.

https://www.youtube.com/watch?v=QlzoegSuIzg

The Three Parts

To build a minimal linux distro, we need three parts:

  1. The Kernel
  2. Userspace (busybox)
  3. Bootloader (syslinux)

When the system boots, it loads the kernel, which loads busybox.

@rochi88
rochi88 / nginx_build.sh
Created October 14, 2024 18:01 — forked from boniface/nginx_build.sh
Build Custom Nginx 1.16.0 From Source on Ubuntu 18.04 LTS
./configure --prefix=/etc/nginx \
--sbin-path=/usr/sbin/nginx \
--modules-path=/usr/lib/nginx/modules \
--conf-path=/etc/nginx/nginx.conf \
--conf-path=/etc/nginx/nginx.conf \
--error-log-path=/var/log/nginx/error.log \
--pid-path=/var/run/nginx.pid \
--lock-path=/var/run/nginx.lock \
--user=nginx --group=nginx \
@rochi88
rochi88 / nginx-tuning.md
Created October 14, 2024 17:21 — forked from denji/nginx-tuning.md
NGINX tuning for best performance

Moved to git repository: https://github.com/denji/nginx-tuning

NGINX Tuning For Best Performance

For this configuration you can use web server you like, i decided, because i work mostly with it to use nginx.

Generally, properly configured nginx can handle up to 400K to 500K requests per second (clustered), most what i saw is 50K to 80K (non-clustered) requests per second and 30% CPU load, course, this was 2 x Intel Xeon with HyperThreading enabled, but it can work without problem on slower machines.

You must understand that this config is used in testing environment and not in production so you will need to find a way to implement most of those features best possible for your servers.

@rochi88
rochi88 / MirpurDOHS-Dhaka.geojson
Created July 28, 2020 16:08 — forked from EmranAhmed/MirpurDOHS-Dhaka.geojson
Bangladesh City, Area GeoJSON data like: Dhaka, Chittagong, Cox-Bazar, Area: Mirpur, Uttara Example: http://jsfiddle.net/jusnotor/
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.