Archive for the 'HowTo' Category

Here’s How To Make An Extension Compatible With Prism (Two-ish)

I know it’s been a while since I’ve posted. There’s been a lot going on - school, work, home, you get the point. Anyway, I’ve been trying to keep my last post on how to make extensions compatible with Prism up-to-date, but this is turning out to be a difficult task. So I’m just going to post new instructions as needed. Basically, everything remains the same but the version string changes. The DOM inspector is the key to figuring out the correct target to put into your extension’s install.rdf. Clear as mud yet? Well, let me lay out the steps for you again here.

Step 1
Navigate to the Prism installation directory, in Windows this is:
C:\Program Files\Prism\

Open up the extensions folder, then the DOM inspector extension folder:
C:\Program Files\Prism\extensions\inspector@mozilla.org

Now open the “install.rdf” file and find this section of code which can be used (usually) as-is in most extensions pasted in the right place (just use the extension’s preconfigured targets as your guide on where to place it):


<em:targetApplication>
<!– Prism –>
<Description>
<em:id>prism@developer.mozilla.org</em:id>
<em:minVersion>0.4</em:minVersion>
<em:maxVersion>1.0.0.*</em:maxVersion>
</Description>
</em:targetApplication>

Step 2
Open up your extension’s xpi file using 7zip or your favorite archiving tool and extract the install.rdf file.

Open that install.rdf file with a text editor (other than notepad which doesn’t understand the line breaks used by other editors) and find the area where it lists the installation targets and insert your copied text into that or modify one of the install targets with the appropriate information from the DOM inspector extension install.rdf file.

Step 3
Install the extension. This will get tricky due to the way Prism’s developers have modified the profiles and what not. Well, I say that, but it really only gets that tricky if you’re manually installing the extension. Prism developers have seen fit to include the Addons menu item from the Prism menu in the lower right of Prism’s window to help things go more smoothly.

One of the ways to use this new install feature for an extension is globally, which means all webapps will be able to use the extension. This is the least preferred manner due to the fact that you won’t want all extensions available for all webapps in most cases. An example would be having the Better Gmail extension available for Bloglines - don’t think that’s real necessary, do you? So plan accordingly.

Using the second, and more preferred method, you just open your webapp. Open your webapp’s Addons panel, then install by either dragging and dropping the extension onto it, or by clicking the “Install…” button and navigating to the extension and selecting it for installation.

Conclusion
That should be about it. My next Prism post will be about how to make one of two stand alone Firefox/Prism exention webapps - POW local server or Scribefire standalone webapp. Stay tuned, we get to play with chrome!!

Links:

Prism

VMware Workstation Floppy Image Howto

I’m taking the RedHat RHA030 and 130 right now at ECU. The really cool thing about the class is that it’s all online. We use VMware Workstation 6 and connect to the classroom servers through a VPN connection. The biggest drawback to the class is that it’s all online. Weird how that works.

Any-who, one of our labs has us using mount and umount (did I mention that RHA030 is a basic GNU/Linux skills class with a RedHat flavor?) with a floppy drive. There are a couple of problems with this, however. One, there’s no virtual floppy disk on the virtual machine that’s been configured for class. Two, VMware Workstation 6 has this weird quirk (at least the version we have) that won’t allow you to create floppy images in the img format. It adds flp to the end of whatever you put want to name your file, and then gives this error that the file already exists, which doesn’t make a lot of sense since the Workstation just created the file and should know that.

So, here’s a (mostly) graphical tutorial that allows you to create your own floppy image and use it with VMware Workstation 6.

Step 1. Open VMware Workstation and select the virtual machine you want to add a virtual floppy drive to.

Step 2. Select “Edit Virtual Machine Settings” from that virtual machine’s “Commands” menu.
vfd01

Step 3. From the “Virtual Machine Settings” dialog’s “Hardware” tab, click the “Add…” button
vfd02

Step 4. On the “Hardware Wizard” dialog, select the “Floppy Drive” hardware type and then click the “Next” button.
vfd03

Step 5. On the “Hardware Wizard” dialog, choose the “Create a blank floppy image” radio button and then click the “Next” button. vfd04

Step 6. On the “Hardware Wizard” dialog, click the “Bowse” button to choose a location for your floppy image.
vfd05

Step 7. Type in the name of the image file you want to create. Notice I tried to input an “.img” extension which is one of the types listed in the file type select box. Don’t bother trying that because Workstation will automatically tack on a “.flp” extension regardless of what you input.
vfd06

Step 8. Check your file’s path and then click “Finish”. What’s supposed to happen is, Workstation creates an image file with the name in the text box.
vfd07

Step 9. What happens is Workstation adds the “.flp” extension, creates the image file, then gives you this Alert box stating: “Unable to create floppy image. File exists.” Idiotic really. Just click the “OK” button and proceed as follows.
vfd08

Step 10. You’ll now see that your file name has been appended with the “.flp” extension and that and further “Finish” clicking will merely give you to opportunity to view the Alert box again. But don’t worry, because even though you’re getting error a strange and magical thing has happened. Click “Cancel” to proceed to the next step.
vfd09

Step 11. Click “OK” on the “Virtual Machine Settings” dialog.
vfd10

Step 12. Ok, this is less of a step than just a view of the results. Remember that “strange and magical” thing I mentioned? Well, as it turns out Workstation has added the floppy drive to your virtual hardware and created and added the floppy image to your floppy drive just fine even with those errors. Weird, weird, weird, but I’m not really complaining, now I can do my lab!
vfd11

Hope this helps anyone still having problems with this.

Waterproof USB Drive(s)

OK, I’ve been a little slow in posting this. Chalk it up to classwork and laziness. Sorry.

Project Background

Anyway, the back story for this project is; about 3 years ago, my daughter (around 6 at the time) accidentally spilled a cup of coffee (no she wasn’t drinking it!) onto a brand new Seagate 5GB USB 2.0 Pocket Hard Drive. I had set a cup of coffee down next to the new drive on the coffee table, and needed to go back into the kitchen for something. I specifically warned her to be careful not to bump the coffee or the table because I didn’t want my coffee spilled. Well, that must have triggered some inborn child-instinct that says “be extremely reckless when told to be careful.”

At any rate, the coffee got spilled and I got a chance to get a look at the internals of my new drive while I was drying it out. While doing this, I got to thinking about how small the microdrive was and how it could fit into a lot of different casings. Of course, I was also thinking of how to better protect it from liquid damage and how I had so many - now less useful, smaller capacity - thumb drives laying around.

I thought that if I could get a small enough USB hub that I could fit that inside a piece of PVC or other sealable container and plug the thumb drives into it. With my new drive back together, dry and ready to go, that’s just what I did! After all I had to figure something out to do with all those old thumb drives!

Materials and Build

wp_usb_hubI got a USB hub and some other pieces and started to work. Of course, all these parts took quite some time to gather. I managed to get a few left over parts from work (sealable caps from network connectors) and ordered a USB-B jack for plugging in a USB-A to USB-B cable into. I could have easily gotten a smaller, mini-USB connector and cable assembly, but my soldering skills are not that hot.

wp_usb_hubwp_usb_hubwp_usb_hubwp_usb_hub

I ordered a 4-port USB hub (to give you some idea of how old this project is, I bought the hub on ThinkGeek and they no longer carry the hub I bought) which had two stacked 2-port USB-A jacks. I also needed some plastic resin to seal the USB jack. I used a 2″ PVC compression coupling as a housing and a couple of 2″ long PVC pipe sections as end pieces.

wp_usb_hubwp_usb_hubwp_usb_hubwp_usb_hubwp_usb_hubwp_usb_hubwp_usb_hubwp_usb_hub

I removed most of the housing and USB cable from the hub and replaced the USB plug on the cable with the jack I’d gotten. Then I sealed the jack inside the PVC pipe with the plastic resin. Before I did that however, I needed to close the back of the USB jack with a glue stick gun to keep the resin from filling the jack and making it useless. I still ended up getting some inside, but it wasn’t much as I can still insert the USB plug into it.

wp_usb_hubwp_usb_hub

In order to get all the thumb drives into the tube, I had to strip the housings from them. I used a thin piece of plastic to separate the drives and keep them from performing their own circuit bending operations on any of my data. I had to scrape some tracks into the inside of the compression fitting in order to get the hub’s circuit board in all the way. The other end of the tube was going to hold another USB-A jack, to be used as a kind of feed through USB port, but as it turns out, I didn’t fill the back of that connector correctly and the resin filled the jack. In any event I don’t think the cable connecting the 4th USB port to that jack would have allowed the hub to fit in far enough to fit along with all the drives. So it’s probably better that I just used it for a 4th thumb drive anyway.

wp_usb_hubwp_usb_hubwp_usb_hubwp_usb_hubwp_usb_hub

The Cable

wp_usb_hubwp_usb_hubwp_usb_hubI also used a piece of conduit as a cable keeper, so that my USB cable doesn’t get tangled with other cables when in transit. I use this trick, albeit with a shorter section of larger diameter conduit, with my laptop cords too. I slit the conduit or take a ¼” strip longitudinally out of the center (depending on rigidity), neatly bundle the cables (folding in half 3 - 4 times), insert into conduit, and viola - instant portable cable minder.

Software

Well all this is well and good, but there’s a problem I didn’t foresee. That would be what a pain in the but this is to unmount all these devices on Windows. With a GNU/Linux system, you simply right a script to unmount the drives all at once (and presumably put that on one of the USB drives), Windows on the other hand, sucks for this kind of functionality. But there is a half-assed solution to the half-assed situation I’ve put myself in. The command:

mountvol X: /d

Where “X” = your thumb drives’ drive letter, works to safely unmount the volume under Windows (thanks and attribution to Joel on Software), but doesn’t solve disconnecting Windows from the device (you still have the little “Safely Remove Hardware” icon on your system tray). So you need the DevCon tool available here. Now you can use the mountvol command and:

devcon remove @usb\*

Conclusion

Hot, no? Actually yes, this set up does get pretty hot after a while. I guess that’s a drawback of having this in a sealed container. Another drawback, I’ll never be able to take this on an airplane… :(

If you’re looking for something to do with all those old USB drives that are getting exponentially smaller with every passing day, then this might be a solution for what to do with your old drives. But I think the next time I do this, I’ll use the left over clear resin and do something a little more slick, like Russell Jones, and encase the whole shebang in a clear plastic block.