Skip to content

Instantly share code, notes, and snippets.

What would you like to do?

ffmpeg mkv to mp4

ffmpeg -i some.mkv -acodec copy -vcodec copy some.mp4 #copy mkv to mp4 container - may not be compliant
ffmpeg -t 30 -i some.mkv -acodec copy -vcodec copy some.mp4 #create sample
ffmpeg -i some.mkv -acodec libvo_aacenc -ac 2 -vcodec copy some.mp4 #mp4 with downmixed audio (AAC @ 128kbit)
ffmpeg -i "some.mkv" -acodec libvo_aacenc -vcodec h264 -ac 2 -vf scale=640:-1 some.mp4 #mp4 with downmixed audio (AAC @ 128kbit) & resized

todo: change to fdk/faac & needs quality tweaks

download from DHT

aria2c --bt-min-crypto-level=arc4 --bt-require-crypto=true --dht-listen-port=34450-34459 --listen-port=34460-34469 <magnet>


cat podcast.xml | xmlstarlet sel -t -m './/enclosure' -v '@url' -n #get podcast download urls


watch "tmux capture-pane && tmux show-buffer" #shows current tmux output in another window. If multiple sessions: use -t options


BROWSER="cat > $PWD/index.html" man --html echo && python -m SimpleHTTPServer #format a manpage as HTML and then start a webserver to display it (good for headless boxes)

actual clone for pywin32 source

hg clone
#incorrect URLs, sourceforge should feel bad

create package builder chroot for debian jessie

sudo pbuilder --create --mirror --distribution jessie --extrapackages git-core eatmydata nano git-buildpackage apt-file


create a grub directory to put on a thumbdrive from a running system (non-standalone)

not working todo: fix safemodules variable

safemodules=$(for x in /usr/lib/grub/x86_64-efi/*.mod; do basename -s .mod $x; done | grep -v ahci) #| tr '\n' ' ' > modules.list
grub2-mkimage -O x86_64-efi -p /efi/grub -o grub.efi $safemodules

real path for GRUB2 sources

bzr branch bzr://
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment