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 / 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 Reference.
* @link crypto-js.js can be download from here.
class Encryption {
View verify-google-recaptcha-with-php
# Verify captcha
$post_data = http_build_query(
'secret' => CAPTCHA_SECRET,
'response' => $_POST['g-recaptcha-response'],
'remoteip' => $_SERVER['REMOTE_ADDR']
$opts = array('http' =>
View ffmpeg-create-thumbnail-image-from-a-video.php
// where ffmpeg is located
$ffmpeg = '/usr/bin/ffmpeg';
//video dir
$video = 'path/to/video';
//where to save the image
$image = 'path/to/image.jpg';
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 / 0.
Created Sep 28, 2019 — forked from mikhailov/0.
Nginx + secure pseudo-streaming
View 0.
# 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:
cd /usr/src
tar xzvf ./nginx-1.5.13.tar.gz && rm -f ./nginx-1.5.13.tar.gz
sumonst21 /
Created Sep 28, 2019 — forked from thomsh/
Rebuild nginx on Debian Stretch with Kaltura nginx-vod-module
set -euxo pipefail
# Install latest Nginx from backports on Debian Stretch
# with nginx-vod-module from
# 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 stretch-backports main contrib non-free' |tee /etc/apt/sources.list.d/bpo.list
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
//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 /
Created Sep 18, 2019
How to remove files modified between particular dates?

The command GNU find is the way to go. For example, to delete all files in the current directory between 1 and 5 august, you can use the following command

find . -maxdepth 1 -type f -newermt 2011-08-01 ! -newermt 2011-08-06 -delete

It is better to execute the command without the -delete action, first, to see the listing of interested files (a good substitute could be -ls that produce an ls-like listing).

Removing the -maxdepth 1 specification will traverse all subdirectories, too.

You can also specify hours, for example

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 /
Created Sep 3, 2019 — forked from use-sparingly/
Shows GOP structure for video file using ffmpeg --show-frames output
#!/usr/bin/env python
# Shows GOP structure of video file. Useful for checking suitability for HLS and DASH packaging.
# Example:
# $ myvideo.mp4
You can’t perform that action at this time.