Skip to content

Instantly share code, notes, and snippets.

🏠
Working from home

Md. Sumon Islam sumonst21

🏠
Working from home
Block or report user

Report or block sumonst21

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@sumonst21
sumonst21 / Encryption.js
Created Oct 8, 2019 — forked from ve3/Encryption.js
Encrypt and decrypt between programming languages (PHP & JavaScript).
View Encryption.js
/**
* Encryption class for encrypt/decrypt that works between programming languages.
*
* @author Vee Winch.
* @link https://stackoverflow.com/questions/41222162/encrypt-in-php-openssl-and-decrypt-in-javascript-cryptojs Reference.
* @link https://github.com/brix/crypto-js/releases crypto-js.js can be download from here.
*/
class Encryption {
View verify-google-recaptcha-with-php
#
# Verify captcha
$post_data = http_build_query(
array(
'secret' => CAPTCHA_SECRET,
'response' => $_POST['g-recaptcha-response'],
'remoteip' => $_SERVER['REMOTE_ADDR']
)
);
$opts = array('http' =>
@sumonst21
sumonst21 / Aworker.js
Created Oct 2, 2019 — forked from judge2020/Aworker.js
Cloudflare Workers: block proxy IPs
View Aworker.js
// Using a global variable so we aren't
// pulling from the proxy API on each
// and every subsequent request
// (note that the Workers billing still applies here)
//
// This could be "truly global" with KV but
// it's not really needed here unless the proxy list
// starts blocking CF ips.
//
//
@sumonst21
sumonst21 / 0. nginx_setup.sh
Created Sep 28, 2019 — forked from mikhailov/0. nginx_setup.sh
Nginx + secure pseudo-streaming
View 0. nginx_setup.sh
# Nginx can serve FLV/MP4 files by pseudo-streaming way without any specific media-server software.
# To do the custom build we use 2 modules: --with-http_secure_link_module --with-http_flv_module
# This module "secure-link" helps you to protect links from stealing away.
#
# NOTE: see more details at coderwall: http://coderwall.com/p/3hksyg
cd /usr/src
wget http://nginx.org/download/nginx-1.5.13.tar.gz
tar xzvf ./nginx-1.5.13.tar.gz && rm -f ./nginx-1.5.13.tar.gz
@sumonst21
sumonst21 / nginx-vod-module-install-debian-stretch.sh
Created Sep 28, 2019 — forked from thomsh/nginx-vod-module-install-debian-stretch.sh
Rebuild nginx on Debian Stretch with Kaltura nginx-vod-module
View nginx-vod-module-install-debian-stretch.sh
#!/bin/bash
set -euxo pipefail
# Install latest Nginx from backports on Debian Stretch
# with nginx-vod-module from https://github.com/kaltura/nginx-vod-module
# This script/doc will rebuild the deb package
# Requirement : run on Debian Stretch with backports repository enabled
if ! egrep '^deb .+ stretch-backports' -- /etc/apt/sources.list /etc/apt/sources.list.d/*.list ; then
echo 'deb http://deb.debian.org/debian/ stretch-backports main contrib non-free' |tee /etc/apt/sources.list.d/bpo.list
fi
@sumonst21
sumonst21 / acf-first-row.php
Created Sep 23, 2019 — forked from neilgee/acf-first-row.php
ACF Repeater - Grab First/LAst or Random Single Data Row
View acf-first-row.php
<?php
//My ACF Fields for reference
//testimonials - field group
//testimonial - sub-field
//testimonial_header - sub-field
//First Repeater Row in Array
$rows = get_field( 'testimonials', 348 );// grab all rows from page ID
@sumonst21
sumonst21 / gist:e0f78a22f2cfcfaf8489809d820e46aa
Created Sep 3, 2019 — forked from jeoliva/gist:a3c4ef62b7f52926d0f339b395c0cd0c
Get Keyframe interval (GOP size) of a stream/video using ffprobe
View gist:e0f78a22f2cfcfaf8489809d820e46aa
ffprobe -of compact -select_streams v -show_packets [VIDEO_FILE OR STREAM_URL] | grep K$ | awk 'BEGIN{FS="|";last=-1}{split($5,a,"="); if(last != -1) {print "Keframe pos: " a[2] ", Interval: " a[2]-last " seconds"} else {print "Keyframe: " a[2]}; last=a[2]}'
@sumonst21
sumonst21 / iframe-probe.py
Created Sep 3, 2019 — forked from use-sparingly/iframe-probe.py
Shows GOP structure for video file using ffmpeg --show-frames output
View iframe-probe.py
#!/usr/bin/env python
#
# Shows GOP structure of video file. Useful for checking suitability for HLS and DASH packaging.
# Example:
#
# $ iframe-probe.py myvideo.mp4
# GOP: IPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPP 60 CLOSED
# GOP: IPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPP 60 CLOSED
# GOP: IPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPP 60 CLOSED
# GOP: IPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPP 60 CLOSED
@sumonst21
sumonst21 / cors-nginx.conf
Created Aug 28, 2019 — forked from alexjs/cors-nginx.conf
Slightly tighter CORS config for nginx
View cors-nginx.conf
#
# Slightly tighter CORS config for nginx
#
# A modification of https://gist.github.com/1064640/ to include a white-list of URLs
#
# Despite the W3C guidance suggesting that a list of origins can be passed as part of
# Access-Control-Allow-Origin headers, several browsers (well, at least Firefox)
# don't seem to play nicely with this.
#
@sumonst21
sumonst21 / nginx.conf
Created Aug 28, 2019 — forked from Stanback/nginx.conf
Example Nginx configuration for adding cross-origin resource sharing (CORS) support to reverse proxied APIs
View nginx.conf
#
# CORS header support
#
# One way to use this is by placing it into a file called "cors_support"
# under your Nginx configuration directory and placing the following
# statement inside your **location** block(s):
#
# include cors_support;
#
# As of Nginx 1.7.5, add_header supports an "always" parameter which
You can’t perform that action at this time.