Skip to content

Instantly share code, notes, and snippets.

@csiknor
csiknor / piggify.py
Last active February 21, 2016 13:31
This python script reads user input and piggifies it after validation. Created for a Python assignment on Codecademy.
def read():
word = raw_input("Gimme your word:")
if len(word) == 0:
print "You must say something"
return read()
elif not word.isalpha():
print "It's not a word, honey! (No spaces, numbers allowed...)"
return read()
else:
return word
@csiknor
csiknor / convert_dlna_ready_mkv
Last active October 4, 2015 18:42
Copies the video streams and the Hungarian DTS or AC3 audio streams to a new file using ffmpeg. The DLNA client of my WebOS LG TV doesn't support audio stream switching and picks audio streams randomly which isn't fun.
# Usage: find Harry.Potter.* -name *.mkv -exec convert_dlna_ready_mkv {} ";"
echo "Processing file: $1"
FFMPEG_INFO_FILE='ffmpeg-info'
OUTPUT_FILE=`echo "$1" | sed 's/\(.*\)\.mkv$/\1-lo.mkv/'`
ffmpeg -i "$1" 2>$FFMPEG_INFO_FILE