Skip to content

Instantly share code, notes, and snippets.

@corajr
Last active August 29, 2015 14:13
Show Gist options
  • Select an option

  • Save corajr/534d55c7cfea680e6ca3 to your computer and use it in GitHub Desktop.

Select an option

Save corajr/534d55c7cfea680e6ca3 to your computer and use it in GitHub Desktop.
Serve a movie file to the Raspberry Pi
put_on_tv() {
IP=$(ipconfig getifaddr en1)
PORT=$(($RANDOM%63000+2001))
FILENAME=$(basename "$*")
FILEEXT=${FILENAME##*.}
ln -s "$1" $TMPDIR/$PORT.$FILEEXT
(
cd $TMPDIR
python -m SimpleHTTPServer $PORT &
ssh -t livingroom_pi "omxplayer -o hdmi -r http://$IP:$PORT/$PORT.$FILEEXT"
)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment