Monday, July 24, 2006

wavtomp3 converter

wavtomp3

Converts a wav file to mp3 at a bitrate of 96.

#!/bin/bash -
# wav2mp3

FILES=`ls *.wav`

for i in $FILES; do
OUT=`echo $i | sed -e 's/.wav//'`
lame -h -b 96 $i $OUT.mp3
done

Record audio from a webcast

cron entry:

# records something at 12:03, Monday through Friday
03 12 * * 1-5 streamrecorder
# kills recording at 1:01pm
01 13 * * 1-5 killall -9 mplayer

# records a show at 4:04,Monday through Friday
04 16 * * 1-5 streamrecorder2
# kills recording at 7:01 pm
01 19 * * 1-5 killall -9 mplayer


I am using mplayer to record an audio webcast so that I can listen to it later.

/usr/bin/streamrecorder


#!/bin/sh

mplayer -playlist /location/to/file.asx -ao pcm:file=/path/to/save/recording/Show_name_`date +%b%d_%H%M%P_%Y`.wav -vc dummy -vo null ;

Alarm Clock

/usr/bin/alarm

#!/bin/sh

# Uncomment if you want to use amaroK
#/usr/bin/dcop /usr/bin/amarok player play

#Uncomment if you do not want to use Mplayer
#/usr/bin/X11/xterm -display :0 -bg black -fg white #-e /usr/bin/mplayer -shuffle -playlist ~/.playlist

#/usr/bin/X11/xterm -display :0 -bg black -fg white #-e mplayer -playlist /location/to/file.asx

# Eterm solution#/usr/bin/Eterm -0 -e /usr/local/bin/mplayer # -shuffle -playlist ~/.playlist

# use xine to play
/usr/bin/X11/xterm -display :0 -bg black -fg white -e xine -f /file/to/video.wmv

# plays mp3s from playlist, no video
#mplayer -shuffle -playlist ~/.playlist


Create an entry in your crontab:
Min Hour Date Month Day of week Location to script
45 06 * * 1-5 /usr/local/bin/alarm

Introduction

Ok, I hate blogs and bloggers. But this one is different. You'll get no political opinions, no news slants and I'm not here to "break a news story". You people that do all the above can bite me. This blog is for me to track what I've done on my linux box. Mainly because I can't remember shit and I have bits and pieces of text files with commands and fixes spread out over several computers. I'm hoping that I can use this to keep track of what I've done so that when I break something and it's only a matter of time before I do, I'll be able to come here and hopefully find a fix.