Skip to content

Instantly share code, notes, and snippets.

Find me on!

Moe moeiscool

Find me on!
Block or report user

Report or block moeiscool

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
moeiscool / clientSideFileDownloadWithProgress-jQuery.js
Last active Sep 7, 2019
jQuery File Download with Progress
View clientSideFileDownloadWithProgress-jQuery.js
// Found at
var url = "REMOTE_URL"
xhr: function() {
var xhr = new window.XMLHttpRequest();
xhr.upload.addEventListener("progress", function(evt) {
if (evt.lengthComputable) {
var percentComplete = evt.loaded /;
//Do something with upload progress here
moeiscool /
Created Jul 18, 2019
Fix Docker version on Ubuntu so you can install nvidia-docker2
# Solution found here
DOCKER_CE_VERSION=`apt-cache show nvidia-docker2 | grep -Po "(?<=docker-ce \(= )([^)]*)" | head -n 1`
apt-get -yq install nvidia-docker2 docker-ce=${DOCKER_CE_VERSION}
moeiscool /
Created Jul 14, 2019
Extract Frames from website as PNG images with PhantomJS
  1. run npm install phantomjs-prebuilt inside the directory where these files are located (launch.js and webpageRecord.js).
  2. run node launch.js
  3. See frames folder for images.
moeiscool / nodeJs.crypto.calculatingHash.js
Last active Apr 4, 2019 — forked from GuillermoPena/nodeJs.crypto.calculatingHash.js
NodeJS - CRYPTO : How to calculate a hash from file or string
View nodeJs.crypto.calculatingHash.js
var crypto = require('crypto')
, fs = require('fs')
// Algorithm depends on availability of OpenSSL on platform
// Another algorithms: 'sha1', 'md5', 'sha256', 'sha512' ...
var algorithm = 'sha1'
, shasum = crypto.createHash(algorithm)
// Updating shasum with file content
var filename = __dirname + "/anything.txt"
View gist:589c4c235b85e349404cacd94d553c33
Originall From: Posted 2015-05-29
This is the complete list that’s outputted by ffmpeg when running ffmpeg -h full.
usage: ffmpeg [options] [[infile options] -i infile]… {[outfile options] outfile}…
Getting help:
-h — print basic options
-h long — print more options
-h full — print all options (including all format and codec specific options, very long)
moeiscool /
Created Mar 2, 2019 — forked from larshaendler/
Remove prefix from multiple files in Linux console


for file in prefix*; do mv "$file" "${file#prefix}"; done;

The for loop iterates over all files with the prefix. The do removes from all those files iterated over the prefix.

Here is an example to remove "bla_" form the following files:

moeiscool / tcpproxy.js
Created Feb 10, 2019 — forked from kfox/tcpproxy.js
A basic TCP proxy written in node.js
View tcpproxy.js
var net = require("net");
process.on("uncaughtException", function(error) {
if (process.argv.length != 5) {
console.log("usage: %s <localport> <remotehost> <remoteport>", process.argv[1]);
moeiscool /
Created Jan 25, 2019
Install Shinobi Video PPTP VPN Client on Ubuntu 18.04
sudo apt install ppp pptp-linux
echo "/etc/ppp/chap-secrets"
echo "VPN Server User"
read vpnuser
echo "VPN Server Password"
read vpnpass
chapsecret="$DOMAIN\\$vpnuser PPTP $vpnpass *"
if grep -q $chapsecret /etc/ppp/chap-secrets; then
echo "Already Set."
moeiscool /
Created Jan 25, 2019
Install PPPTP VPN Server on Ubuntu 18.04
echo "======================="
echo "Installing PPTP VPN Server..."
echo "======================="
apt install pptpd -y
echo "Setting VPN Server IP : localip"
if grep -q "localip" /etc/pptpd.conf; then
echo "Already set."
sed -i 's/localip/#localip/g' /etc/pptpd.conf
echo "localip" >> /etc/pptpd.conf
View gist:804ce760b62e85c2ec4b761a0c6b0f79
var mediaJSON = { "categories" : [ { "name" : "Movies",
"videos" : [
{ "description" : "Big Buck Bunny tells the story of a giant rabbit with a heart bigger than himself. When one sunny day three rodents rudely harass him, something snaps... and the rabbit ain't no bunny anymore! In the typical cartoon tradition he prepares the nasty rodents a comical revenge.\n\nLicensed under the Creative Commons Attribution license\n",
"sources" : [ "" ],
"subtitle" : "By Blender Foundation",
"thumb" : "images/BigBuckBunny.jpg",
"title" : "Big Buck Bunny"
{ "description" : "The first Blender Open Movie from 2006",
"sources" : [ "" ],
You can’t perform that action at this time.