John’s Musings

1/30/2009

Nested ReWrite Maps

Today, in helping out a co-worker I came up with a pretty cool ModRewrite rule set. The rule is to be used to migrate users web pages to a new server with new user names. The rewrite will map the old user names to the new user name automatically, allowing existing sets of web pages to easily transition to the new user name without any old links breaking. This was accomplished using two RewriteMaps. The first map is used to convert any case of the old user name to lowercase. This is handled using the int:tolower function.
RewriteMap upper2lower int:tolower

The second RewriteMap is used to perform the actual user lookup. This is accomplished by creating a map file that contains a space separated pair of the form: lowercase_old_user_name new_user_name

oldusernameone Z00000001
oldusernametwo Z00000002
...

The map file is then put into play by using the line:

RewriteMap usermap txt:/etc/apache2/userlist.txt

There were two prospects to the overall rewrite that posed a bit of a challenge to me. The first challenge was to prevent the rewrite from occurring when the URL request contained the new format of user name. This was ultimately accomplished using the RewriteCond statement.

RewriteCond %{THE_REQUEST} !/~[Zz][0-9]{8}

The new user names takes the format of a single, specific, alpha character followed by 8 numeric digits. This made for an easy regular expression to match on, and using the ! character negates the normal “does match” condition of the regular expression into a “does not match” condition.

After that was solved the next problem to solve turned out to be the most difficult of all. I could not find any instructions on the net about how to properly nest two RewriteMap maps inside of each other. My first solution was slightly creative, in that I used two chained ReWrite rules. The first rule assigned the lower cased user name to an apache environment variable, then the second rule used that variable as the input to the second map. While this solution did work, it seemed really convoluted, and I knew there had to be a simpler way to do it. After walking away from the rule for a little bit, I came back to it and hit upon the correct method to nest the two maps.

${usermap:${upper2lower:$1}}

Translated into English this essentially reads as, take the first match and pass it to the upper2lower RewriteMap, and take the results of that RewriteMap and pass it into the usermap RewriteMap. Or more simply, make the user name from the URL lower case, and then lookup the lower case value in the file userlist.txt.

Next up, I just had to iron out the regular expression needed to match and replace the old user name and still retain the remaining parts of the URL, while preventing user names that do not match in our lookup to still trigger a standard 404 error.

^/~([A-Za-z0-9]+)/?(.*)

Pretty straight forward over all. In English it essentially reads:
Match the beginning of the line with /~. Take the next one or more (+) A-Z, a-z, or 0-9 characters and place them into variable $1. Place any characters following an optional / into $2. There is a flaw in this, but it should not be an issue in our implementation. If you can identify it, or better yet fix it, please post your solution in the comments. :-)

One additional touch, that I felt was important to add was the R=301 flag. This causes apache to generate an HTTP 301 permanent redirect header. This should help Google and the like properly index the new URLs. The final rewrite code block follows.

RewriteEngine On
RewriteMap upper2lower int:tolower
RewriteMap usermap txt:/etc/apache2/userlist.txt
RewriteCond %{THE_REQUEST} !/~[Zz][0-9]{8}
RewriteRule ^/~([A-Za-z0-9]+)/?(.*) http://www.example.com/~ ${usermap:${upper2lower:$1}}/$2 [L,R=301]

I’d love to hear comments, or improvements on the rule set.

1/10/2009

Installing VMware Player 2.5.1 in Ubuntu 8 via rpm

Filed under: Technology, Tips / Tricks — Tags: , , , , , — John @ 12:10 pm

I have been running VMware player 2.0.4 since August to launch a windows XP Virtual Machine.  I don’t really use the VM all that often, but when I am doing web development, I need to be able to test in IE, and thats the only way I can do it w/o rebooting to Vista *shudder*.     Towards the end of September it started telling me there was an upgrade available.  I went to the VMware website only to discover they had stopped providing the .tar.gz version of VMware player.  My only options were .bundle or .rpm.    Not really feeling like I wanted to be all that adventurous I ignored the upgrade requests.    Finally after installing the latest kernel patches last night I decided to go ahead and upgrade VMware Player as well since I would have to re-compile the kernel modules again anyway for the new linux kernel.  Having never tried to install and RPM on Ubuntu I was at a loss.

(more…)

12/12/2008

Foxmarks in the Library

Filed under: Accomplishments, Technology, Tips / Tricks, Work Stories — Tags: , , — John @ 10:38 pm

Recently I was asked by one of our librarians to come up with a way to easily add bookmarks to our Internet workstations.   A little background on this situation follows.  Our Internet workstations are all Linux based, with a custom version of FireFox.  This custom version of FireFox has a lot of things disabled to keep the browser in a stable stat.   I have removed the ability to modify the bookmarks on the workstation in any way. The event code for drag and drop, the menu items, you name it, its gone.   This has made it impossible for the librarians to manage the bookmarks on the workstations themselves.   Any bookmark changes have required me to connect to the machines via SSH and manually update the bookmarks.html file.    This method was just not convenient, and did not allow for easy updates by any means.

Earlier this week, thanks to the offloading of some tasks to our new employee, I was able to put some thought into this problem.   I needed a solution that was easy to maintain, simple for the librarians to use, and most of all, easy to implement.   That last criteria ruled out creating something from scratch, which I really didn’t want to do anyway.   Earlier in the week a co-worker had mentioned how he had just setup foxmarks on his machine and how it was going to sync his bookmarks both at home and work.   It hit me then, why not take a look at foxmarks.  I downloaded and installed it in my browser, and it did exactly as it was designed to.    I realized then that it was a purely native chrome based app.   This fact about its design made it a perfect candidate for what I needed.

I set to creating a generic account for the library, a simple task thanks to the easy to use interface.  Once that was done, I installed foxmarks into the browser on one of the Internet stations.  Due to the customizations, this was not as easy as it normally would be. ( I have all installation menus, and handlers disabled.  Ooops…) I finally worked out a way to install the extension, and once I did I set it to use the newly created account, and checked the box to save the sync password.   Foxmarks  performed its initial sync, and I was able to confirm the success by browsing the foxmarks website.   I then closed the browser, clicked yes on the dialog to clear all stored personal information and felt confident I had a good start.   I re launched the browser, hit sync, and foxmarks asked me for the password for the sync account.  What? I was certain I checked to save the password.  I checked it again, and restated the browser, again clearing the personal information.  Sure enough, foxmarks asked for the sync password again.   It then occured to me that clearing the personal information was probably clearing the foxmarks password.   That would be a problem for sure.  Confident that the password hurdle could be overcome, I set about to modifying the chrome files, and was able to hid the configuration menu items, and remove the keystroke sequence for accessing the configuration menu.

foxmarks-overlay.xul
    <menupopup id="menu_ToolsPopup">
        <menu id="foxmarks-menuitem" label="Foxmarks" class="menu-iconic"
            image="chrome://foxmarks/skin/images/foxmarks_bug.png"
            accesskey="&menu.accesskey.foxmarks;"
            insertafter="devToolsSeparator" hidden="true">

After the UI modifications were complete I  again launched the browser, and checked over the browser to make sure nothing was visible that could allow malicious patrons to manipulate the setup.    Everything I could think of was tested and it passed with flying colors.  I then added a bookmark via the website, and triggered the sync process.   After entering the password, foxmarks synced and the new item appeared.  Again, I still had to fix the password problem.   I  closed the browser again, this time un-checking the options to clear the password store.  After re-launching foxmarks synced perfectly, remembering its password.  This then confirmed for me that foxmarks was indeed using the firefox password store.  It makes perfect sense that it would, but of course in this situation, it’s very inconvenient.    I again dove into the code that comprises foxmarks.  I found, in the foxmarks-settings.js file two functions that handled the username and password.    As I suspected they ultimately called “return” with the value for the username and password.   A simple one line change to each of these functions resulted in a hard coded username and password that would stay put after a clearing of the password store.  By placing a return() just inside the function declaration we essentially bypass the default actions of  the functions.

 get username() {
	return "our_foxmarks_user_account";
        return this.getCharPref("username", "");
    },

 get passwordNoPrompt() {
        return "our_foxmarks_account_password";
        if (!this.rememberPassword && this.sessionPassword) {

After saving the modified file, I started up firefox and hit the sync keystroke, presto, no request for password or user name, and the browser synced.  I restarted again, making sure to clear the password cache, and again foxmarks worked perfectly.   At this point I deployed the modified version of foxmarks to all of our workstations, and sat back and watched the fun.   Within a short period of time, every workstation had correctly synced its bookmarks and all was well.

Finally I  sat down with the librarians and explained how to work with foxmarks’ website interface.  By the end of the first evening after foxmarks was installed we had a healthy collection of frequently used websites all bookmarked, and categorized.   The sync process has been working well and we have had no real problems.  (there was one point where I had accidentally left one of the browsers restored to its default state and some things were modified, but I caught it quickly and fixed the problem.

This alone would have been a fantastic solution, but not being one to rest on my laurels, today I used foxmarks ability to create RSS feeds from links in folders, and used that data to allow the library to randomly select a link and twitter it.  Yup, more fun with twitter.

10/17/2008

L.E.D. Fun

Filed under: Accomplishments, General, Halloween, Tips / Tricks — John @ 12:44 am

What do you get when you combine 24 awg stranded 2 conductor wire with a resistor, and a high intensity L.E.D.?

You get a really awesome spotlight so small that it can be easily hidden in even the smallest tree beach and yet illuminate a scene plenty bright enought.

Tonight, I wired 5 of these. 2 blue, 2green, and 1 red. Tomorrow I hope to make the housing for them.

2/9/2007

Car

Filed under: General, Tips / Tricks — John @ 12:35 am

Well, today has been a car day.   After getting the insurance thing straightened out, I stopped to fill up with gas.   While doing so, I placed my keys on the trunk of the car.  The temperature was of course quite cold… After filling up I got back in the car and stuck my key in the ignition.  When I did the plastic shroud that forms the hole for the keyring shattered.  It has been in bad shape for quite some time, so I wasn’t terribly surprised.

After work, I stopped at Wal-Mart to get a key made.   The woman at the desk looked at the key, and said “Oh, we can’t do that, it has a chip.”  I responded, “No, it doesn’t. It’s from 1995, they didn’t chip the keys then.”  “Uh huh… sure…  Let me show you, I’ll put it in our detector.”  I just smiled and nodded.  She stuck the key into their detector, and it didn’t light up.  She removed it and tried it again.  “Huh, I guess you are in luck, there doesn’t seem to be a chip.”  “Oh, Huh… Who knew…”  So then she struggled a bit with the machine trying to figure out what blank to use.  Once she got the key made, I paid for it, and took it to my car.  It opened the door just fine.  I stuck it in the ignition, and it wouldn’t turn. So, back I went, she made another key and this one suffered the same problem.   I kept it after I noticed what I assumed was the problem.  Their machine left a  square edge at the hilt of the key, when the original key had that spot at a 30 degree angle.

I then stopped at ACE Hardware thinking they might be better at it.  The man took a look at the key, asked me  “What year” “1995″ “Make and Model?” “Ford Tarus” He then pulled out a book, and looked up the key and selected the right blank in seconds.  (A far difference form the Wal-Mart idiot method of sticking the key in a bunch of holes to find the proper fit)  He made the key, and I paid for it.  I took it to my car, and found that it opened the door just fine also.   I stuck it in the ignition and it wouldn’t turn.   At that moment of despair a little voice in my head said “hey, flip it over”. Not one to ignore the little voices in my head when they get loud, I did and the key turned just fine.

I drove home using the new key, confident that I could easily fix the other side of the key so it would work correctly.    When I got home the little voice chimed in again with, “hey try flipping over the Wal-Mart key too”.  I did, and that one also worked when inserted one way, but not the other.    I went inside and took a good look at the keys, in both cases there was the square improperly cut spot at the hilt of the key on one side.     I got out the Dremel, and ground down the square point, and brushed the rough sharp points off, I then went out to the car, and the keys both worked.

Hurray!

So, it would seem that Ford’s key design is really just two keys stuck together in one, and there is only one set of tumblers in the ignition afterall.
The only point in the key looking the way it does is so that it will work either way you put it in.  Who knew… (yeah, all you car people out there knew already didn’t you?)

2/1/2007

iPod Scare

Filed under: Tips / Tricks, Work Stories — John @ 9:09 am

The past two days I have been re-installing everything on my work computer. It’s been hell. Thirty some apps to manually install, on top of the plethera of other work apps that are deployed by the network on first run. Today I plugged in my ipod and was appalled to see the message “iTunes has detected an iPod in recovery mode”. I panicked. Thankfully I refused to believe this was the case, as I had just used the iPod hours before and it was working fine. I did some searching on the net, and found Apple suggests that when this happens you should let it completely wipe your iPod. My response… NO… They then tell you if after wiping your iPod, you still get the message, try changing the drive letter assignment in windows. DUH! OF COURSE! I went into disk manager changed the drive letter assignment, detached and re-attached the iPod, and viola, all is well.

Why wouldn’t they list the least destructive fix 1st?

1/15/2007

No HTTPS in IE, Active X untrusted, Windows Patches untrusted

Filed under: General, Tips / Tricks — John @ 9:29 am

This weekend I was asked to look at a computer that had been giving its owner a lot of trouble.  They could not visit any HTTPS sites in IE, or AOL.  The computer also could not install any patches / updates, it would complain about the patches not being able to be confirmed as coming from a trusted source.

The first problem, getting the HTTPS protocol to work was easy enough.  That one I just had to re-register the urlmon.dll

That was accomplished with:     regsvr32 urlmon.dll 

That returned the abiltiy to browse https sites. It did not, however restore any abiltiy to install active X controlls, or install and of the downloaded windows updates.  I did some more browsing, and came across a list of other DLL’s to re-register.

regsvr32 softpub.dll
regsvr32 wintrust.dll
regsvr32 initpki.dll
regsvr32 dssenh.dll
regsvr32 rsaenh.dll
regsvr32 gpkcsp.dll
regsvr32 sccbase.dll
regsvr32 slbcsp.dll
regsvr32 cryptdlg.dll

After these we re-registered  (initpki.dll  takes forever) I tried again and everything began to work as designed.    I was able to install ALL system updates and patches.  I was able to access ActiveX controls, and website viewed as they were designed to be.

12/4/2006

All better

Filed under: General, Home Automation, Tips / Tricks — John @ 11:10 pm

I’m so pleased to announce that I have, with some help from the guy I goto when things look bleak, completely recovered my home automation / file server.

Everything is back to normal, and actually a couple of things are working better.

Thank you Zack!

How did I fix it?

booted to the SLES 9.1 boot CD, ran the recovery mode. From the console there I was able to mount the partition on the system to a temp location. Then I ran “mkinitrd /mnt/oldroot”. mkinitrd ran through the kernel on the mounted partition, and built a new initrd and dumpted it to the ramdisk /boot. I copied it form there to the boot partition on the HDD and rebooted.

Poof! up came my system. Well sorta… The ethernet interface didn’t load, but that was because I had to change out the MB which changed the mac address. A quick rename of the config file and a network services restart gave me back my ethernet connection. I rebooted once more and everything came up fine. I still ahd to do some fidgiting with the X10 controller but got that going too.

8/4/2006

It’s not just a paperclip…

Filed under: Technology, Tips / Tricks, Work Stories — John @ 3:21 pm

I really love paperclips.

Ok, stop looking at the screen so funny.  I almost never use a paperclip for holding paper together.  I just love the convienece of paperclips when I need small pieces of stiff wire.  Yesterday, quite by accident, I got pulled in to consult on a damaged color laserjet 4650.   The paper pickup assmbly had been damaged by improper removal of a paper jam.  During that jam removal part of the printer that holds a paper guide door (comes into play when duplexing) was broken off.  After some time Ron and I found all three pieces of the guide while Calette was looking up the replacement part on HP’s website.

While looking the broken part over I decided I could probably fix it with a little ingenuity.  I came back to my desk grabbed my locktite superglue like compound, and returned to the broken printer.  Once there I “cut” a paperclip into small pieces the right size to act as support “splints” and glued them on the sides of the broken assembly. Just to make sure the rough areas where the breaks occured didnt cause anything to bind, I then coated the inside with a piece of book tape. (really heavy duity, scotch tape) We then left the glue to dry overnight. Around 11 today  I reassembled the printer. (The repaired part slid right into place perfectly. I was worried that it might break again while trying to get it into place.)  Then after a little mishap with popping a door spring loose that then required the printer to be dismantled even more than the 1st time, I re-assembled the printer again. Once the diagnostics, and calibration finished, I ran the paper path tests and held my breath.   “Ok everyone, cross your fingers”.  You know, it’s really funny to watch an office full of people simultaniously cross their fingers…
The printer quietly printed the 1st side, and without missing a beat, printed the second side of the page as well.

So, as I said in the beginning, I love paperclips.

1/15/2006

The volume of the situation

Filed under: Tips / Tricks — John @ 3:53 pm

Today, due to the loss of the original headphones with the volume control I had to add a voume control slider to the kids computer. The one in the tray is disabled by way of fortres to keep them from messing with the system time, and other goodies available there.
I accomplished this easily by creating a shortcut on the “All Users” desktop. The shortcut points to “sndrec32.exe” in teh windows system 32 directory. To get just the main volume slider, and not the full volume control panel I passed the command line option “/t”. This option causes the same slider to apper that you would get when you single click on the tray volume control.

11/10/2005

Acrobat 7

Filed under: Tips / Tricks — Tags: , — John @ 8:32 pm

We have been having tons of problems with Acrobat 7.0.5 and PDF’s from our database vendors at work. These problems manifest as pages that print with only one or two lines on the bottom of the page, or the page is entirely blank. This seems to happen in Internet Explorer, as well as Mozilla. I did a ton of research and found the following to be true:

Mozilla Firefox
(1.0.7 )
Internet Explorer
(6.0.2800)
From Vendor Webserver X X
From Campus Web Server X ./
From Local Machine Webserver X ./
From Mapped Network Drive (file://) ./ ./
From Local Machine Hard Drive (file://) ./ ./

After posting numerous messages to support forums I got no resolution to the problem. I finally gave up and called Adobe. Calling Adobe is a scary thing because if they determine your problem is not a bug, and is somehtign casued by either the document you are viewing, or something on your system they will charge you ~$40 for the tech support call. I spoke with the tech, and was a little more gruff than I probably should have been. After a few questions he insisted on my CC number. After a bit more gruff conversation I gave in to the request and gave him my number. Once he had the CC number he explained to me that the documents producing this problem were created by a third party program. This third party program doesn’t fully conform to their standards and so Acrobat Reader is unsure what to do with the document. I pointed out that previous versions seem to print just fine but that version seven doesn’t. He again pointed out that it wasn’t their problem.
After hanging up with the Adobe tech I took a short breather and decided to call out database vendor. For no additional charge they told me they had been receivening complaints about this very problem, and had a temporary work around. They also offered to add me to the incident so that I would be notified when they had a more final solution.

9/12/2005

iTunes Blogger / .Net Fun

Filed under: Tips / Tricks — John @ 3:25 pm

Today I tried running the iTunesBlogger program on my normal computer and found that every time I launched it it woudl crash with a “Unhandled exception” error. Once I finally got the JIT debugger included with the .NET SDK installed I was able to discover the error message that was unhandled had to do with an improperly registerd control using the ID of “DC0C2640-1415-4644-875C-6F4D769839BA”. After doing some searching on google I discovered that that is the GUID for iTunes itself. I tried using regsvr32 to re-register all of the dll’s but had no luck in correcting the error. I finally resigned to re-installing iTunes. Once I did that everything seems to be working properly now. I should have guessed it would have been something as easy to fix as re-installing iTunes but at least now I confirmed it using diagnostic tools.

6/25/2005

Nice fix for MSI issues

Filed under: General, Tips / Tricks — John @ 5:37 pm

This wekend I was working on a computer that contained some viruses and a trojan. It seems at some point during the reign of the nastys they damaged the norton antivirus on the computer. This is a common thing and I’ve seen it more times than I can count. I was able to remove the viruses, and spyware quite nicely w/o needing to reimage the system. I installed all teh windows updates and all the updates for every program on the system and tehn went to re-install norton. I ran the installer and it when thoguh its 1st few questions and all seemed normal… When it got to the meat of the install I recieved an error saying “This MSI must be launched from setup”. This of course made no sense as the MSI WAS being run from setup. After a little googling I discovered this happens and Norton’s site had the fix. The fix involves using a tool I had not heard of that works WONDERS on MSI install problems.
There have been times int eh past where I resorted to manual registry editing to force MSI’s to think they had not been installed before but this puppy looks like it will take all the work out of it. Thank you Microsoft!

6/17/2005

Referral Spam

Filed under: General, Tips / Tricks — John @ 11:15 pm

Well I just had a chance to go over my logs for the past few months and the spammers are at it again. As most, more alert, webmasters are no doubt aware one of the newer tactics of the evil spammers is to use whats known as referral spam. Thier hope is that a site woudl ahve their stats up and wiewable to the public, and therefore give them a better ranking in search engines by littering the innocent webhosts site with links to their spamvertised site. As soon as I saw it in my logs I knew what I shoudl do, but rather than reinvent the wheel I did some google searchign and found the most common method for dealing with this is to use the apache SetEnvIfNoCase module to match keywords on the referrer and then deny the hit. This gives them a 403 forbidden error and should cut down on the massive amounts of traffic I’ve been seeing. I hate these loosers…

One great tool I did come across to test the rule is mentioned in the following post:
http://www.daveschalkboard.com/index.php/archives/2004/07/13/wannabrowser-http-user-agent-spoofing/

It was a godsend to test my rules out. I liked it so much I even donated $5.

5/5/2005

Firefox Fun

Filed under: General, Tips / Tricks, Work Stories — John @ 8:40 am

Well, I submitted my plugin for the FireFox Search feature to “The Shifted Librarian” and she posted it on her blog. There have been a few comments and some requests for information oon how I did it. I wrote the following quick HowTo for it that probably needs a LOT of correction…

HowTo add search functionality to FireFox.

There really isn’t all that much to it. It is actually easier than it looks. You basically need three files. One is the graphic, one is the Javascript for performing the install, and the other is the plugin file for FireFox. The functionality for searching with FireFox is actually the same as it is for the netscape / Mozilla sidebars however I was unable to get the results formatted quite right for those browsers so for the moment I am leaving it as just a FireFox addin. Your results may vary.

Step One: Decide where on your website the files will reside. I created a separate directory called “Mozilla” to house all of the files to make maintaining them much easier. This path will be needed in later steps so make note of it. (Mine is: http://library.waubonsee.edu/Mozilla/)

Step Two: Create your image. The image can be a .gif or a .png formatted image. I myself prefer the .png format because that format has had less copyright problems over the years and is much nicer to work with. The image must be no larger than 16 x 16 pixels. This size just happens to be the same size as a favicon.

Step Three: Create the .src file. Using the instructions and example found at: http://mycroft.mozdev.org/deepdocs/quickstart.html#firstplugin create a file with the name of your choosing, I used catalog.src You probably want to make it unique to your library. If everyone names their plugin catalog.src we will only be able to add one catalog at a time.

Step Four: Modify the example .src file to fit your library. The following items will be unique to your library:
(Note: there is a automatic generator that I did not find out about until after I wrote all of this, located at http://mycroft.mozdev.org/generator/ that should help create the .src file)

  • Examine the <search> tag in the .src file there are a number of elements in it that need to be altered to fit your environment.
  • You should not need to change the version element, so leaving it at 7.1 should be fine.
  • The name and description elements should be self explanatory.
  • In the action=”" element you will need to place the search URL for your catalog. This is the URL your search form submits information to. Take a look in your catalog for the <form> tag, the action element on that page, and the action element in your plugin will most likely be the same. URL Parameters, Items following a ? and separated by & should be included using the <input> tag. I will go into more detail on this later.
  • Change the ‘method=”Get”‘ element to match the method element in your catalogs <form> tag. This controls how information is sent to your library catalog.
  • Change the ’searchForm’ element to point to the regular page your patron would visit to start a new search in your catalog.
  • After the closing > for the <search> tag you will see a couple of <input> tags listed in the example. These tags are basically the same as any input you would pass along to the catalog via the URL parameter including the text the user wishes to search on. In the case of Web2 we have to specify a few additional items such as “setting_key” and “servers” in order for the search to work correctly. To do this, there needs to be a separate <input> tag for each parameters. If you are at ll familiar with creating forms in HTML this will be easy. The one key item is the tag in which the users search information belongs in. This tag contains the element “user” instead of the ‘value=”"‘.
  • The next tag you need to modify is the <interpret> tag. This tag contains the information Mozilla needs in order to interpret your results. In my case I left the example alone, and inserted the various comment tags into the appropriate places in the HTML for Web2. I found this easier than figuring out preexisting unique strings returned by Web2.
  • Finally you will need to make a couple changes to the <browser> tag. This tag contains the exact URL of this file on your web server, as well as the location of your icon file for this tool. This is where you need to insert the path you decided upon back in step one. Edit the update element to point to your .src file, and the updateIcon to point to your .png or .gif image. These elements tell Mozilla where to go to re-download the plugin when the number of days specified by “updateCheckDays” has passed. This allows you to make changes to your plugin and have them automatically update on the patrons browser w/o them having to re-install.

Step Five: Insert the installation Javascript into a test web page. I use the <include> tag to help keep the function code from making my website a mess. The Javascript is located here:
http://mycroft.mozdev.org/deepdocs/installing.html#server
You will need to modify a few lines to point them to the correct URL path for your plugin.

Step Six: Test your plugin, and make changes as desired. When everything works the way you want it, visit step 8.

Step Seven: Insert the installation Javascript into your website. I use the <include> tag to help keep the function code from making my website a mess. The Javascript is located here:
http://mycroft.mozdev.org/deepdocs/installing.html#server

4/27/2005

SOAPy MARC – Part 1

Filed under: General, Tips / Tricks, Work Stories — John @ 7:40 pm

Success! I have actually managed to create an interface between the Microsoft Research task pane in Office 2003, and our Library catalog. I gave up on trying to accomplish this with Perl as Office never seemed able to connect to the functions. I downloaded nuSOAP for PHP and in about 15 minutes I was able to create the Registration service to add a search site to Office 2003. Once I discovered that I had that working I decided that it would be very easy to communicate with our library card catalog using Z39.50. There are multiple advantages to using a protocol such as that. The first advantage is a matter of portability. I should be able to re-use this setup on pretty much any Z39.50 compliant database. A second advantage to searching via Z39.50 is longevity. I do not think support for Z39.50 will be vanishing any time soon, which means it might just outlive the Research task pane in office, depending on Microsoft’s plans. The third advantage to using Z39.50 to talk to our catalog is that I already have code snippets from another project I came up with that I could reuse.
Once I had decided on Z39.50 to talk tot he catalog I got to work on deciphering the communications between Office and my program. The research pane in Office communicates using XML. The XML is based on multiple schemas many of which Microsoft invented specifically for this task. Once again I was able to recycle code from yet another project in the form of an XML parsing project in PHP. (Thanks again Kris Smith, for asking me to play with RSS feeds for pod casters.)
After a little bit of tweaking and some pretty sloppy code (hey it was really late) I was able to read the search requests and see what it was that I was asking for via Office. That success spurred me on and after a very loooong night of sleep coding I started in again the following morning. (Yes when I’m obsessed about something I have a habit of writing code, and debugging things in my sleep.)
The next morning I began the task of getting the Z39.50 code setup to perform a search. At this point I wasn’t even worried about returning useful data, just the number of hits on the search. After about an hour of digging though my old code, and a VERY helpful note I left for myself in the manual on PHP.NET I was able to return the number of hits to office. At this point I had what can loosely be described as an actual research service. Pretty useless, but it did perform a search and return data form an outside source. I now had to figure out the best method for parsing out the MARC record data. If you have ever seen a MARC record you would understand the “fun” involved in that. After looking at my options I decided to go hog wild and use XML for it as well. After all I already had the XML functions in use, so why not make them do double duty. Silly me… I think I should have just returned the record in Array form. It would have been much less of a headache. A few hours later though and a couple hung processes on the server and I was able to actually return real, honest to goodness data into the research pane in office. At this point I left it alone as it was 7pm after all and went home to sleep in prep for the next day.

3/13/2005

Office 2003 Research and Reference

Filed under: General, Tips / Tricks — John @ 11:38 am

It was mentioned at the SIRSI SuperConference by Stepehen Abrams that libraries should add themselfves into the Microsoft Office 2003 Research and Refence feature. I think this is an interesting idea and am defintily going to explore it a littel more. From what I can tell the output has to be in XML. I think I can use the same wrapper script I used for WAP on WEB2 to enable WEB2 to talk XML for Office.
I have been reading an overview at Microsofts web site, and it definitly looks possible.

http://www.microsoft.com/technet/prodtechnol/office/office2003/operate/o3rsrch.mspx

I wonder how much effort it will take… I guess I’ll know more as I progress…
Heres a “Hello World” article on MSDN:

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnofftalk/html/office11062003.asp

WAP and roll

Filed under: General, Tips / Tricks — John @ 11:34 am

Well, I ahve been experiminting with WAP at work for the last week and a half. I have in that time added a numbe of WAP features to the librarys web site. It is now possible to login to both our catalog, and our new InterLibrary Loan account management software from your WAP enabled cell phone. On a whim I also wrote / borrowed a bit of code to output our book images in the WBMP format on the fly. So people looking at their InterLibrary Loan account can see the pictures of thier book images.

11/16/2004

Font Addiction bad for 9x/ME

Filed under: Tips / Tricks — John @ 9:53 am

This morning I was discussing fonts with a friend when I remebered that there is a limit to the number of fonts you can have on Windows 9x / ME . I couldn’t remember the exact number but I was thinking it was around 1000. A quick search of the MS knowledge base and I discovered this article:

http://support.microsoft.com/kb/131943/EN-US/

So remember font addicts, there can be to much of a good thing, especially in windows 9x/ME

Windows XP and 2000 users don’t have to worry, there is no limit to the number of fonts you can have. Although each font you install adds a slight increase in boot time.

10/28/2002

File Sharing Troubles

Filed under: Tips / Tricks — John @ 9:43 pm

Problem:
I have a Windows 2000 system with a file share that I was unable to access from a Windows 98 machine. Other machines running windows 2000 could access it just fine. All machines were running both TCP/IP and IPX. TCP/IP is being used primarily for file sharing, printing, and of course Internet access. IPX is in use for older games. The Windows 2000 machine could see and use shares on the windows 98 machine, but the Windows 98 machine could not use the 2000 shares. The 2000 machine was visible in the network neighborhood in windows 98. However when I clicked on it I got a “machine does not exist” error.

Solution:
I resolved this problem by unbinding IPX from file and print sharing on the windows 2000 machine. This is accomplished by right clicking on “My Network Places” and selecting “Properties”. Next Click on the Advanced menu. Then select “Advanced Settings”. Once that window appears, uncheck the checkboxes for “NWLink IPX/SPX/NetBIOS Compatible Transport Protocol” under “Client for Microsoft Networks”, and “File and Printer Sharing for Microsoft Networks”. This will force the 98 box to use TCP/IP when connecting to the share on the 2000 machine. No reboot was required on the 2000 machine for the fix to take affect.

Powered by WordPress