PASTEBIN
| #1 paste tool since 2002
create new paste
tools
api
archive
real-time
faq
PASTEBIN
create new paste
trending pastes
sign up
login
my settings
my profile
Public Pastes
CodeQuartett
1 sec ago
Download Dr. Seuss...
MySQL | 9 sec ago
Watch Arizona vs U...
31 sec ago
Untitled
9 sec ago
Premium Accounts 2...
1 min ago
Tablet(iPad/Androi...
28 sec ago
data
SQL | 45 sec ago
Command Binding no...
34 sec ago
New Paste
#!/bin/bash # # a simple script to watch tv with the ability to play/pause using mplayer # can be run as a script or put in /usr/bin and run as an application # if in /usr/bin be sure to chmod 755 what ever you name this so that it will be executable # # written by Jim Cook # azerthoth@gmail.com # # Script Version 2 added file rename, cleaned things up for those not using xdialog # broke mencoder command apart for easier reading and added deinterlacing # # first we flush to make sure we wont be catching the wrong resources killall mplayer > /dev/null 2>&1 killall mencoder > /dev/null 2>&1 # set the location to save the file to. This MUST be set even if you have no intention of keeping any of the programming you watch location=/mnt/tvstor # set filename filename=$(date +%H:%M:%S@%d-%h-%Y) # start mencoder # tv card on composite input and ntsc, mpeg format and mp3 audio # some of these settings may need to be changed to match your system or your personal preferences ((mencoder tv:// -tv driver=v4l2:input=1:norm=0:device=/dev/video0:adevice=/dev/dsp:forceaudio \ -ovc lavc -lavcopts vcodec=mpeg4:vbitrate=1200 -vf pp=ci,scale=640:480 \ -oac mp3lame \ -o $location/$filename.avi -v &) &) # give mencoder time to start before starting mplayer. too short a time will trigger the kill due to mplayer not finding a file to play sleep 5 # start watching the TV show ((mplayer $location/$filename.avi &) &) # give mplayer a moment to start before watching for its pid sleep 1 # watch for mplayer close and then close mencoder while [ "$(pidof mplayer)" ] do sleep 1 done killall mencoder # pause to let mencoder shut down, not needed if using xdialog sleep 1 # graphical save/rename or delete file. # change DIALOG=Xdialog to DIALOG=dialog if you want the box in the terminal session. Only if script is started via a terminal. # we put clear here to get rid of random text from terminal, not needed if running xdialog clear DIALOG=${DIALOG=Xdialog} $DIALOG --title "Save TV Show" --clear \ --yesno "Do you wish to keep the file ?" 8 60 case $? in 0) tempfile=`tempfile` $DIALOG --title "Rename Video File" --clear \ --inputbox "Rename $filename.avi\n Adding .avi is not needed" 10 55 2> $tempfile retval=$? rename=`cat $tempfile` if [ -n "$rename" ]; then rename=$rename else rename=$filename fi mv $location/$filename.avi $location/$rename.avi;; 1) rm $location/$filename.avi;; esac # clear terminal if no using xdialog clear
Optional Paste Settings
Syntax Highlighting:
None
Bash
C
C#
C++
CSS
HTML
HTML 5
Java
JavaScript
Lua
None
Perl
PHP
Python
Rails
-------------
4CS
6502 ACME Cross Assembler
6502 Kick Assembler
6502 TASM/64TASS
ABAP
ActionScript
ActionScript 3
Ada
ALGOL 68
Apache Log
AppleScript
APT Sources
ASM (NASM)
ASP
autoconf
Autohotkey
AutoIt
Avisynth
Awk
BASCOM AVR
Bash
Basic4GL
BibTeX
Blitz Basic
BNF
BOO
BrainFuck
C
C for Macs
C Intermediate Language
C#
C++
C++ (with QT extensions)
C: Loadrunner
CAD DCL
CAD Lisp
CFDG
ChaiScript
Clojure
Clone C
Clone C++
CMake
COBOL
CoffeeScript
ColdFusion
CSS
Cuesheet
D
DCS
Delphi
Delphi Prism (Oxygene)
Diff
DIV
DOS
DOT
E
ECMAScript
Eiffel
Email
EPC
Erlang
F#
Falcon
FO Language
Formula One
Fortran
FreeBasic
FreeSWITCH
GAMBAS
Game Maker
GDB
Genero
Genie
GetText
Go
Groovy
GwBasic
Haskell
HicEst
HQ9 Plus
HTML
HTML 5
Icon
IDL
INI file
Inno Script
INTERCAL
IO
J
Java
Java 5
JavaScript
jQuery
KiXtart
Latex
Liberty BASIC
Linden Scripting
Lisp
LLVM
Loco Basic
Logtalk
LOL Code
Lotus Formulas
Lotus Script
LScript
Lua
M68000 Assembler
MagikSF
Make
MapBasic
MatLab
mIRC
MIX Assembler
Modula 2
Modula 3
Motorola 68000 HiSoft Dev
MPASM
MXML
MySQL
newLISP
None
NullSoft Installer
Oberon 2
Objeck Programming Langua
Objective C
OCalm Brief
OCaml
OpenBSD PACKET FILTER
OpenGL Shading
Openoffice BASIC
Oracle 11
Oracle 8
Oz
Pascal
PAWN
PCRE
Per
Perl
Perl 6
PHP
PHP Brief
Pic 16
Pike
Pixel Bender
PL/SQL
PostgreSQL
POV-Ray
Power Shell
PowerBuilder
ProFTPd
Progress
Prolog
Properties
ProvideX
PureBasic
PyCon
Python
q/kdb+
QBasic
R
Rails
REBOL
REG
Robots
RPM Spec
Ruby
Ruby Gnuplot
SAS
Scala
Scheme
Scilab
SdlBasic
Smalltalk
Smarty
SQL
SystemVerilog
T-SQL
TCL
Tera Term
thinBasic
TypoScript
Unicon
UnrealScript
Vala
VB.NET
VeriLog
VHDL
VIM
Visual Pro Log
VisualBasic
VisualFoxPro
WhiteSpace
WHOIS
Winbatch
XBasic
XML
Xorg Config
XPP
YAML
Z80 Assembler
ZXBasic
Paste Expiration:
Never
10 Minutes
1 Hour
1 Day
1 Month
Paste Exposure:
Public
Unlisted
Private (members only)
Paste Name / Title:
Hello
Guest
Sign Up
or
Login
You are currently not logged in, this means you can not edit or delete anything you paste.
Sign Up
or
Login