Blog - Unity Behind Diversity

Searching for beauty in the dissonance

Tagged: sync

HOWTO: Pair a new device for the old Firefox Sync service in Firefox 30

I got into a public fight with IceWeasel/Firefox 30 and the Mozilla sync service on pump.io last month, and was meaning to publish my “fix”… but it was so hacky, I don’t know which part of it actually worked. But, since it’s somewhat time-sensitive during this sync service transition, I figure it’s better to share this incomplete hack than to not.

The Problem: Can’t Pair New Devices in Firefox/IceWeasel 30 Using the old Firefox Sync Service

I recently switched my ThinkPad X60 from Ubuntu to Debian testing. When I tried to set up IceWeasel 30 with the Mozilla sync service, it started prompting me about creating a Firefox account — something I have absolutely no interest in doing (in fact, I was planning on moving my Firefox sync to off Mozilla’s servers to ownCloud).

I discovered that, while previously paired devies would still be able to sync using Mozilla’s old sync service for a limited time, as of Firefox/IceWeasel 30, it no longer supports pairing new devices to the old sync service.

This made me really angry. If I’d set up sync and paired the device before “upgrading” to IceWeasel/Firefox 30, I’d be syncing no problem, but Firefox/IceWeasel 30 refused to allow this. It was an infuriating combination of what felt like an anti-feature, and pressure from Mozilla to sign up for a new sync service that seems worse on the privacy front (e.g. no server-side encryption, and self-hosting is experimental now because you’d also have to self-host the Accounts service…).

The Solution: Tricking IceWeasel/Firefox by editing prefs.js

Technically, this wasn’t a new device. I’d already had my X60 Firefox set up to sync before I switched from Ubuntu to Debian. So, I managed to trick IceWeasel into letting me sync again.

This was pretty reckless (but stakes very low — brand new IceWeasel profile) and I’m not sure exactly what worked and use these instructions at your own risk, etc etc.:

  • I copied the weave folder from inside my old Ubuntu Firefox profile (not sure if that mattered), plus all of the lines in prefs.js for settings that started with “services.sync.*” (this definitely mattered)
  • I tried manually editing the preferences (resetting timestamps to zero, etc.), but what ended up happening is that when I opened IceWeasel with those lines just copy-pasted in from my Firefox profile in my old Ubuntu install that I’m no longer using, it gave me the “Pair a new Device” option the first time I accessed Sync settings!!
  • It would disappear and not come back if I cancelled pairing, but I just tried closing IceWeasel, copying/pasting those services.sync.* lines into prefs.js again, and then I successfully paired IceWeasel 30 by doing it the first time it appeared.
  • I could see “tabs from my other computers” now, but my bookmarks clearly weren’t there, so I shut IceWeasel down, and changed the value of all the services.sync.*.lastSync and services.sync.*.lastSyncLocal and a couple other similar timestamps, setting them to 0 from their prior values. Then, re-opened IceWeasel, ran the sync manually, and my bookmarks started appearing! Since then, it seems everything has been working fine

I think it was something in copying the services.sync* settings that allowed the Pair a New Device screen to work the first time I reopened IceWeasel. Then, after pairing, resetting the timestamps to 0 on the services.sync.*.lastSync* settings caused IceWeasel to download everything again anew.

YMMV. I’m not sure how much my of success depended on being able to hijack an existing client sync ID from a device that was previously configured but no longer being used (i.e. my former Ubuntu Firefox profile on my X60 that I was replacing with Debian IceWeasel). And these steps are vague and unspecific because I’m not really sure what precisely worked or what may be unwise for you to try if you don’t know what you’re doing… but feel free to contact me if you want more specifics on my set up and experience and I may be able to help.

At the very least, this will allow me to continue using the old sync service for now, until I figure out what my options are re: self-hosting, ownCloud, Mozilla’s new Firefox Accounts-based sync service, etc.

Creative Commons Attribution-ShareAlike 4.0 International Permalink | Comments (2)

HOWTO: Sync Notes Between Tomboy and Conboy with Snowy [UPDATED]

Updated: I’ve updated this guide to detail a proper sync with Snowy, rather than the old Unison hack (below), since Conboy now supports more than just Ubuntu One, and an experimental version Snowy is operational.

I’ve been a regular user of the fantastic Tomboy note-taking application since I replaced my Palm Pilot with a Nokia N900. With Conboy, a Tomboy client for Maemo, and Snowy, a web application for Tomboy notes, it seems like the perfect platform for uniting personal notes across the desktop, mobile and web (except for one drawback: Tomboy itself is a Mono application…). Initially, I used a hack with Unison to synchronize Tomboy files manually between my N900 and laptop, but I recently moved to proper, albeit still experimental, syncronization through my own Snowy server.

Installing Snowy

Snowy is a Djano-based, AGPL web service for Tomboy notes, currently under heavy development (and still labelled as experimental). I installed Snowy on my own Ubuntu web server using the official installation guides. I went with mod_wsgi, though I have Django running via mod_python on another server.

Installation was very straightforward. Just a few notes:

  • The debugmail step in the INSTALL file within the Snowy source directory didn’t seem to work for me, but I’m not too concerned about email yet. I’m just running this for me and my family. I’ll likely revisit this later.
  • Between the time that I followed the INSTALL steps and when I went to first sync from Tomboy, I had decided to switch the installation to a slightly different URL. I couldn’t figure out why the sync didn’t work, but it turns out I still had the old URL in the Django Sites table. Just a silly mistake on my part.
  • When you log in to your new Snowy server, in the current version, it isn’t obvious where to click to see your notes. You can click on your avatar in the top-right corner, or simply add /<username> to the end of your Snowy URL (e.g. my username is balleyne, so http://<my-snowy-url>/balleyne brings me to my notes

Tomboy

Tomboy comes packaged with the web sync plugin in recent versions of Ubuntu.

  1. Backup your notes!
  2. Log into Snowy in your default web browser.
  3. Open Tomboy, and go to Edit > Preferences > Syncronization
  4. Select Tomboy Web as the Service, and put in the root URL of your Snowy installation as the server.
  5. Follow the instructions to authenticate, save your settings (I set Tomboy to automatically sync every 60 minutes), and synchronize!

Conboy

Conboy focused on supporting the proprietary Ubuntu One web service first, but it now supports synchronization to any Tomboy web service (though the feature is labelled Beta). The only problem I had setting this up was a strange error about a missing api-ref and local time, but it turns out Conboy just didn’t want a trailing slash in the URL (seems like the trailing slash prevented proper authentication at the sync stage).

  1. Backup your notes!
  2. Log into Snowy in your default Maemo web browser.
  3. Open Conboy, and go to Settings in the main application menu.
  4. Enter your Snowy URL — without a trailing slash — as the Synchronization URL
  5. Click Authenticate and follow the instructions.
  6. Synchronize!

Conclusion

I’m super happy that the Tomboy / Conboy / Snowy combination is now ready to use, but do pay attention to the beta nature of Conboy sync, and the experimental nature of Snowy — make sure to backup your notes regularly to avoid any data loss.

I’m happy to be a guinea pig myself.

Old Way: Sync Notes Between Tomboy and Conboy With Unison

Disclaimer: this is a hack from someone who doesn’t know Tomboy well. It worked for me, but YMMV. And I have backups. And, mostly importantly… why aren’t you using Snowy now instead?. The instructions below should be treated as a hack preserved for historical purposes.

I wanted a way to sync Tomboy on my Ubuntu desktop with Conboy on my Nokia N900, but Conboy only syncs to Ubuntu One—a proprietary web service. Snowy synchronization support is supposed to be on the way, but Snowy itself is still under heavy development, so this might be a great option in the near future, but not today.

A comment on maemo.org made me think that rsync over ssh was a possibility, and a quick rsync showed this to work (as far as I can tell). The trick is being able to sync changes back and forth; rsync can’t handle updates to both the source and destination—it’s unidirectional.

Hence, Unison—a bidirectional synchronization utility. In case it’s useful to anyone else, this is how I’ve setup Unison to sync notes between Tomboy and Conboy.

Step 0: Some things you should know

First, I want to be clear that this is a temporary hack while I wait for proper synchronization support through Conboy with Snowy.

Prerequisites: I already have OpenSSH running on my server, and I have key-based ssh access configured from both my laptop and N900. Unison syncs remotely over SSH.

What this does: It allows me to synchronize notes and changes to notes from my N900 to my laptop, and potentially to any number of other computers.

What this doesn’t do: Unison has support for handling conflicts, but it’s not the least bit Tomboy-aware. A proper Tomboy sync might give you the option of renaming a note that has been changed in more than one place, but with Unison, you’ll be looking at diffs and merges of cryptically named XML files. So, I don’t recommend relying on Unison to sort out conflicts. I plan to sync often, backup often, and avoid conflicts as much as possible. This is for advanced users.

Tomboy Concerns: I’m using Tomboy, but actually quite uncomfortable with the risk, since it depends on Mono. I’ve considered switching to Gnote, but haven’t yet because I’m concerned about losing data/synchronization compatibility. But, this solution might work for Gnote too, and I may well s/Tomboy/Gnote/g in the near future.

Step 1: Desktop

1A: Install Unison

Unison is cross-platform and available for a variety of operating systems

I have Ubuntu on both my laptop and server right now, and I’m syncing through that server (instead of directly to my N900, which would be another option).

In Ubuntu, you can install unison with the command:
sudo apt-get install unison

Or, if you want a GUI:
sudo apt-get install unison-gtk

1B: Create a Unison profile for Tomboy

I created a file called ~/.unison/notes.prf with the following text:
# Unison preferences file
root = /home/balleyne/.local/share/tomboy/
root = ssh://alleyne.to/.local/share/tomboy/

I decided to sync my notes with the Tomboy directory on my server, which is also a workstation.

Now, I can synchronize the notes on my laptop with my server by running the command:
unison notes

1C: Enable NoteDirectoryWatcher Add-in for Tomboy

Tomboy doesn’t automatically look for changes to notes on the file system unless you enable the NoteDirectoryWatcher Add-in: Edit > Preferences > Add-Ins > Tools > Note Directory Watcher > Enable. This way, Tomboy will accept any changes you get from the Unison sync.

Step 2: Mobile

2A: Installing Unison in Maemo 5

To compile Unison, you need the OCaml compiler. To compile OCaml, you need the gcc compiler. I began the process of compiling compilers, but then realized that there were some unison .debs available already:

These were compiled for an older version of Maemo, but the command line version seems to be working fine for me in Maemo 5. Note, that if you use the GUI, it’s standard GTK, not a Maemo port, so you might need the stylus to use it.

To install, I ran the following commands:
$ sudo gainroot
# wget http://www.bundyo.org/maemo/unison/unison_2.27.57-2_armel.deb
# dpkg -i unison_2.27.57-2_armel.deb

2B: Create a Unison profile for Conboy

Similar to step 1B, I created a file at ~/.unison/notes.prf:
# Unison preferences file
root = /home/user/.conboy
root = ssh://alleyne.to/.local/share/tomboy

Now, I can sync my mobile computer with the server by running the command:
unison notes

And there was much rejoicing.

Conclusion

With Unison configured, I now have a basic, low-level sync between Tomboy and Conboy. I’m getting into the habit of syncing every time I change anything, to avoid conflicts. This should tie me over until a Conboy Snowy sync is available.

Creative Commons Attribution-ShareAlike 4.0 International Permalink | Comments (5)