Skip to content

Instantly share code, notes, and snippets.

View moeiscool's full-sized avatar
💭
Find me on Gitlab.com!

Moe moeiscool

💭
Find me on Gitlab.com!
View GitHub Profile
@moeiscool
moeiscool / install-pptp-client-shinobi-video.sh
Created January 25, 2019 05:26
Install Shinobi Video PPTP VPN Client on Ubuntu 18.04
sudo apt install ppp pptp-linux
echo "/etc/ppp/chap-secrets"
DOMAIN="vpn.shinobi.video"
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
moeiscool / tcpproxy.js
Created February 10, 2019 00:59 — forked from kfox/tcpproxy.js
A basic TCP proxy written in node.js
var net = require("net");
process.on("uncaughtException", function(error) {
console.error(error);
});
if (process.argv.length != 5) {
console.log("usage: %s <localport> <remotehost> <remoteport>", process.argv[1]);
process.exit();
}
@moeiscool
moeiscool / multiple-files-remove-prefix.md
Created March 2, 2019 22:05
Remove prefix from multiple files in Linux console

Bash

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:

bla_1.txt
bla_2.txt
@moeiscool
moeiscool / gist:589c4c235b85e349404cacd94d553c33
Created March 21, 2019 01:46 — forked from tayvano/gist:6e2d456a9897f55025e25035478a3a50
complete list of ffmpeg flags / commands
Originall From: Posted 2015-05-29 http://ubwg.net/b/full-list-of-ffmpeg-flags-and-options
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
moeiscool / nodeJs.crypto.calculatingHash.js
Last active May 1, 2024 12:32 — forked from GuillermoPena/nodeJs.crypto.calculatingHash.js
NodeJS - CRYPTO : How to calculate a hash from file or string
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"
@moeiscool
moeiscool / README.md
Created July 14, 2019 17:05
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
moeiscool / fixDockerVersion.sh
Created July 18, 2019 03:36
Fix Docker version on Ubuntu so you can install nvidia-docker2
# Solution found here https://github.com/NVIDIA/nvidia-docker/issues/857#issuecomment-482379024
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
moeiscool / clientSideFileDownloadWithProgress-jQuery.js
Last active May 1, 2024 12:33
jQuery File Download with Progress
// Found at https://stackoverflow.com/questions/19126994/what-is-the-cleanest-way-to-get-the-progress-of-jquery-ajax-request
var url = "REMOTE_URL"
$.ajax({
xhr: function() {
var xhr = new window.XMLHttpRequest();
xhr.upload.addEventListener("progress", function(evt) {
if (evt.lengthComputable) {
var percentComplete = evt.loaded / evt.total;
//Do something with upload progress here
}
@moeiscool
moeiscool / blockFakeNewsOnYouTube.js
Last active May 1, 2024 12:33
Block/Delete Facebook Ads
//This works for MOST ads, not all of them. Anyone with updates please share.
//1. Install this plugin on Chrome : https://chrome.google.com/webstore/detail/custom-javascript-for-web/poakhlngfciodnhlhhgnaaelnpjljija?hl=en
//2. go to facebook.com and click the CJS icon in the top right.
//3. Copy and Paste this code into that window. Press Save.
//You don't need CJS, just some way to execute custom code. This should work on any browser capable of executing custom code on load.
// !!!!!!!!!!!!!!!! PASTE ONLY THE CONTENTS BELOW THIS LINE !!!!!!!!!!!!!!!!!!!!!
import 'dart:typed_data';
import 'package:flutter/material.dart';
import 'package:flutter_vlc_player/vlc_player.dart';
import 'package:flutter_vlc_player/vlc_player_controller.dart';
void main() => runApp(MyApp());
class MyApp extends StatefulWidget {
@override