Skip to content

Instantly share code, notes, and snippets.

@samelie
samelie / requestIndexRange
Created February 17, 2016 23:31
Youtube SIDX parsed from index range on dash video
//the index range will be eg: 0-917
// you can find the index range of a particular dash video insode the ytplayer.config
// https://github.com/fent/node-ytdl-core
function sidxFromInitRange(url, indexRange) {
return new Q(function(resolve, reject) {
var XMLHttpRequest = require('xhr2');
var xhr = new XMLHttpRequest();
xhr.open('GET', url);
xhr.setRequestHeader("Range", "bytes=" + indexRange);
xhr.send();
@samelie
samelie / colorkey-video-image
Created February 23, 2016 15:25
colorkey video and image
convert out.png -resize "640x475^" -gravity center -crop 640x475+0-70 l.jpg
ffmpeg -i out.gif -i l.jpg -filter_complex "[1:v]colorkey=0xff0000:0.5:0.5[ckout];[0:v][ckout]overlay[out]" -map "[out]" -y output.gif
0.5 is intensity
@samelie
samelie / ffmpeg segment
Created July 2, 2016 18:57
segment videos
ffmpeg -i the.man.who.fell.to.earth.1976.criterion.dvdrip.xvid.ac3.2ch-\[gx\].avi -c:a libfaac -c:v libx264 -reset_timestamps 1 -map 0 -map_metadata -1 -metadata title="rad" -segment_format mp4 -f segment -segment_time 8 rad-%05d.mp4
sox copywrite_audio.wav copy_loop.wav repeat 200
ffmpeg -i .avi -i copy_loop.wav -c:v copy -c:a aac -map 0:v:0 -map 1:a:0 -shortest -y copywrite.avi
/*
* Copyright 2016 Google Inc. All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="content-type" content="text/html; charset=iso-8859-1" />
@samelie
samelie / pine64 arm kubernetes
Last active July 15, 2018 21:12
SUCCESS: Notes on how to get kubernetes running pine64s
## RESOURCES
https://gist.github.com/alexellis/fdbc90de7691a1b9edb545c17da2d975
https://itnext.io/create-a-kubernetes-cluster-with-pine64-428fc62d72e7
Step 1: uninstall kubernetes, follow the below given commands
kubeadm reset
sudo apt-get purge kubeadm kubectl kubelet kubernetes-cni kube* -y &&
sudo apt-get autoremove -y &&
sudo rm -rf ~/.kube
// Paladin config file
/* Brief instructions:
* Notepad++ is HIGHLY recommended to use for editing these files. Visit http://notepad-plus-plus.org/
* To comment out something, put // in front of that line
* !!!Never comment out something you're not sure about, set it to false or disable as noted in description if you don't want to use it.
* true and false are case sensitive. Good: Config.SomeVar = true; Bad: Config.SomeVar = True;
*/
function LoadConfig() {
#!/bin/bash
sudo apt-get update
sudo apt-get upgrade -y
sudo apt -y remove ffmpeg x264 libav-tools libvpx-dev libx264-dev
sudo apt-get -y install libtool build-essential autoconf checkinstall git libgpac-dev libomxil-bellagio-dev libssl-dev libjack-jackd2-dev libmp3lame-dev libopencore-amrnb-dev libopencore-amrwb-dev librtmp-dev libsdl1.2-dev libtheora-dev libva-dev libvdpau-dev libvorbis-dev libx11-dev libxfixes-dev pkg-config texi2html yasm zlib1g-dev xvfb nasm gcc yasm libglfw3-dev git-core wicd-curses libffi-dev
# install ffmpeg
cd ~
@samelie
samelie / megatools_macos.md
Last active July 4, 2019 20:29
Use http://megatools.megous.com to download megafiles -- macOS

Brew

brew install megatools

Compile from source

This was needed because some support for encrytped folders was missing.