February 27, 2005

MT QuickPost hack

Since I started blogging with Movable Type, I've been using a feature formerly called Bookmarklet, now called QuickPost, for posting articles referencing other web pages. One thing that's driven me nuts is that I always had to go in and add the text 'target="_blank"' inside the link URL, so that folks clicking it would get a new window with that link instead of automatically being taken away from my pages and having the link open in that same window. Anyway, I finally dug into the code that the QuickPost code uses and found a fix.

The relevant file is (for my installation) /CGI-Executables/lib/MT/App/CMS.pm, your actual path may vary.

if ($q->param('is_bm')) {
    $param{selected_text} = $param{text};
    $param{text} = sprintf qq(<a title="%s" href="%s">%s</a>\n\n%s),
        scalar $q->param('link_title'),
        scalar $q->param('link_href'),
        scalar $q->param('link_title'),
        $param{text};

The 3rd line there is the key, the one that actually puts the link into the web page. Simply change it to read as follows, and save the file:

        $param{text} = sprintf qq(<a title="%s" href="%s" target="_blank">%s</a>\n\n%s),

Now, open your Bookmarklet/QuickPost, and the revised link should now be used. Of course, you will need to revise this code each time you upgrade, so you may want to make a note somewhere to yourself about this. ;)

Posted by Jim at 9:18 PM | TrackBack

February 14, 2005

USB card search

Well, I'm not having a whole lot of luck so far, I've researched several USB 2.0 cards, most 4-5 port models, and what I've found is that these cards basically offer a single USB 2.0 bus, shared among each of the ports on the card. Essentially, a 1 USB port card with a built in hub. Not really what I'm looking for. On the plus side, these same cards reportedly offer TWO USB 1.1 busses at the same time, so if you're mixing device types, it isn't quite so bad, but I already have two USB 1.1 ports (each on their own bus), so that functionality is useless.

Certainly there must be someone that offers a USB 2.0 card with multiple USB 2.0 busses, my search continues...

Posted by Jim at 10:13 PM | TrackBack

February 10, 2005

Shuffle RAID Redux

You've asked for it, you've got it! In the next few weeks I'll be revisiting my iPod Shuffle RAID project, and I've got a few new things to try out. First I'll be adding a USB 2.0 card and quality USB 2.0 extension cables to the mix (Manufacturers, please feel free to contact me regarding donating produt to review), and eliminating the USB 2.0 hub. Second, I've got a few ideas in mind that might just get a bootable OS onto the array, so stay tuned for that. The big delay, of course, will be getting my hands back on those four iPod shuffles... ;)

And to answer the big question that's been floating around the net since I posted that article 'Why', it's as simple as 'Why not?'. For those that complained that this was not a cost effective solution, they've obviously missed the point or are humor impaired. This was just one of those cool projects to see how far you can stretch a given technology, and hopefully give others some ideas on what things are capable of. But it might just be a record for the highest capacity RAID drive of it's size...

Posted by Jim at 6:21 PM | TrackBack

February 8, 2005

Like... Wow. Totally.

Ok, so by now I think everyone on the planet has seen my iPod Shuffle RAID hack. My little site here was doing fine all weekend, all day Monday, happily serving up pages to all sorts of surfers in Asia & Europe, and a smaller number from the US. Not bad for an old G4 sitting under my desk at home running off a Cable Modem connection. Then along comes Slashdot and suddenly my site slows to a crawl under the flood of connections...

Naturally I instantly thought of several things that could help my site deal with the load, but my system was totally unreachable at the time for me to do anything about it. Once I arrived home from work, I set about Slashdot-proofing my site.

First of all, and I'm sure that some of you noticed this, the main images in my Shuffle entry weren't stored on my local system, but instead hosted via my .Mac account. They have wide bandwidth and redundant servers, quite able to handle the load of serving those few files, and keeping that traffic away from my server. But I was still serving up the HTML page itself, several smaller graphics, and the CSS styles sheet. Not a huge chunk of data, but every one of those was a separate request of my server, so again over to mac.com they went. What I was left with was my system here simply serving the HTML code itself, and all graphics and the relatively static CSS file coming from my .Mac account, with the single exception of the favicon.ico file, which I didn't feel like moving since it was so small and few browsers requested that file anyway.

Next up was some quick tuning of Apache, tweaking some of the default settings to adjust timeouts and the number of connections it would handle. I'm still trying to tweak this a bit, and I will regard this as something of a black art, if you're interested, use Google to do some research on this topic, you'll have a bit of reading ahead of you. ;)

Lastly, I noticed that a fair bit of the pounding my server was getting was from some script kiddies who were trying to do all sorts of Windoze exploits and searching for various files/directories, none of which exist on my system. All I could really do there was just shut down the web server for a few seconds when I saw my activity going nuts, and after a few hours things finally settled down.

Most ISPs add in some free web hosting for their users, if you run a small site off a home system, do yourself a favor and take advantage of their bandwidth, offload as many static files from your site to their system, and reduce the overhead of what your system has to serve.

Posted by Jim at 10:18 PM | TrackBack

February 3, 2005

iPod Shuffle RAID

So, what do you do when you and some friends are all getting iPod Shuffles? You make a RAID array out of them, of course! Follow along as we explore new depths of geekery...

Special thanks to Justin, Melissa, and Shanea for the use of their iPod Shuffles. ;)

So, here we have our iPod Shuffles, all the top of the line 1Gb models. I'm sure that normal folks would probably take these home, install iTunes 4.7.1 from the CD in the box, and happily start putting music on the little things, but I had other plans for them...



Of course, for my plans to work, I next had to take a quick trip over to Fry's to pick up a suitable USB 2.0 hub, and by suitable I mean one that would allow two or more Shuffles to be plugged in. Not an easy task, but I finally found a nice little one from PPA Inc. that would do the job (Model 1820, not listed on their web site). After getting them all plugged in, it looked like this:





Next we have the process of preparing them to be used as a RAID array. So we fire up Disk Utility, and put them into a RAID set, Striping them for a grand total of 3.9Gb of storage.



Once that process has completed, we how have the new RAID volume available on the desktop and can copy files over to it. As far as the Mac is concerned, it's just another drive on the system. Of course, iTunes no longer recognizes it, but it's no longer really portable in this configuration anyway...



Total time to copy a total of 1.86Gb was just under 11 minutes. Obviously if each Shuffle had been on their own independent USB 2.0 BUS, this speed would have been improved.

My original intent was to actually install OS X on the RAID and boot from that, but the OS X (Panther, 10.3.5) Installer wouldn't allow installation onto the RAID array, either as a Strip or Mirror set. After restoring the Shuffles to their original configuation, I tried the OS X Installer again and even the Shuffle itself would not allow OS X to be installed on it, possibly due to how the volume itself is made available to the OS.



3/3/05 - Note: Be sure to read the followup article, Shuffle Raid wrapup.

Posted by Jim at 5:29 PM | TrackBack