Skip to content

Instantly share code, notes, and snippets.

View OkoyaUsman's full-sized avatar
🏠
Available for freelance job

Okoya Usman OkoyaUsman

🏠
Available for freelance job
View GitHub Profile
@OkoyaUsman
OkoyaUsman / links-extract.php
Created March 18, 2018 08:37
How to extract all links of any web page using PHP
@OkoyaUsman
OkoyaUsman / .htaccess
Created August 9, 2018 12:48 — forked from voku/gist:d958041e7b1c19356e721de1eda1e6f8
.htaccess with many options + description
# Apache Server Configs v2.14 | MIT License
# https://github.com/h5bp/server-configs-apache
# (!) Using `.htaccess` files slows down Apache, therefore, if you have
# access to the main server configuration file (which is usually called
# `httpd.conf`), you should add this logic there.
#
# https://httpd.apache.org/docs/current/howto/htaccess.html.
# ----------------------------------------------------------------------
@OkoyaUsman
OkoyaUsman / ffmpeg-restream.txt
Last active May 23, 2021 14:27
Perfect FFMPEG Command For Stable Live Streaming
ffmpeg -re -i "http://example.com/live/username/password/1234.m3u8" -bsf:a aac_adtstoasc -r 30 -b:v 2048k -bufsize 2048k -maxrate 4296k -vf scale="1280:720" -vcodec libx264 -preset ultrafast -c:a copy -f flv "rtmp://freertmpserver.com/servername/keyname"
@OkoyaUsman
OkoyaUsman / Office_kms
Created July 4, 2019 05:36 — forked from CHEF-KOCH/KMS_office.cmd
KMS server Windows
cd\Program Files\Microsoft Office\Office16
cd\Program Files (x86)\Microsoft Office\Office16
cscript OSPP.VBS /sethst:kms.digiboy.ir
cscript OSPP.VBS /actcscript OSPP.VBS /dstatus
slmgr.vbs /ckms
@OkoyaUsman
OkoyaUsman / url2img.js
Created April 21, 2020 20:57
Simple, lightweight jQuery Program to get website screenshots using Google Page Insights API
//Import jQuery
var url = "https://nodetent.com/";
$.ajax({
url: 'https://www.googleapis.com/pagespeedonline/v1/runPagespeed?url=' + url + '&screenshot=true',
context: this,
type: 'GET',
dataType: 'json',
timeout: 60000,
success: function(result) {
@OkoyaUsman
OkoyaUsman / page-obfuscator.php
Created April 21, 2020 21:26
PHP code to obfuscate an HTML page on the browser to encode source code.
<?php
function randomString($length = 3) {
$randomString = '';
$characters = implode("", array_merge(range('a', 'z'), range('A', 'Z')));
for ($i = 0; $i < $length; $i++) $randomString .= $characters[mt_rand(0, strlen($characters) - 1)];
return $randomString;
}
function encode($output) {
$randomFunc = randomString();
$randomOut = randomString();
@OkoyaUsman
OkoyaUsman / .htaccess
Created May 3, 2020 12:29
HTACCESS script to rewrite base URL like WordPress permalink.
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-l
RewriteRule ^(.+)$ index.php?id=$1 [QSA,L]
Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Ubuntu Chromium/37.0.2062.94 Chrome/37.0.2062.94 Safari/537.36
Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.85 Safari/537.36
Mozilla/5.0 (Windows NT 6.1; WOW64; Trident/7.0; rv:11.0) like Gecko
Mozilla/5.0 (Windows NT 6.1; WOW64; rv:40.0) Gecko/20100101 Firefox/40.0
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_5) AppleWebKit/600.8.9 (KHTML, like Gecko) Version/8.0.8 Safari/600.8.9
Mozilla/5.0 (iPad; CPU OS 8_4_1 like Mac OS X) AppleWebKit/600.1.4 (KHTML, like Gecko) Version/8.0 Mobile/12H321 Safari/600.1.4
Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.85 Safari/537.36
Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.85 Safari/537.36
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2311.135 Safari/537.36 Edge/12.10240
Mozilla/5.0 (Windows NT 6.3; WOW64; rv:40.0)
@OkoyaUsman
OkoyaUsman / aoa.html
Created October 4, 2021 09:01
Ads over video player for iframe and hls players
<html>
<head>
<title>Ads Over Content</title>
<style>
.aoa_wrap{position:relative;z-index:999;max-width:100%;max-height:100%;overflow:hidden;margin:10px}
.aoa_overlay{display:block;width:100%;height:100%;position:absolute;top:0;left:0;background:rgba(0,0,0,.8);z-index:9999;color:#fff;overflow:hidden}
.aoa_content{display:inline-block;width:100%;text-align:center;vertical-align:middle;overflow:hidden;position:relative;top:50%;-ms-transform:translateY(-50%);-webkit-transform:translateY(-50%);transform:translateY(-50%)}
.aoa_close_btn{cursor:pointer;display:block;height:16px;width:16px;position:absolute;top:50%;right:50%;background:red;color:#fff;line-height:16px;font-size:12px;text-decoration:none !important;text-align:center;font-weight:700;-webkit-border-radius:50px;-moz-border-radius:50px;-o-border-radius:50px;border-radius:50px}
</style>
<script>
@OkoyaUsman
OkoyaUsman / streamvideo.php
Created September 29, 2022 21:49
Stream/Download video files from remote location to users without memory overload
<?php
$url = "";
$useragent = "";
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_VERBOSE, true);
curl_setopt($ch, CURLOPT_TIMEOUT, 222222);
curl_setopt($ch, CURLOPT_HEADER, false);
curl_setopt($ch, CURLOPT_NOBODY, false);