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
View html5-video-streamer.js
/*
* Inspired by: http://stackoverflow.com/questions/4360060/video-streaming-with-html-5-via-node-js
*/
var http = require('http'),
fs = require('fs'),
util = require('util');
http.createServer(function (req, res) {
var path = 'video.mp4';
@sumonst21
sumonst21 / download_nrlist.py
Created Oct 22, 2019 — forked from AntonPetrov/download_nrlist.py
A sample python script for downloading the current non-redundant lists from the RNA 3D Hub
View download_nrlist.py
"""
A sample python script for downloading the current non-redundant lists from
the RNA 3D Hub (http://rna.bgsu.edu/rna3dhub).
Usage:
python download_nrlist.py
"""
@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' =>
View ffmpeg-create-thumbnail-image-from-a-video.php
<?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
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 / remove-files-modified-between-particular-dates.md
Created Sep 18, 2019
How to remove files modified between particular dates?
View remove-files-modified-between-particular-dates.md

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

You can’t perform that action at this time.