Skip to content

Instantly share code, notes, and snippets.

View matthiassturm's full-sized avatar

Matthias Sturm matthiassturm

View GitHub Profile
@matthiassturm
matthiassturm / cropToPal.bash
Created May 9, 2014 09:05
Crop all 16:9 MP4 videos in folder to PAL 4:3
#!/bin/bash
for f in *.mp4; do
mv "$f" "$f".old;
avconv -i "$f".old -vf crop=490:576:115:0 -vcodec libx264 "$f";
done
@matthiassturm
matthiassturm / .nanorc
Last active December 19, 2015 00:09
My .nanorc
#set autoindent
set brackets ""')>]}"
set matchbrackets "(<[{)>]}"
set nonewlines
set nowrap
set smooth
set tabsize 4
include /usr/share/nano/css.nanorc
include /usr/share/nano/html.nanorc
@matthiassturm
matthiassturm / generatePassword.js
Last active December 15, 2015 23:59
Password generator
var generatePassword=function(len, pool){
len=(typeof(len)!='undefined'?len:32);
pool=(typeof(pool)!='undefined'?pool:'abcdefghijklnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789.-_');
for (var i=0, n=pool.length, pw=''; i<len; ++i){
pw+=pool.charAt(Math.floor(Math.random()*n));
}
return pw;
}