iTunes server on Gentoo?
The post says it all -- I have all my music on Gentoo Linux but I would really like it if I could stream music onto the computers around the house using the iTunes interface. It's easier than browsing files and it's got nice built-in search features.
Lo-and-behold, you can do it! Thanks to Apple for making software that can actually be interfaced with! Also thanks for to the wonderful users of Gentoo who somehow find time to write HOWTO guides for practically everything. The details can be found here.
FLAC -> MP3
So... I finally got my hard drives installed on my home server and now I just need to get my music collection into shape so I can actually play stuff. When I originally made copies of my CDs I converted them to FLAC. Why FLAC? Because I was being anal and didn't want to "downgrade" my music to a measily 192kbps MP3 format. I know this is probably trivial, but if I retain the FLAC versions, it's as if I have the original CD. Yes, I can't tell the difference between 192kbps MP3 and the lossless FLAC, but the point is, if I ever want to convert all my music into AAC or (heaven's forbid!) WMA format, I can do it fairly easily if I'm starting from a lossless format. If I start from the 192kbps MP3 I'll start getting really degraded sounding stuff pretty quickly. So that's my excuse.
How to accomplish this? In the past I'd used mpg321 to do the conversion but this time I used ffmpeg. I have all my CD collection in a directory on my system.
find "/var/mirror/Data/Audio/My CD Archive/" -name *.flac -exec /var/scripts/convert.sh {} \;
And /var/scripts/convert.sh contains:
ffmpeg -y -i "$1" -ab 192 "`echo "$1" | sed -e 's/.flac/.mp3/g'`"
This seems too much mess, but it appears to be working. The drawback? ffmpeg doesn't seem to parse the "tag" information for each file so I'm ending up with "naked" MP3s (no ID3 tag). Not the end of the world. I'll clean them up when I'm done.
The process is still chugging away -- it's completed about half of my collection.
Edit: I went ahead and figured out what I need to do to get the tags across. I installed the flac and id3 ebuilds and can now run the following script (using the same find command) to get the tags to match up from the flac files to the mp3 files.
OUTF=`echo "$1" | sed s/\.flac/.mp3/g` ARTIST=`metaflac "$1" --show-tag=ARTIST | sed s/.*=//g` TITLE=`metaflac "$1" --show-tag=TITLE | sed s/.*=//g` ALBUM=`metaflac "$1" --show-tag=ALBUM | sed s/.*=//g` GENRE=`metaflac "$1" --show-tag=GENRE | sed s/.*=//g` TRACKNUMBER=`metaflac "$1" --show-tag=TRACKNUMBER | sed s/.*=//g` id3 -t "$TITLE" -T "$TRACKNUMBER" -a "$ARTIST" -A "$ALBUM" -g "$GENRE" "$OUTF"
Thanks to this page for the info.
Some helpful SQL
I had needed this before and I had to go out and find it again so I figured I'd post it this time. Here's a really helpful SQL script that will let you do a "search and replace" within a single column of data in a table. Very, very handy when you need to update inline links (which is what I'm doing in the example below). I had set the default location of where images are saved to a folder called "uploaded_images". I later changed this to wp-content/images but the old posts still pointed to the old location even though the new posts pointed to the correct location. In order to make the old point to the new, I moved the files on the server and then ran the below script.
UPDATE `wp_posts` SET post_content = REPLACE(post_content, "uploaded_images", "wp-content/images") WHERE post_content LIKE "%uploaded_images%"
A rather mean but funny quote
Some people are like Slinkys... Not really good for anything, but they still bring a smile to your face when you push them down a flight of stairs.