Sunday, October 01, 2006

In sync with UNISON

Unison is an amazing backup tool that is fortunately available on both Windows and Linux. Since it is open source it is available readily on various Linux distros (e.g. on Unison on Debian) so that you can just perform an "apt-get install unison" for Debian and have it running and accessible from computers in your network for example. But getting it work seamlessly on Windows is a little more work.

Fortunately there is an alternative (not to Unison) but to actually deploying it on Windows. This alternative comes from Cygwin which sets up a Linux-like environment for Windows (that last part was from the Cygwin website). Cygwin includes unison as part of its package and by installing Unison with Cygwin you can setup your Windows box as an SSH server with Unison so that you can backup files to this Windows box from anywhere with an internet connection.

To make sure you install Unison while installing Cygwin make sure that on the "Select Packages" window click on "View" button (on top right corner) once till the text next to the button says "Full". Scroll down till you see unison2.9.1 in the "Package" column. Then click in the second column from the left once so that the latest version shows up instead of "Skip" (at the time of writing this blog the version was 2.9.1-3). If you want to access Unison from over a network then make sure you install "openssh". The steps to install "openssh" with Cygwin is available here. And for good security make sure you setup SSH Keys using either this method or this method. I will try and add more details to the steps in future blogs. If you need help then post a comment and I will respond.

Saturday, December 03, 2005

Synchronizing bookmarks with Firefox: Hacking the extension

There is an awesome extension at http://addons.mozilla.org called the Bookmarks Synchronizer that allows you to synchronize your bookmarks stored in your Firefox local profile with either an FTP/WebDAV server. While this is common knowledge so is the fact that this extension has not been updated for the 1.5 version of Firefox.

I am sure an update will be posted soon as the extension author's webpage at http://torisugari.spymac.com/ (I am hoping this site is the author's - the name is the same but no other information is provided) features the updated extension for alpha/beta version of Firefox. I do not suggest installing extensions from unknown sources as there is no way to guarantee its security, so am posting this alternate solution to get the old version available at
Bookmarks Synchronizer to work with your Firefox 1.5 profile. To do so follow these steps:

  1. Download the extension from Bookmarks Synchronizer using the right click -> Save As... option.
  2. Rename the .xpi file to .zip (I am assuming that you are using windows. This may work with other OS but I have not tried it). Open the zip file in your favorite zip extractor and extract the contents and please preserve the folder structure.
  3. Open the folder where you have saved the extracted contents and go into the "chrome" folder.
  4. You will find a single file named "bookmarksftp.jar". Rename this file to "bookmarksftp.zip" and unzip it to another convenient location.
  5. Go into the "content" folder.
  6. Open the file "bmsyncOptions.js" in a text editor. Search for all the instances of the term "NC_NS" in this file and replace it with "gNC_NS". Save and close file in original location.
  7. In the same folder locate "selectFolder.xul" and open it in your text editor. Search for all the instances of the term "NC_NS" in this file and replace it with "gNC_NS". Save and close file in original location. (There should be only one instance in each file).
  8. Go to the parent folder and find "install.rdf". Open this file with a text editor and find the line with the text "". Change the number at this node to 1.5 (or even 1.5+). Save and close file in original location.
  9. Rename the zip file to jar and zip the contents back into the zip file and rename that zip file to xpi. At the end of this step you should have the original xpi with two minor modifications to the two files mentioned in step 6 and 7.
  10. Drag this .xpi file to your Firefox 1.5 window and install and restart Firefox.
  11. Test
Alternative method for those who are upgrading browsers and have a version of Bookmarks Synchronizer already installed:
  1. Open your profile folder. To find out where your profile folder is go to this link Mozilla Knowledgebase.
  2. Open the "extensions" folder. Navigate to the folder (it will have an odd name like {e133f188-27e7-401d-be2e-804643793acb}) under "extensions" which has a file named "bookmarksftp.jar" under the "chrome" folder.
  3. Follow steps 5 - 8 above.
  4. Having saved the new files back into the same location, zip the files up and rename the zip file preserving the name (but for extension from jar to zip and back to jar) to "bookmarksftp.jar",
  5. Drag the odd named folder (with the new bookmarksftp.jar) to any new profile to which you want the Bookmarks Synchronizer extension. If you made edits to your current profile then you should restart Firefox for the changes to show up. I would suggest doing this in an alternate location and then dragging the odd named folder, example stated above in point 2, to the extensions folder under your profile folder.
I should thank "Phil Kilinskas" as it was his comment on this extension that prompted me to find a solution to my problem. And fortunately it works well. For those waiting for this update before moving to Firefox 1.5 should be able to do so without waiting for the author as 1.5 really rocks.

Wednesday, September 14, 2005

Firefox Extension hack

If you are willing to use a Beta version of Firefox to help Mozilla test the software, then you have noticed that your favorite extensions may not work with the beta version. This is especially true in the case of Firefox Beta 1 (Version 1.6a1 and in some cases 1.5 Beta). The following methods work in the case of some of the simpler extensions such as IE View and undoclosetab which has not been updated since version 0.9.1+.

  1. Well one option is to go to the author's website to see if they have posted a newer version not yet updated on addons.mozilla.org. Well in the case of undoclosetab there is mozilla.dorando.at, if you are willing to risk adding an unknown site to your list of sites allowed to install software on your machine.
  2. But if the author has not updated their website also, then there is a hack available that may (A BIG "MAY", IF I MAY SAY SO) work. Try the following:
    • The .XPI that you find for your extension at addons.mozilla.org is nothing but a zip file with a ".xpi" extension (FYI: xpi stands for cross platform installer).
    • Download the xpi from Mozilla Addons to your computer. Rename the file to have an extension of .zip. e.g. filename.xpi would end up as filename.zip.
    • Open the Zip file and edit the file named install.rdf with a text editor (in Windows use Wordpad as it formats the document better). Find the line that says <maxversion> with a value such as 0.9.1 (the version number maybe any number not necessarily 0.9.1). Replace 0.9.1 with the version number of the Firefox Beta install (you can find the information using Help->About in the Firefox Beta Window).
    • So finally you should have this 1.6a1 instead of the old version number.
    • Save the install.rdf file back in the zip file.
    • Rename the filename.zip file back to filename.xpi.
    • Drag the new, update filename.xpi to the Firefox Beta Window and install as normal. If the extension is a simple one (more complicated ones may also work but I have had not luck with MenuX for e.g.) then your new extension should work just as normal.
Of course since this is Beta software you are aware of the risks involved with hacks such as this. But I must say I have not had any problems for the two extensions that I have mentioned with the 1.6a1 version of Firefox in the nightlies (latest-trunk).

---EDIT 12/01/2005---
An alternate method you could try is mentioned in this blog by iDan Cameron (the page is missing at this time). This alternate method seems a more graceful workaround although I have not tried it so dont know how useful it is. Also try the Nightly Tester Tools which may help install old extensions. Though this second option did not work for my Bookmarks Synchronizer. For this particular extension see my next post.
---END EDIT---