Skip to content

Instantly share code, notes, and snippets.

View mdsohelmia's full-sized avatar
🎯
Focusing

Sohel mdsohelmia

🎯
Focusing
View GitHub Profile
@mdsohelmia
mdsohelmia / ASuccessfulGitBranchingModel.md
Created November 8, 2024 19:21 — forked from miere/ASuccessfulGitBranchingModel.md
A successful Git branching model

A successful Git branching model

A straightforward version from Vincent Driessen article.

Creating a feature branch

Create a copy branch from develop.

$ git checkout -b feature-1 develop

Merge with develop after code your feature.

@mdsohelmia
mdsohelmia / DOBPicker.tsx
Created September 22, 2024 15:39 — forked from tanishqsh/DOBPicker.tsx
DOB Calendar
/**
/DOBPicker.tsx
**/
'use client';
import * as React from 'react';
import { format, subYears } from 'date-fns';
import { cn } from '@/lib/utils';
import { Button } from '@/components/ui/button';
@mdsohelmia
mdsohelmia / Video-Engineering-Tricks.md
Created July 13, 2024 17:44 — forked from acceptableEngineering/Video-Engineering-Tricks.md
Video Engineering (Command Line) Tricks

Description

These are commands I use on a regular basis. For the sake of simplicity, the filenames I use in the examples below are in.mp4 and out.mp4, though you can use your imagination to picture blah.mov or audio.wav on a case-by-case basis.


FFmpeg

Media Conversion

@mdsohelmia
mdsohelmia / nginx.conf
Created February 18, 2024 06:51 — forked from dnntung/nginx.conf
nginx rtmp config with ffmpeg/external encoders
## ====================================================================================================== ##
## Visit this page for a list of all variables: https://github.com/arut/nginx-rtmp-module/wiki/Directives ##
## Visit this site for many more configuration examples: https://github.com/arut/nginx-rtmp-module ##
## This example file was put together by Andre "ustoopia" for usage on https://youtube.com/ustoopia ##
## ====================================================================================================== ##
user www-data; # Only used on linux. Nginx will run under this username.
worker_processes 1; # Set this to how many processors/cores CPU has. Relates to "worker_connections"
pid /run/nginx.pid; # Sets the location of the process id file (used on linux only).
include /etc/nginx/modules-enabled/*.conf; # Include all the optional configuration files stored here.
events {
@mdsohelmia
mdsohelmia / install_openresty.sh
Created January 8, 2024 13:34 — forked from k8scat/install_openresty.sh
Install OpenResty on Ubuntu from source code.
#!/bin/bash
set -e
rm -rf openresty-1.19.3.2 openresty-1.19.3.2.tar.gz
apt-get update -y
apt-get install -y libpcre3-dev \
libssl-dev \
perl \
make \
build-essential \
@mdsohelmia
mdsohelmia / nginx-tuning.md
Created October 16, 2023 15:56 — 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.

var mediaJSON = { "categories" : [ { "name" : "Movies",
"videos" : [
{ "description" : "Big Buck Bunny tells the story of a giant rabbit with a heart bigger than himself. When one sunny day three rodents rudely harass him, something snaps... and the rabbit ain't no bunny anymore! In the typical cartoon tradition he prepares the nasty rodents a comical revenge.\n\nLicensed under the Creative Commons Attribution license\nhttp://www.bigbuckbunny.org",
"sources" : [ "http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4" ],
"subtitle" : "By Blender Foundation",
"thumb" : "images/BigBuckBunny.jpg",
"title" : "Big Buck Bunny"
},
{ "description" : "The first Blender Open Movie from 2006",
"sources" : [ "http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/ElephantsDream.mp4" ],
@mdsohelmia
mdsohelmia / install_setup_tidb.sh
Created December 26, 2022 06:56 — forked from jniltinho/install_setup_tidb.sh
Install and Setup TiDB on Linux
#!/bin/bash
## Install and Setup TiDB on Linux
## https://github.com/pingcap/tidb
## https://github.com/pingcap/docs/blob/master/sql/privilege.md
## https://pingcap.com/blog/2016-10-17-how-we-build-tidb/
useradd tidb -d /var/lib/tidb -m
usermod -a -G tidb tidb
cd /var/lib/tidb
@mdsohelmia
mdsohelmia / client.go
Created December 15, 2022 13:22 — forked from amlwwalker/client.go
Golang Multipart upload to S3 over HTTP using tusd
package main
import (
"bytes"
"errors"
"fmt"
"io"
"log"
"mime/multipart"
"net/http"
@mdsohelmia
mdsohelmia / nextjs-deploy.md
Created October 23, 2022 07:54 — forked from jjcodes78/nextjs-deploy.md
Deploying NEXTJS site with nginx + pm2

How to setup next.js app on nginx with letsencrypt

next.js, nginx, reverse-proxy, ssl

1. Install nginx and letsencrypt

$ sudo apt-get update
$ sudo apt-get install nginx letsencrypt

Also enable nginx in ufw