[[svn-to-darcs @ 176] dmorelli**20060228184407 Added new scripts ] addfile ./alldl addfile ./nassh addfile ./sdmusic hunk ./alldl 1 +#! /usr/bin/perl -w + +#-------------------------------------------------------------------------- +# $HeadURL: file:///var/lib/svn/scripts/alldl $ +#-------------------------------------------------------------------------- +# $Revision: 176 $ +# $Date: 2006-02-28 13:44:07 -0500 (Tue, 28 Feb 2006) $ +# $Author: dmorelli $ +# +# Download an entire album of music from allofmp3 by parsing the download +# HTML page containing them. +#-------------------------------------------------------------------------- + +use strict; + + +# Path to HTML document from allofmp3 with URLs +my $htmlPath = shift; +my %urlHash; + +# Extract the URLs from the file, there will be dupes, get rid of them +open HTML, "$htmlPath" or die "Can't open $htmlPath: $!\n"; +while () { + if (m|(http.*://.*\.ogg)|) { + $urlHash{$1}++; + } +} +close HTML; + +# Use wget to download the files from above +for (keys %urlHash) { + system qq[wget "$_"]; +} hunk ./nassh 1 +#! /bin/sh + +#-------------------------------------------------------------------------- +# $HeadURL: file:///var/lib/svn/scripts/nassh $ +#-------------------------------------------------------------------------- +# $Revision: 176 $ +# $Date: 2006-02-28 13:44:07 -0500 (Tue, 28 Feb 2006) $ +# $Author: dmorelli $ +# +# Connect to Network Appliance via ssh +#-------------------------------------------------------------------------- + + +COCONUT_IP=10.61.25.28 +NETAPP_GATEWAY_IP=198.95.225.6 + +echo "On the other side, coconut's IP is: $COCONUT_IP" +echo "Connecting to NetApp now..." + +ssh -l morelli -p 48558 -i .ssh/identity-na $NETAPP_GATEWAY_IP hunk ./sdmusic 1 +#! /bin/sh + +#-------------------------------------------------------------------------- +# $HeadURL: file:///var/lib/svn/scripts/sdmusic $ +#-------------------------------------------------------------------------- +# $Revision: 176 $ +# $Date: 2006-02-28 13:44:07 -0500 (Tue, 28 Feb 2006) $ +# $Author: dmorelli $ +# +# Replace all music on the SD card +#-------------------------------------------------------------------------- + + +mount /mnt/sd/ + +rm -fv /mnt/sd/Music/* + +/usr/local/bin/mkplaylist -e ~/doc/pdaExclude.m3u /mnt/sd/Music/ + +umount /mnt/sd + +if [ $? != 0 ] +then + echo "Problem with unmount!" +else + echo "SD card is now unmounted and can be removed" +fi