Archive for March, 2007

Apple TV hacking looks fun

Saturday, March 24th, 2007

The Apple TV has not been out for a week and people have opened up the little fella and have had a play with its underbelly.

So far they have ..

  • installed a Xvid codec
  • installed samba
  • installed ssh (and opened up the ports)
  • installed a 120gb hard drive

For me this is sweet. I’m thinking about setting up a media server in a wardrobe somewhere to serve daap to the family’s computers and broadcast music to me when I’m at work (through a ssh tunnel.. possibly). This little baby will be running Ubuntu on a low level PC and a few massive hard drives full of content.

Now if the Apple TV could connect via samba to this server and play my ripped DVDs, that would be so nice. It might be even better if it could connect via daap and stream video content from an non iTunes source, then it would make the most of apple tvs already buffering and caching system.

So please hack on!

Readings
Macdevcenter article
appletv hacker
appletvhacks.net
Somethingawful thread on the hacking
Gizmondo covers diy 120gig upgrade
Digg’s “OMG LOLZ H4XXORS”

Multi threaded Ruby on Rails actions?

Thursday, March 22nd, 2007

I’m currently making an app that will spit out pdf reports all over the shop. These reports will get kinda big, doing loads of database calls and rendering images. As such it could take 15 seconds or more to render. Making the reports on the fly therefore could be a horrid user experience with unexpected waits and halts (and a nightmare for a server admin).

So my first attempt was batch the process, as the majority of the data that the pdfs render only changes about once a day. The batch process would go through our database and render all the reports and dump them out to file. User access then would be instantaneous. Wonderful!

The problem is that some bits of data can change at any time. For example these reports display a contact name and email address at the top. So if that changed, the pdf wouldn’t reflect this. Not very professional.

To combat this I added a spooling table, where if some data changed a request was added to a table. A script would then run every minute that would process the pending requests.

This is a slightly dumb approach, I know. What I need is two threads. So when the user updates the contact information, one thread would render the html page as usual and the other to render the pdf. The benefit being that the user doesn’t have to wait for the pdf thread to complete.

Ruby can deal with threads but finding information about doing a task like this is tough, let alone with Rails. Any help out there?

Readings
Rails wiki on threads
Ruby Reliable Messaging Gem
Reliable Messaging Rails example

iTunes shenanigans

Wednesday, March 21st, 2007

Amusingly if you downloaded Muse - Knights of Cydonia music video from iTunes a few days ago, you would have received “Hondo” , a western starring John Wayne. So I grabbed it, downloaded about a 1gig of “music video” and chuckled at the cock up.

Today, Apple sent me the actual music video alas not once, not twice but three times. For such generosity I would like to thank Matt, Amy and Lilly from iTunes support . Oh what a lark.

Kos

I just hope iTunes will sell these sort of movies at this price (£2) when they finally strike a deal to distribute films in the UK.

Update 22/3/07 12:15 Thanks Kate!! I now have my 4th copy of the music video.
Update 22/3/07 14:16 Thanks Amy!! I now have my 5th copy of the music video.
Update 22/3/07 16:16 Thanks Brian!! Number 6 is on its way.

Readings
Whale Salad blog post
Digg’s “insightful comments”

Modest mouse makes me very happy

Friday, March 16th, 2007

Modest mouse’s (miceses?) latest album is simply amazing. And how come nobody told me that Johnny Marr has joined them? Well anyhow, Dashboard is the latest single and the new album will be out April 2nd in the UK joyfully titled ‘We Were Dead Before the Ship Even Sank”. Tracks I’m singing on the M6 recently are “Florida”, “We’ve got everything” and “Missed the boat”.

Readings
Official homepage
My-”my eyes bleed due to bad design”-space page
Modest mouse artist Wikipedia entry
“Dashboard” video
Guardian interview

The BBC iPlayer

Wednesday, March 14th, 2007

The beeb is splattering its content all over the web utilising the tactic of an ape flinging shit against a wall and seeing what sticks. Not a bad approach if you have the cash, but tech and blog sites seem to have gone crazy over the latest BBC turd winging its way to the internet wall. The forthcoming iPlayer.

The iPlayer is an online TV catch up service and might well be implementing Microsoft’s Digital Rights Management (DRM) technology. This will mean it won’t work on a Mac, Linux or whatever, you need Windows and/or a device vetted by Microsoft. I’ll be a little peeved if this doesn’t change after the public consultation.

However, its worth pointing out that the ape that is the BBC has had, so far, a very successful podcast trial and are now putting some effort into video podcasts. At the moment these video podcasts seem to be condensed versions of current shows, such as the BBC Breakfast takeaway, Heaven and Earth extra or the Blue Peter podcast.

These podcasts have no DRM associated with them.* They will play on anything from macs to zunes, without any ridiculous licensing, phoning home or any such silliness that DRM suffers from . I can even play around with the feeds and create a crazy new website if i keep to their rules. Hopefully this turd will stick, as its a much better way of getting BBC video and audio on the net compared to the crippled iPlayer.

So how come I actually think the iPlayer isn’t the such a bad thing considering video podcast are so much better?

Well the iPlayer might well have all that DRM silliness, but this sillyness can act as a security blanket for content providers. The beeb might be able to use this blanket to coax its content providers to put their content online, which is better than nothing at all.

Then, I hope, the BBC will continue developing its video podcasts. If done right people will want to have BBC podcasts on their phones, televisions, mobile video players and computers. If thats a big success (big ‘if’ I know), perhaps the other content providers will be able to see the light and want a piece of that yummy DRMless pie with all of its platform independent fillings.

I therefore hope the BBC can lead the way here. Get the content providers to use the iPlayer to test the internet water with arm bands on. Whilst the BBC allows their own video content, that without licensing or other legal issues, to be released as podcasts and not give up (like it did with the ogg streams).

*podcast is an odd word. I could replace this line with “The video files referenced as an enclosure in an RSS feed (which when looked as a whole become known as a podcast) have no DRM associated with them” I suppose.

Ruby on Rails is too slow on dreamhost

Sunday, March 11th, 2007

At work I develop Ruby on Rails applications on my wonderful little Ubuntu servers using apache2, fcgid and mysql5. They work a treat, fast responsive and is basically an easy stage to bounce off new apps. So when I was thinking about my own apps I knew I wouldn’t be able to get the same spec machine and redundancy for what I can afford, but I thought I would give dreamhost a try, I should be able to get something near the same speed for test purposes. They were cheap, seemed to offer a massive range of options and copious amounts of bandwidth.

How wrong I was. As I was developing my still unreleased super cool app I noticed that the dreamhost email servers were going up and down faster that a 10 year old with a yo yo. Odd, very odd. Then I uploaded my app tonight and holy shit was it slow to upload. Then I began to use her and yes.. it sucked utter balls, too slow.

There seems to be a few factors responsible for the shit speeds. First of all is FastCGI. FastCGI should make my app wiz around like mad, however compared to CGI its basically the same on dreamhost, which suggests a hardware or priority shitness on the servers.

Then there could be database access speed slowing everything down. The database seems to be located on a different server altogether, again noted by others.

I thought it was just RoR on dreamhost that was slow, but no it wasn’t just that. Even if you access via ssh it all seems very sluggish, even doing a “rm -r” on a directory that contained about 20 files took about 10 seconds. Thats just stupid and should be sorted.

Am I expecting too much? A page that takes less than 10 seconds to load?

Perhaps dreamhost is fine for static pages, images and nothing else. Sigh.