Posts filed under 'software'

iPod to youPod

Before I forget, allow me to download the contents of my brain pertaining to sharing one's iPod via the www.

Here is an outline of the steps necessary.
1. Transfer iPod contents to computer
2. Rename files / clean up ID3 tags
3. Make artist directories
4. Set up Apache webserver
5. Install Apache module mod-musicindex
6. Install Icecast streaming server

Transfer iPod contents to computer. I did it like this:

BASH:
  1. # go to directory on iPod where music is stored
  2. cd /media/ipod/iPod_Control/Music
  3. # cp the contents of folders inside music directory to webroot/mp3
  4. cp {F0,F1,F2,F3,F4}{0,1,2,3,4,5,6,7,8,9}/* /var/www/mp3

Rename files / clean up ID3 tags. I did it like this:

BASH:
  1. # debian's package management system; use your equivalent
  2. sudo apt-get install mp3info mp3rename
  3. # check your tags out
  4. # set a var for mp3info cmd to print a tab separated list of title, artist,
  5. # album and newline
  6. mp3infocmd=`mp3info -print '%t\t%a\t%l\t\n'`
  7.  
  8. #**** Refer to this list and edit your ID3 tags - see man mp3info for details ****#
  9.  
  10. # find all mp3s (ignoring single quotes, newlines, etc.)
  11. find /var/www/mp3 -name '*.mp3' -print0 | xargs -0 $mp3info
  12. # rename according to your perfect tags
  13. # set default filename scheme
  14. mp3rename -s '%a&l&t'
  15. # rename!
  16. mp3rename /var/www/mp3

Make directories for artists for easier browsing.

BASH:
  1. #!/bin/bash
  2.  
  3. ########################################
  4. # mp3_sort.sh                                                                                           
  5. # note: anyone is free to use this script as I am about to post it online
  6. # it has no error checking, and will almost definitely break, so it is       
  7. # distributed with no implied merchantability or fitness for a specific   
  8. # purpose                                                                                                 
  9. ########################################
  10. srcDir=/var/www/mp3
  11. destDir=/var/www/mp3/sorted
  12.  
  13. cd ${srcDir}
  14. # disregard case
  15. find ${srcDir} -type f -iname \*.mp3 | while read f; do
  16.  
  17. # get artist
  18. ARTIST=`mp3info -p '%a' "${f}"`
  19.  
  20. # make sure artist tag defined
  21. if [ "noart$ARTIST" = "noart" ]; then # ARTIST undefined
  22. echo "some artist tag missing";
  23. else   
  24.   # destination exists?
  25.   if [ ! -d "${destDir}/${ARTIST}" ]; then
  26.   # no? then make it
  27.       mkdir "${destDir}/${ARTIST}" \
  28.       || echo "cannot make dir \"${destDir}/${ARTIST}\"."\
  29.      >/dev/stderr
  30.   fi
  31. # mv file to newly made directory
  32.   mv -f "${f}" "${destDir}/${ARTIST}"
  33. case "$?" in
  34.   #   0) echo "\"${f}"\" -> \"${destDir}/${ARTIST}\";;
  35.   0) echo "a file was moved";;
  36.   *) echo "could not move \"${f}\".">/dev/stderr;;
  37. esac
  38. fi
  39. done
  40. exit 0

Set up Apache webserver.
See apache.org for details.

Install Apache module mod-musicindex

BASH:
  1. sudo apt-get install libapache2-mod-musicindex
  2. # the REAMDE file has all the instructions on setting the Aliases to whatever
  3. # directory your music files are in

Install IceCast2

BASH:
  1. sudo apt-get install icecast2
  2. # listens on port 8000 by default; allow tcp through in your router or firewall

1 comment November 28th, 2006

Now serving mp3

I decided I wanted to to listen to my ipod at work. But I can't be bothered to carry around the device. I needed to stream my music over a network.

Basically, I use IceCast and a module for apache libapache2-mod-musicindex.

When I get a chance, I'll post some of the scripts I used to go from iPod to youPod...

My IP at home is dynamic, and I only update it twice per hour, so don't be surprised if the server's down for periods of about 30 min.

Here is what I have up:
sextrivium.net/anybody/listings.csv
sextrivium.net/anybody.listings.csv.odt (easier to read version)

Here is where you go:
sextrivium.net/mp3

Add comment November 27th, 2006

Backup DVDs

I've decided I want to back up my DVD collection. But I don't want all this extraneous shit on my discs: previews, deleted scenes, actor commentary, subtitles (excepting foreign flicks), captioning, menus. Also, I think I'd like to remove any region-codes, dma encryption, and of course they need to fit on a standard, single-layer DVD you might buy at Wal-Mart for $1.

A few notes in case I need to refer or rerefer or rererefer to them:

Strangely enough, the ripping is easier in Windows. I had originally tried to install handbrake-0.7.1, but it involved too many steps and wasn't working for me. I knew that there was a robust Windows program called DVDdecrypter that had the DeCSS embedded and a whole host of options for using it.

I read about a program called DVDShrink, which would cut the size of your file down to the size of a single-layer disc. Much of my information came from Doom9.net, which truly is the definitive DVD Ripping / Burning resource (at least, for Windows users).
So I fired up WINE (v. 0.9.9), installed DVDdecrypter and DVDShrink. No native Windows DLLs were necessary for either program.

Getting DVDdecrypter (under WINE compatibility layer) to recognize your DVD burner

A guide I discovered.

1. Use winecfg to set dvddecrypter.exe as running under WindowsNT4.0.

2. Make a symbolic link from your cdrom mountpoint(mine is /media/cdrom0) to /home/username/.wine/dosdevices/d:

BASH:
  1. #while inside ~/.wine directory
  2. ln -s /media/cdrom0 -s d:

3. Create a symlink from your burner(mine is /dev/hda) to /home/username/.wine/dosdevices/d::

BASH:
  1. #while inside ~/.wine directory
  2. #note the double-colon
  3. ln -s /dev/hda -s d::

4. Inside DVDdecrypter settings, search for drives automatically (you might also try restarting the program).

DVDShrink is basically self-explanatory. There is a tutorial (where else?) at Doom9.net. The program works nicely with DVDdecrypter or Nero, as there is an option to send the DVD files (basically the VIDEO_TS directory) to either program for direct burning. In its simplest form, it is no more than a three step process:

1. Decrypt.
2. Shrink (including removing extraneous data).
3. Burn.

>One more note: If you are using WINE, it is safe to ignore the error messages about DVDdecrypter being unable to lock the DVD drive for unique access. This would appear to be a bug in WINE.

Add comment October 17th, 2006


Calendar

November 2008
M T W T F S S
« Jan    
 12
3456789
10111213141516
17181920212223
24252627282930

Posts by Month

Posts by Category