Streaming Music (PC to Hi-fi)
April 08, 2008
I have always wanted to own a Squeezbox so that I can stream my iTune collection to my Conrad Johnson tube amp for some quality playback while working/playing in front of my computer. As I have got used to using iTune, there is less and less incentive to switch on my hi-fi because I hate the idea to get up every so often to switch CDs. And of course, my Conrad Johnson cannot play or scrobble to last.fm – an excellent community for music fans and a top class personalized radio station.
You may call the setup laid out below as ‘The Poor Man’s Squeezbox’ as it would be ideal for people who cannot afford a Squeezebox but still want to stream their music from a computer to their hi-fi or home-theatre sound system and to control the stream from any computers that have been hooked up to the home network (or internet if you want to make it accessible to the public at large).
First, my existing setup:
I have one desktop PC (let’s call it Bobby) and 3 laptops (let’s call them J, K & E) for my 3 girls. They are all connected to a wireless home network thro’ a Philips wireless router. We can play each other’s music collection simply by sharing the iTune library but control of song selections and playback remain with iTune itself, ie, if I hook up J to my hi-fi, I still have to get up and use the iTune (or whatever media player fancied) in J to select my song list, stop, pause or change its volume. It takes care of sharing but doesn’t get me any further in gaining control over what and how I would play my music. (just a side note here, Remote Desktop is possibly the simplest option but it tends to be an overkill because it takes over J completely and no one can use J once Remote Desktop takes over.)
Now, the ‘almost perfect’ setup using SqueezeCenter:
Requirements:
1. a server (I use Apache which imho is far superior and easier to configure than IIS that comes with my XP Pro)
2. perl
3. MySQL
4. SqueezeCenter
5. A media player (I use iTune. Winamp, Windows Media or the default player incorporated in SqueezeCenter will all work equally well.)
The main task is to get a server, perl and MySQL installed. If you are using Linux or like me who already have Apache, Perl and MySQL setup, you are nearly 80% done. The setup of Apache, Perl and MySQL are very well documented elsewhere and there are many excellent tutorials to help you get them up and running in a Windows box with minimum fuss.
(SqueezeCenter will have its own instance of MySQL installed. This is one big improvement as SQLite or any file base database will have a hard time storing a large music collection. For example, I have about 40,000+ songs and if I run amarok (the top favourite player in Linux) with SQLite, it will crash when importing my music library. It, however, works perfectly smooth when I use it with MySQL.)
Test to make sure that you can connect to localhost and run some perl scripts before installing SqueezeCenter.
SqueezeCenter is a daemon (or a media server if you like). It allows other computer to connect to it thro’ a web interface. I install it in my desktop, Bobby for the reason that my main music collection is stored in several local harddisks there and it will make importing my iTune library a little faster. In practice, it does not really matter whether I install SqueezeCenter in Bobby, J, K or E. All I need is one SqueezeCenter installed in any one of the computers in the network.
My local LAN address of Bobby is 192.168.1.88, J is 192.168.1.89, K is 192.168.1.90 and E is 192.168.1.99. After SqueezeCenter is installed, open up your favourite browser and enter the address http://192.168.1.88:9000 if I am at Bobby or enter http://192.168.1.99:9000 if I am at E (you get the idea).
SqueezeCenter web interface will warn you that it cannot detect any player, you have 3 options (to be exact):
1. Buy a Squeezebox
2. Use the default player (Read the entire warning message on the right pane if you are using the latest version of SqueezeCenter ver 7) and click on ‘SoftSqueeze’ – it will automatically install itself for you and is actually quite fun to play with as it emulates the actual Squeezebox using java. (Try this first as it saves you the trouble to open up a stream using your favourite media player. Once this is working, you can always switch to iTune or whatever.)
3. Use iTune (or any other media players) to open up a stream http://192.168.1.88:9000/stream.mp3 at Bobby or similarly http://192.168.1.90:9000/stream.mp3 at K.
After Squeezebox is installed and the music library imported under ‘Settings’ -> ‘itune’ in SqueezeCenter (bottom right corner), use the ‘select’ button at the top right hand corner of SqueezeCenter to select a player. Assuming I have launched a player in Bobby, J, K and E, I should see 4 players appearing in the dropdown menu. I will have to select the one I will be using (This can be done in any one of the computers.)
Say, if I hook up K to my hi-fi, I’d select ‘itune at 192.168.1.90’ from the dropdown menu, create a playlist or simply play any songs shown on the left pane. If one of my daughters wants to play some music thro’ her laptop speaker using J in another room, she would select ‘itune at 192.168.1.89’ from the dropdown menu.
You can expand what SqueezeCenter can do using plugins. Ver 7 is already budded with last.fm scrobbler and will scrobble to last.fm with minimum effort. Go to ‘Settings’ -> ‘Plugins’ and enter your last.fm details there. It also allows using multiple identities. I installed only one plugin - Lyrics is a handy tool to grab and display the lyrics of the current playing song in the left pane.
Finally, always take a look at ‘Settings’ -> ‘Players’. Here you will choose which last.fm identity you will use for a particular player and more importantly, the quality of audio stream. I use ‘highest’ in my wireless LAN environment and have found no skipping. If connection is made over the Internet, this may have to be lowered or maintained at the default level (which is at 9, lowest).
There is a lot more you can play with Squeezebox. If I want to play my home music collection while I am at work (assuming no one is at home to launch my SqueezeCenter for me), I will need SSH server and client. But if I just want to share my collection to the world while I’m playing at home, I can do so by simply replacing my LAN address with my WAN address (or using dynamic dns) and opening up the relevant port in my router.
Try this http://lastfm.mamafanfan.com:9000. If I’m online, you should be able to see and play my music collection. First, remember not to mess with other players in the drop down menu. Choose your own player to configure (your player will assoicate with an IP address of yours) . Secondly, as I have limited bandwidth, if it gets too busy or I suspect abuses of the system, I will have to close down the server. Good luck and enjoy!
Posted at 06:04 PM | Comments (0)
Moving a Web Host to New Location
April 03, 2008
I have just completed relocating my web host account. It involved a number of blogs using Movabletype (ver 3.2)., a photo gallery (Gallery 1.5), and a personal diary (Wordpress 2.0) residing on my home server but making use of the MySQL server in my former web host.
The entire process was made easier as both my new and former hosts allowed shell access which enabled direct transfer of files from host to host. If I did not have shell access, it would have taken me at least 3 times longer to complete the transfer involving an extra step in downloading/uploading to and from my computer.
This is to document the steps I took for the relocation. It is not only for my own reference but may also help those who are contemplating a similar move.
1. First, make a note of the following:
Existing Web Server (this can usually be found in the web host control panel and is required because after the domain transfer becomes effective, it will no longer be possible to ftp using the domain name): web.old.com
Existing Web server: web.old.com
Existing MySQL server: mysql.old.com
Existing MySQL databases: db_1, db_2 … etc
Existing MySQL users: user1, user2 …. etc
New Web Server: web1.new.com
New MySQL server: mysql.new.com
2. Create domains in your new host. Note down the new DNS server.
These new domains will not become effective until changes are made in the Register. For example, hollymolly.com is registered in www.register365.ie. I will go to the register and update the DNS (typically in the form of ns1.xxxx.com, ns2.xxx.com).
It makes no difference whether to effect the change in DNS now or later after the entire transfer process is complete. If yours a busy site, do it after so that your site will remain accessible during the entire transfer process. Mine is not and I prefer to doing it right away as the change will take a few hours to propagate and my site will be up and running by the time the transfer is complete.
Doing it now will also enable logging onto MT control panel (in the new host) to make a few necessary adjustments by the time the transfer is done.
3. Create databases in the new MySQL server using the same db names as per existing.# mysql -u root -p4. Create the same set of MySQL users with corresponding privileges.
mysql> create database db_1;
mysql> grant all previleges to db_1 to user@yourhost identified by ‘password’;(if using phpMyAdmin, it can be configured to handle both your new and old MySQL servers from the same interface saving the trouble using two instances of phpMyAdmin, one for mysql.old.com and the other for mysql.new.com. Just add $i++ with specific server configurations in config.inc.php.)
mysql> flush previleges;
mysql> quit;
5. Backup the existing databases.
Logon to the existing shell web.old.com (PuTTy is an excellent SSH client to do this) .mysqldump —all-databases -u root -p > ~/db_backup.sqlThis will create a text file db_backup.sql in your home directory. Leave this where it is for the moment.
(it is possible to do the above thro’ phpMyAdmin but take note of the size limitation imposed by it. The shell command is a lot easier.)
6. Backup the existing domain
While still in the old shell accounttar -cvf domain1.tar ~/domain1.com
This will compressed the entire content in domain1.com into a tar file domain1.tar. This file will be in your home directory.
Repeat this with other domains as follow (replace domainXXX.com with the actual domain name):tar -cvf domainXXX.tar ~/domainXXX.com
7. Transfer and Uncompress the files
Logon to the new host web1.new.com
At the shell:ftp web.old.comEnter user name and password as required.
(use sftp user_name@web.old.com if possible. It is more secure. Many hosts are now phasing out ftp)
Make sure you are at the $HOME directory:
ls -lThen
get db_backup.sqlThese will transfer all your backup files from the old host to the new host.
get domainXXX.tar
mysql -u root -p < ~/db_backup.sqlThis will import all your existing databases to the new MySQL server.
tar -xvf domainXXX.tar ~/domainXXX.com
This will copy all the content in domainXXX.com to your new host (repeat for other existing domains as required).
Almost there.
There is no need to delete the backup files. Move them to a backup directory as they provide a valuable snapshot of your web sites at the time of the transfer.
At shell,cd ~/8. The following adjustments are Software Specific.
mkdir backup
mv db_backup.sql ./backup
mv domainXXX.tar ./backup
a. Wordpress
Go to wordpress root directory (where you logon to wordpress) and edit wp-config.php using your favourite editor,
The only line that need change isdefine(‘DB_HOST’, ‘mysql.old.com’);Change this to
define(‘DB_HOST’, ‘mysql.new.com’);Databases name and user name remain the same as we have made them to be previously in step 3 & 4.
b. Movable Type
Edit mt-config.cgi
ChangeDBHost mysql.old.comTo
DBHost mysql.new.comChange
TemplatePath /home/old path to your mt tmpl/mt/tmplTo
TemplatePath /new path to your mt tmpl/mt/tmpl** If using StaticWebPath for images, it needs attention as well to reflect the new filesystem path.
Logon to MT control panel (after DNS change became effective) and adjust the new site path under “Settings”.
c. Gallery
I took the opportunity to upgrade from Gallery 1.5 to the latest version 2.2.4.
Note down the albums directory. Install Gallery 2.2.4 in a new directory.
Towards the end of the Gallery 2.2.4 installation, there is an option to import existing albums. Importing existing albums by pointing to the albums directory.
Remap the old gallery url http://domainXXXX.com/gallery to point to the path of the new gallery 2.2.4 installation so that users accessing my old gallery 1.5 will automatically see the new gallery 2.2.4
d. Others
Some software may require a different version of php to run (for example, php4.4 instead of php5.0) or its own php.ini. Using a different version of php than the one provided by your web host or using a specific php.ini can be done:
Make a cgi-bin directory in the web-root directory if it does not already exist.
Copy php5.cgi or php4.cgi to cgi-bin
Copy php.ini to cgi-bin
Options ExecCGIChange permission:
AddHandler php-cgi .php
Action php-cgi /cgi-bin/php.cgi
chmod 644 $HOME/domainXXX.com/.htaccess
chmod 755 $HOME/domainXXX.com/cgi-bin
chmod 750 $HOME/domainXXX.com/cgi-bin/php.cgi
chmod 644 $HOME/domainXXX.com/cgi-bin/php.ini
Posted at 05:11 PM | Comments (0)
Divine Performing Arts
January 18, 2008
People do not often cry when they attend a show. Divine Performing Arts has staged a marvelous performance combining ballet and classical chinese dance - a showcase of humanity’s true cultural heritage.
Posted at 01:34 PM | Comments (0)
Oh No They Did It Again
January 11, 2008
Stitching video and sound together is not something terribly difficult to do. This is a good example:
Whether it’s due to a lack of professionalism or sheer incompetence, they screwed it up again by choosing the wrong sound. And this is the official reply from the Pentagon:
“We’re saying that we cannot make a direct connection to the boats there. It could have come from the shore, from another ship passing by. However, it happened in the middle of all the very unusual activity, so as we assess the information and situation, we still put it in the total aggregate of what happened Sunday morning. I guess we’re not saying that it absolutely came from the boats, but we’re not saying it absolutely didn’t.”
The movie production department in Pentagon seems to have made little progress since Colin Powell’s presentation in the UN some five years’ ago. A lack of budget?
Perhaps, neither the warship nor the 5 speed boats are more threatening than a Fake Empire.
Stay out super late tonight picking apples, making pies
put a little something in our lemonade and take it with us
we’re half-awake in a fake empire
we’re half-awake in a fake empire
Tiptoe through our shiny city with our diamond slippers on
Do our gay ballet on ice
bluebirds on our shoulders
we’re half-awake in a fake empire
we’re half-awake in a fake empire
Turn the light out say goodnight
no thinking for a little while
lets not try to figure out everything it wants
It’s hard to keep track of you falling through the sky
we’re half-awake in a fake empire
we’re half-awake in a fake empire
Posted at 09:58 AM | Comments (0)
Album Art
January 10, 2008
I love album art - it used to be a significant element in an artist’s album release. It gives the artist an identity and is often used to convey ideas as to what may be found inside the album cover. But as the size of LP shrinks to CD and from CD reduced to thumbnails that come with the online download, album art has perhaps slowly but surely been losing its importance. The size reduction is also affecting album art as a art form as what apparently looks good in a LP size image may turn out to be terrible when it is zoomed out to 50×50 pixels or a 160×160 thumbnails. Here are some album art images for your enjoyment:
My all-time Top 5:
1. A Perfect Circle - Thirteenth Step
2. The Doors - The Best
3. Derek & The Dominos - Layla & Assorted Love Songs
4. David Bowie - Aladdin Sane
5. Elton John - Goodbye Yellow Brick Road
My top 5 which I am not supposed to like but I do:
1. Kylie Minogue - 2 Hearts
2. The Black Crows - Amorica
3. The Car - Candy-O
4. Paula Cole - Courage
5. Madonna - True Blue
Top 5 Most Significant in my life:
1. Pink Floyd - Dark Side of the Moon
2. James Taylor - Mud Slide Slim and the Blue Horizon
3. Fleetwood Mac - Rumours
4. Carole King - Tapestry
5. Bob Dylan - Highway 61 Revisited
Apart from Amazon, Album Exchange is a good place to look for album covers.
Posted at 02:27 PM | Comments (0)
Hallelujah
October 24, 2007

Chang’e 1 and the moon mission.
Posted at 02:26 PM | Comments (0)







