Archive

Posts Tagged ‘apache’

Setting Up Ubuntu PHP 5.2, MySQL 5.1 and Apache 2 on a PS3

April 27th, 2009 Chris No comments

Recently I wanted a new development box/streaming media server for use around the house and for work.

After looking at the prices of all the main small form factor PC's or NAS boxes that would let me do this I could see that I was easily looking at £200-£250 minimum for the kind of setup I wanted to put together.

At the same time, I happened to notice that Sony actually support the use of Ubuntu as an alternative OS on the playstation 3 (or possibly Ubuntu Support the PS3 as an installation platform - whichever, it doesn't matter, the point is that some one does and it works!).

Now, an 80Gb PS3 is about £290 at the time of writing and has oodles of inbuilt support as a streaming media client, media storage and playback and a blue-ray player, as well as giving me the option to install a fully functional version of linux that will allow me to do whatever the hell I liked (RAM permitting).
So last weekend I bought one and, aside from playing games, I have just finished setting up Ubuntu 9.04 on it and I'm actually blogging this via firefox on the PS3 - woohoo :D

So what did I have to do to get this working?

Well the first thing to remember, if you've had a PS3 for a while and want to keep all your game saves, downloads, etc. is to back them up! There's an easy tool to do this in the system settings menu and I found having an external  USB HDD rather than a memory stick to hand was quite useful for this. Also you might want to sync your trophy collection with the Playstation Network Servers if you're interested in keeping that kinda stuff.

Once you've done your backups, you'll need to set aside a partition for the new OS to use.

To do this, oddly enough you have to use the format disk utility from system menu, as this where the partition management is also done. Basically you select the option and you'll get the choice of either giving the Guest OS 10 GB, and the PS3 the rest of the space, or the PS3 10GB and the Guest OS the rest of the space.

I chose to give the guest OS 10Gb and keep the PS3 holding the bulk of the space as I can see myself downloading a fair few games from the playstation network over the next couple of years. Also though this 10GB default setting isn't massive,  for my needs, as a system partition it's fine since I intend to run a 1TB data tank off the back of the PS3 to hold any other media.

Anyway, what seems to happen when you do this is that the PS3 re-formats the part of the disk allocated for all non-essential user data i.e. downloads and game saves and frees up a 10Gb chunk for the new OS.

At this point I'm pretty sure you get a prompt to insert the installation media for the new OS (if you don't just click through the options relating to guest OS's and it will pop up somewhere), so you then need to get (in my case as I'm using Ubuntu) the Ubuntu installation image for powerPC and PS3 and burn it to a CD. You can get Jaunty (9.04) here

Once you have the CD in hand, simply insert it into the PS3 and the install process will start as normal with any linux distro, allowing you to partition your allocated space and setup any basic system options - note however that the install may take quite a while due to the processing speed and allocated RAM of the PS3 - that said once installed Ubuntu seems to run pretty smoothly.

To get the linux side working you need to chose the default OS to use from the system settings menu i.e. PS3 or 'Guest OS' choosing the latter will fire up Ubuntu as normal on any standard PC. The PS3 will then always boot into Ubuntu unless you type 'game' at the boot prompt, which will reset the default OS to being the PS3's own OS.

Once Ubuntu has loaded all you need to do to install Apache, PHP and MySQL, is open up a terminal and type the following (Note: I'd install MySQL first as components of Apache and PHP seem to need the libs anyway):

$shell> sudo apt-get install mysql-server-5.1

$shell> sudo apt-get install apache2

$shell> sudo apt-get install php5

Note: for some reason the MySQL setup also requires you to setup postfix, I'm not sure why but I did this anyway as it prompted me to and having postfix active on this box is no bad thing really.

The last thing to do was to boot back into the PS3 and restore the backup up game files and resync the trophies and all is done...

So that's it. I now have a fancy pants gaming system, blue ray player, media server (when I setup twonky media) and a development box all for under £300 :D

In all, if you've installed linux before and are not afraid to click around the system settings of your PS3 the whole process is pretty straightforwards and self explanatory. That said, before I actually went the whole hog I did do a little bit of research and found the following sites which was quite handy to start with. The comments on some of the articles aren't great, and some are dated now, as doing what I've outlined above has seemed to work fine for me:

https://help.ubuntu.com/community/PlayStation_3

http://psubuntu.com/wiki/UbuntuVersions?show_comments=1#comments

Categories: Linux, PS3, Ubuntu Tags: , , , , , , ,

File-system mp3 Organisation – Is It Really That Hard?

June 10th, 2008 Chris No comments

Like most people I know I have a lot of mp3's and every person likes to sort theirs differently.

My preferred method of sorting my mp3's is to do it on the file system going artist -> album -> track, but I know some who do crazy stuff like genre -> sub-genre -> artist -> album -> track and worse!

The reason I like to have it sorted on the file system is that I can quickly copy a specific artist's album when I need it, and I don't like bloated mp3 managers like itunes or winamp for managing my collection.

Also like many other people I know, though I did my best to keep things organised I still had an unsorted folder of about 1000 tracks of all kinds of stuff, which I just didn't have time to sort out properly.

So I went looking for a tool to do this organisation for me. I found a couple tools that would do the job but I had to pay for them and as this is a relatively simple job I thought I'd hunt out a free one.

As it turns out there's not many tools that I could find easily to do this in the way I wanted until I came across MediaSort (http://mediasort.sourceforge.net/). This did exactly what I wanted examining the id3 tags of the mp3s in the unsorted folder and moving them into a series of folders arranged in the way I wanted.

The only problem with this tool is that it runs of Apache ant (http://ant.apache.org/) the setup of which on windows can be a right pain to work, and hence the reason for this post - a quick and easy guide to getting MediaSort running on Windows so you too can bring order to your mp3 collection. Incidentally media sort also arranges other file types too such as avi's and images in a similar way, and as such can be really useful for those of you with massive unsorted photo collections.
So what do you do to get it going?

  1. First install the latest java development kit (jdk) for windows from Sun Microsystems (literally just download it and run the installer - version at the time of writing is 6 update 6): http://java.sun.com/javase/downloads/index.jsp
  2. Once this is installed go and grab this really, really handy Apache ant installer for windows from Google code, and, again just run the installer: http://code.google.com/p/winant/
  3. Download the MediaSort code from sourceforge: http://sourceforge.net/project/showfiles.php?group_id=169714&package_id=193585&release_id=510898
  4. Extract the media sort archive and copy the contents of everything in the sub folders of the lib folder to your Apache ant lib folder (being careful to overwrite any files that already exist) on my machine the location of the Apache ant folder is: C:\Program Files\WinAnt\lib due to using the winant installer.
  5. run the run.cmd file in the mediasort folder you just extracted and you should find that it fires up the interface
  6. Set the source folder you want to arrange - in my case C:\MP3\Unsorted and mediasort will analyse the files for meta information (id3 tags from mp3s, filesystem data on the files, etc.)
  7. Set the target folder you want the arranged mp3's to be copied or moved to - in my case C:\music\target
  8. Click on items in the list of meta-data attributes that you want to use to define where you're copying or moving files to - in my case I chose the following pattern: [MP3 - author]/[MP3 - album]/[MP3 - title].mp3
  9. Click copy or move and it will do that sorting the files to the pattern you specified - job done!

This worked great first time for me but there was room for a little improvement. Where some of the mp3's didn't have a full set of id3 tags MediaSort didn't know where to put the files and as such bundled then into folders called "unknown".

So I went hunting for another free tool to analyze the mp3s and populate all the id3 tags before running the sort again and second time round it worked flawlessly. For this part of the process I used Zortam Mp3 Media Studio 8.10 (http://www.zortam.com/) which did the job a treat.

So that's it.

One last thing to mention is if you followed my Red5 posts (http://www.coderchris.com/tag/red5/) then
you should be able to use winant to get that installed on windows too - I've not tried it yet, but it should work.