Sunday, November 15, 2009

Bulk renaming of file extensions

#!/usr/bin/perl

# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2
# as published by the Free Software Foundation.
#

# Thanks Monica for making this code :)

# This program is used for changing file extensions on files
# eg.
# perl mvfiles.pl /home/username/filelist.txt
# NB file list cannot have \ (backslash) character in them.

# If you want log file of transformation send to log file
# perl mvfiles.pl /home/username/filelist.txt > conversion.log

# syntax of filelist.txt
# multiple lines similar to below
# "/home/username/filename1-you-want-to-change.mp2"
# "/home/username/filename2-you-want-to-change.mp2"
# "/home/username/filename3-you-want-to-change.mp2"

$csvfilename = "$ARGV[0]";


open(HANDLE, $csvfilename) || die ("Couldn't open that file");

@raw_data=;

close (HANDLE);

#read each line
foreach $line (@raw_data)
{
chomp ($line);
$line=~ s/"//g;
$oldfile=$line;


# old extension / new extension
$line=~ s/mp2/mp3/;


# prints new file name to screen
print "$line\n";

system(mv,$oldfile,$line);

}

Friday, November 13, 2009

This is the original /etc/rd.conf

[Identity]
Password=*******
AudioOwner=ownername
AudioGroup=users

[Tuning]
UseRealtime=No
RealtimePriority=9

[Format]
SampleRate=44100
Channels=2

[mySQL]
Hostname=localhost
Loginname=owner
Password=********
Database=Rivendell
Driver=QMYSQL3

; [SoftKeys]
;
; This section can be used to program the RDSoftKeys applet, or you
; can use the --map-file= switch to configure multiple soft
; key setups on the same host.
;
; Columns=10
;
; Command1=hithlum.srlabs.loc:GO 3 1 1 0!
; Legend1=Telos 1 ON
; Color1=red
;
; Command2=hithlum.srlabs.loc:GO 3 2 1 0!
; Legend2=Telos 2 ON
; Color2=red
;

[Hacks]
; If you are getting no output level meter indications with an older
; ASI card (such as the ASI4215, ASI4113 or ASI4111), tru uncommenting
; the following line:
# UseStreamMeters=Yes

;
; Log Generation
;
; These are mainly useful for debugging!
;
[RDAirPlay]
Logfile=/home/username/rd/rdairplay.log
;
[RDCatchd]
Logfile=/home/username/rd/rdcatchd.log
;
[Ripcd]
Logfile=/home/username/rd/ripcd.log
;
[Caed]
Logfile=/home/username/rd/caed.log
EnableMixerLogging=No

#[Cae]
#AudioRoot=/var/snd
#AudioExtension=wav
#AllowNonstandardRates=Yes


;
; JACK Session Management
;
; See the 'JACK.txt' file for details on how this works!
;
; [JackSession]
; Source1=rivendell_1:playout_0L
; Destination1=alsa_pcm:playback_1
;
; Source2=rivendell_1:playout_0R
; Destination2=alsa_pcm:playback_2
;
; Source3=rivendell_1:playout_1L
; Destination3=alsa_pcm:playback_3
;
; Source4=rivendell_1:playout_1R
; Destination4=alsa_pcm:playback_4
;
; Source5=rivendell_1:playout_2L
; Destination5=alsa_pcm:playback_9
;
; Source6=rivendell_1:playout_2R
; Destination6=alsa_pcm:playback_10
;
; Source7=alsa_pcm:capture_1
; Destination7=rivendell_1:record_0L
;
; Source8=alsa_pcm:capture_2
; Destination8=rivendell_1:record_0R
;
; Source9=alsa_pcm:capture_3
; Destination9=rivendell_1:record_1L
;
; Source10=alsa_pcm:capture_4
; Destination10=rivendell_1:record_1R
;
; Source11=alsa_pcm:capture_9
; Destination11=rivendell_1:record_2L
;
; Source12=alsa_pcm:capture_10
; Destination12=rivendell_1:record_2R