Skip to content

Instantly share code, notes, and snippets.

@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
<!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" />
/*
* 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
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
@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
@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 / 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();
{
"dynamic_allocation_ad_tag": "https://ad.doubleclick.net/N4061/pfadx/com.ytpwatch.music/main_10481;sz=WIDTHxHEIGHT;kvid=pJk0p-98Xzc;kpu=WuTangClanVEVO;kpeid=1wNaX00osCIK4VjwboFqzA;kpid=10481;mpvid=AAT-TvWQhVcS1PHy;ssl=1;afv=1;afvbase=eJxdUl1zqyAQ_TX1zQ4qGnnwIe0kzWdrPm7r7QuDSKMJAlHUmF9_ienc6b0MM-zZsyy7Z8l5xIRFZVUxTrSsIgcC33cgCkeBF1iiKTHJ6sixco2LLPJCJwiga_U6Y21BmSFKcjEhOGsqogspIifwAbDaImMSU1VGARiWRXMiBOPRuhDPqoQhuIzAntXaeXCfyFeLC1HripHSwHdW6YISjr1_gP8T-cj9CR3ggf8S4aY2nl5jcSvkm2xqVuGu0UQcKCeiZa38yRQZdrpXkgAg6-f5Er4fu1ROz9fxPVOpTF94PN7b-_Zjk7_TnRPP-jtHb3cBDJ2_jxI1mHel8N2vapyxL9JwPUDGDdSk4IocmGVk1L1i0SCepbHq24hdKG8yZuWy1hEl9u20VZPaEAIYINc07nujEUBWU_Eo11o9eKbaqdld1z32stFNyh6pNMJOh8TmVIsTUDYKkyu1uGRmsAiasRmBn5EZMAA3A_rAGzyeGRYcDIR88B3jDhQIfRgOwY7nI-uWyfwNrHQ0jlNv6iIIL9fV1vdtsFjGq81-1feLo70ZP-22-9ni6cTiWTsWo_OSpp-nbo7pJYR1ctq8aWbPwyPmu0lSn9xDj9e5i85X1K_d7W8RS3zWQfdLvIhRJus38JK9cZ1O4mLS592JTWKnpJ-vH-kqOyTzaZFMqj6-_gFCwvVc;dc_backfill=1;dc_yt=1;k5=3_35_592_1030;kclt=1;kga=-1;kgg=-1;klg=en;kmsrd=1;ko=p;kr=F;ktype=so
@samelie
samelie / jsfindings
Created October 6, 2015 19:03
Wierd JS findings
********************
BACKBONE
********************
If you want to download a zip for example, consider attaching the url as a form action and using submit,
to avoid router.
<form class="" method="GET" action="{{url}}"><input value="{{download}}" type="submit"></form>
encode blur timeline , 0->10sec
ffmpeg -i vid2.mp4 -vf "boxblur=20:enable='between(t,0,10)'" -y testtest.mp4
//complete
ffmpeg -i vid2.mp4 -vf "boxblur=20:enable='between(t,0,10)'" -y -c:v libx264 -c:a libfdk_aac -movflags +faststart -pix_fmt yuv420p -keyint_min 6 -profile:v high -level 4.2 -maxrate 3000k testtest.mp4