Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
Next revision Both sides next revision
helper_scripts [2013/06/28 11:53]
beandog
helper_scripts [2013/06/28 12:11]
beandog
Line 3: Line 3:
 This is just a collection of little scripts. This is just a collection of little scripts.
  
 +=== avi2mpg ===
 +
 +<code bash>
 +#!/bin/bash
 +F=`basename $1 .avi`
 +MPG=${F}.mpg
 +if [[ ! -f ${MPG} ]]; then
 + mencoder $1 -o $MPG -profile dvd
 + fi
 +</​code>​
 +
 +=== close_trays ===
 +
 +<code bash>
 +#!/bin/bash
 +eject -t /dev/dvd
 +eject -t /dev/dvd1
 +</​code>​
 +
 +=== confcat ===
 +
 +Strip all empty strings and commented strings
 +
 +<​code>​
 +#!/bin/bash
 +grep -vh '​^#'​ "​$@"​ | grep -v '​^$'​
 +</​code>​
  
 === dumpchapters === === dumpchapters ===
Line 34: Line 61:
 #!/bin/sh #!/bin/sh
 mplayer dvd://${1} -dumpstream -dumpfile movie.vob mplayer dvd://${1} -dumpstream -dumpfile movie.vob
 +</​code>​
 +
 +=== dvd_id ===
 +
 +<code bash>
 +#!/bin/bash
 +EXIT_CODE=1
 +DEVICE=$1
 +if [[ -z $DEVICE ]]; then
 + DEVICE=/​dev/​dvd
 +fi
 +
 +if [[ ! -b $DEVICE ]]; then
 + echo "​Device $DEVICE doesn'​t exist" >&2
 + exit 1
 +fi
 +
 +while [[ $EXIT_CODE != 0 ]]; do
 + /​usr/​local/​bin/​disc_id $DEVICE 2> /dev/null
 + EXIT_CODE=$?​
 +
 + if [[ $EXIT_CODE != 0 ]]; then
 + sleep 1
 + fi
 +done
 </​code>​ </​code>​

Navigation