howto

HOWTO: Sync Notes Between Tomboy and Conboy With Unison

Disclaimer: this is a hack from someone who doesn’t know Tomboy well. It seems to work for me, but YMMV. And I have backups.

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.

SOLUTION: Firefox Fails When Upgrading to Ubuntu 10.04 After Using Mozilla PPA

This is a quick fix for a problem I had when upgrading to Ubuntu 10.04, after having used the Mozilla PPA.

The Firefox upgrade failed during the distribution upgrade process (from 9.10 to 10.04). I was told to run `dpkg -a –configure`, and the same error occurred again (it’s in bold).

$ sudo dpkg -a --configure
Setting up firefox (3.6.3+nobinonly-0ubuntu4) ...
update-alternatives: error: alternative path /usr/bin/firefox doesn't exist.
dpkg: error processing firefox (--configure):
subprocess installed post-installation script returned error exit status 2
dpkg: dependency problems prevent configuration of firefox-3.5:
firefox-3.5 depends on firefox; however:
Package firefox is not configured yet.
dpkg: error processing firefox-3.5 (--configure):
dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of firefox-3.0:
firefox-3.0 depends on firefox; however:
Package firefox is not configured yet.
dpkg: error processing firefox-3.0 (--configure):
dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of firefox-gnome-support:
firefox-gnome-support depends on firefox (= 3.6.3+nobinonly-0ubuntu4); however:
Package firefox is not configured yet.
dpkg: error processing firefox-gnome-support (--configure):
dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of firefox-3.5-gnome-support:
firefox-3.5-gnome-support depends on firefox-gnome-support; however:
Package firefox-gnome-support is not configured yet.
dpkg: error processing firefox-3.5-gnome-support (--configure):
dependency problems - leaving unconfigured
Errors were encountered while processing:
firefox
firefox-3.5
firefox-3.0
firefox-gnome-support
firefox-3.5-gnome-support

A quick web search brought up a bug report, and I was able to figure out this fix with the help of

$ sudo rm /usr/bin/firefox
$ sudo ln -s /usr/lib/firefox-3.6.3/firefox /usr/bin/firefox
$ sudo dpkg -a –configure

The symlink for /usr/bin/firefox had been pointing to /usr/bin/firefox-3.5, which no longer existed, so the commands above (1) remove the dead-end link; (2) add the proper link (YMMV depending on which version of Firefox you are upgrading to); (3) resume the upgrade process.

Hope that helps!

SOLUTION: Extract .exe archive with 7z in Ubunu 9.04, fix “Unsupported Method” error

Just posting a quick fix to a problem I had with using 7z to extract an archive. I could list the contents of the archive, but any attempts to extract gave an “Unsupported Method” error. Dan Jacobson posted a solution to the debian bug tracking system, which is to install the package p7zip-rar.

In Ubuntu 9.04, I ran:
sudo apt-get install p7zip-rar

Now, I can extract the contents of my file with 7z as follows:
7z e TekSavvyAM.exe

HOWTO: Installing Android on the Freerunner + Rogers APN

I’ve been using the Openmoko Neo Freerunner as my mobile phone for over two months now. The phone can run a variety of software distributions. I started off with the Om 2008.12 Update, but spent the first few weeks testing out other popular distributions: FDOM, SHR, Qt Extended and finally Android. When I first tested Android, I had some trouble connecting to the GSM network and it felt like there were still some issues being worked out, so I went back to Om 2008.12, with the intention of dual-booting Android. The dual-boot turned out to be a bit trickier than anticipated, and I kept putting it off. Om 2008.12 is a cool idea, but there were some really annoying bugs and little hope of future development [Update: Ben left a comment about the recent flurry of development, including progress on Om2009t5], so yesterday I took the dive and went to a single-boot Android setup.

I started off on the Openmoko wiki page about installing Android on the Freerunner, but the installation is quite simple if you’re going with Koolu’s Android images (though there are a few other options). They provide a near automatic installation with the latest beta releases. Simply visit the website to download the images, and the installation process is dead simple:

Installation Instructions for Beta4 and Later

  1. Unpack the files on to a FAT formatted SD card.
  2. Insert card into the Freerunner, and boot from NOR menu (hold AUX key, then power)
  3. Chose boot from SD Card (FAT and ext2)

The automated install process should begin. It installs the Qi bootloader, reboots, the kernel, reboots, then the system image.

NOTE: This install process overwrites *everything* on the NAND in the phone, including the bootloader. If this is not what you would like to do, please either look at the install process, and modify it to suit your needs.

I’m in the process and figuring out the APN settings for Rogers to make use of my data plan. Oliver Fisher has the details for how to setup the Rogers APN on a G1, which matches the details I got from calling Rogers tech support, but I haven’t been able to connect yet. Not sure if this is a problem with my APN settings or with my data plan. I’ll update this post with the details when I figure it out.

Update: I can’t seem to get connected, though sometimes it says connecting, but I’ve found two posts about the Android settings on the T-Mobile G1 with Rogers which match what I’ve been told when calling 1-888-ROGERS1 (internet.com, wapuser1 / wap).

Solution: Amarok Won’t Play Anything After An Upgrade To Ubuntu 9.04

I was happy to discover earlier today that Ubuntu 9.04 includes Amarok 2. But once I figured out how to queue up some music (which took a little time), I realized that nothing would play.

This was the standard output when I ran it from the command line:
balleyne@balleyne-laptop:~$ amarok
amarok(14270) Phonon::KdePlatformPlugin::createBackend: using backend: "GStreamer"
Object::connect: No such slot MainWindow::showStatistics() in /build/buildd/amarok-2.0.2mysql5.1.30/amarok-2.0.2/src/MainWindow.cpp:692
Object::connect: (receiver name: 'MainWindow')
QLayout: Attempting to add QLayout "" to MainWindow "MainWindow", which already has a layout
link XMLID_7_ hasn't been detected!
link XMLID_7_ hasn't been detected!
Couldn't resolve property: radialGradient3986
link XMLID_7_ hasn't been detected!
link XMLID_7_ hasn't been detected!
Couldn't resolve property: radialGradient3986
QWidget::insertAction: Attempt to insert null action
QWidget::insertAction: Attempt to insert null action
QWidget::insertAction: Attempt to insert null action
QWidget::insertAction: Attempt to insert null action
QWidget::insertAction: Attempt to insert null action
QWidget::insertAction: Attempt to insert null action
QWidget::insertAction: Attempt to insert null action
amarok(14270) Plasma::Applet::save: saving to "1"
amarok(14270) Context::ContextView::setContainment: "" Line: 599
amarok(14270) Plasma::ThemePrivate::config: using theme for app "amarok"
amarok(14270) Plasma::Applet::save: saving to "2"
amarok(14270) Plasma::Applet::save: saving to "3"
amarok(14270) Plasma::Applet::save: saving to "4"
amarok(14270) CurrentTrack::dataUpdated: CurrentTrack::dataUpdated
amarok(14270) Context::ColumnContainment::insertInGrid: "" Line: 603
amarok(14270) Context::ColumnContainment::insertInGrid: "" Line: 603
link XMLID_7_ hasn't been detected!
link XMLID_7_ hasn't been detected!
Couldn't resolve property: radialGradient3986
link XMLID_7_ hasn't been detected!
link XMLID_7_ hasn't been detected!
Couldn't resolve property: radialGradient3986
link XMLID_7_ hasn't been detected!
link XMLID_7_ hasn't been detected!
Couldn't resolve property: radialGradient3986
link XMLID_7_ hasn't been detected!
link XMLID_7_ hasn't been detected!
Couldn't resolve property: radialGradient3986
link XMLID_7_ hasn't been detected!
link XMLID_7_ hasn't been detected!
Couldn't resolve property: radialGradient3986
link XMLID_7_ hasn't been detected!
link XMLID_7_ hasn't been detected!
Couldn't resolve property: radialGradient3986
Object::connect: No such slot FileBrowser::Widget::setDir( const QString& ) in /build/buildd/amarok-2.0.2mysql5.1.30/amarok-2.0.2/src/browsers/filebrowser/FileBrowser.cpp:112
Object::connect: (sender name: 'KBookmarkHandler')
Object::connect: (receiver name: 'FileBrowser::Widget')
link XMLID_7_ hasn't been detected!
link XMLID_7_ hasn't been detected!
Couldn't resolve property: radialGradient3986
link XMLID_7_ hasn't been detected!
link XMLID_7_ hasn't been detected!
Couldn't resolve property: radialGradient3986
balleyne@balleyne-laptop:~$ amarok(14270) MagnatuneConfig::load: load
QPainter::begin: Cannot paint on a null pixmap
QPainter::begin: Cannot paint on a null pixmap
QPainter::begin: Cannot paint on a null pixmap
QPainter::begin: Cannot paint on a null pixmap
QPainter::begin: Cannot paint on a null pixmap
amarok(14270) CurrentTrack::dataUpdated: CurrentTrack::dataUpdated
amarok(14270) CurrentTrack::dataUpdated: CurrentTrack::dataUpdated
amarok(14270) CurrentTrack::dataUpdated: CurrentTrack::dataUpdated
amarok(14270) CoverFetcher::CoverFetcher: ""
amarok(14270) CurrentTrack::dataUpdated: CurrentTrack::dataUpdated
QString::arg: Argument missing: Amarok - No track playing., 0:00
QString::arg: Argument missing: Amarok - No track playing., 0:00
QString::arg: Argument missing: Amarok - No track playing., 0:00
QString::arg: Argument missing: Amarok - No track playing., 0:00
QString::arg: Argument missing: Amarok - No track playing., 0:00
QString::arg: Argument missing: Amarok - No track playing., 0:00
QString::arg: Argument missing: Amarok - No track playing., 0:00
QString::arg: Argument missing: Amarok - No track playing., 0:00
QString::arg: Argument missing: Amarok - No track playing., 0:00
amarok(14270) CurrentTrack::dataUpdated: CurrentTrack::dataUpdated
amarok(14270) CurrentTrack::dataUpdated: CurrentTrack::dataUpdated
amarok(14270) Context::ContextView::clear: "" Line: 165
amarok(14270) Context::ContextView::clear: "" Line: 165
amarok(14270) Context::ContextView::clear: "" Line: 165
amarok(14270) Context::ContextView::clear: "" Line: 165
amarok(14270) CoverFetcher::~CoverFetcher: ""

The “QString::arg: Argument missing: Amarok – No track playing., 0:00″ seemed to be the problem. I found the solution from Xavier Merino:

sudo apt-get install phonon-backend-xine

I restarted Amarok and now it works fine.

Update: People are reporting mixed results in the comments. This fix doesn’t work for everyone. Let me know if you become aware of a better solution and I’ll update here.

Another suggestion is sudo apt-get install libxine1-ffmpeg

HOWTO: Compile Unison (and OCaml) under Unslung 6.10 on a Linksys NSLU2

This is a pretty obscure and incomplete howto, but I was left to figure all this out without much help so I figure I might as well post what I learned in case it is of assistance to anyone else.

At the office, we’re running a Linksys NSLU2 with the Unslung 6.10 firmware as our file server. We wanted to use Unison to do a two-way sync between portions of the server and a laptop, so that we can access documents offline and out of the office (e.g. in a meeting off-site). The unslung NSLU2 has a lot of software available through the OptWare package system, but Unison is not available. Since the architecture is non-standard (I want to say “arm” or something? anyways, not x86), I figured we’d have to compile from source. Then, one more roadblock — it’s written in OCaml, which also lacks an OptWare package and would need to be compiled from source.

Obviously, make sure you read and follow all the instructions provided with OCaml and Unison, and be sure to pay attention to the documentation at the NSLU2 Linux wiki. The following are just some tips for things that weren’t in the documentation which we had to figure out along the way.

Compiling OCaml

This proved a bit tricky. First all, you’ll need to install a few dependencies, which thankfully have OptWare packages available: make, crosstool-native (for gcc), and gawk.

Second, make sure to use the prefix flag in the configure step to install to /opt/bin and /opt/lib, rather than the standard /bin and /lib (i.e. you want to install it on one of the NSLU2 drives, not the limited internal memory). So, for example:

./configure -prefix /opt

Last, there is one problem with the MakeFile generated — there is a reference to “awk” somewhere to needs to be changed to /opt/bin/awk (unless you’re luckier than me and somehow have /opt/bin correctly on the path, but trust me, I tried…). So, I did a `grep -n awk MakeFile` to find it and then you can use nano/vim to make the edit manually to the file before compiling.

If you do those things first, compilation should be easy (just be prepared to wait awhile):

make world opt 2>&1 > log.worldopt
make install

Compiling Unison

Don’t ask me what “etags” are, but the compiler will complain if you don’t have them, and I figured out it has something to do with emacs. Once you install emacs, it gets past that stage in the compilation, so:

ipkg update
ipkg install emacs

The emacs installation actually gave me an error with a file conflict of sorts, so I had to run:
ipkg -force-overwrite install emacs

For some reason, Nathan discovered that you need to set NATIVE=false when you make Unison. I didn’t see the command, but I gather it looked something like this:
make NATIVE=false UISTYLE=text

Lastly, you’ll want to put unison on your path, so something like…
cp ./unison /opt/bin/




And then, magic! Or tragedy, if you did something wrong.

HOWTO: ThinkVantage Button in Ubuntu 8.10

I’m pretty sure this is the same fix I used in Gutsy and Hardy, but I had to do it again to get my ThinkVantage button working on my ThinkPad T61 in Ubuntu 8.10 Intrepid. I just added the following line to /usr/share/hotkey-setup/ibm.hk and it worked after a reboot.

setkeycodes e017 148 #thinkvantage button

HOWTO: Thinkpad scroll button in Ubuntu 8.10

Overall, I’ve been pretty happy after upgrading to Ubuntu 8.10, but there were a few annoyances. I noticed my Thinkpad scroll buttons stopped working, and when I checked xorg.conf, all my changes were commented out with a note “HAL is now used.” At least wasn’t too hard to figure out how to configure it through HAL.

  1. Create a new file mouse-wheel.fdi at /etc/hal/fdi/policy : sudo gedit /etc/hal/fdi/policy/mouse-wheel.fdi
  2. Add the following lines to the file:
    <match key="info.product" string="TPPS/2 IBM TrackPoint">
    <merge key="input.x11_options.EmulateWheel" type="string">true</merge>
    <merge key="input.x11_options.EmulateWheelButton" type="string">2</merge>
    <merge key="input.x11_options.YAxsisMapping" type="string">4 5</merge>
    <merge key="input.x11_options.XAxsisMapping" type="string">6 7</merge>
    <merge key="input.x11_options.ZAxsisMapping" type="string">4 5</merge>
    <merge key="input.x11_options.Emulate3Buttons" type="string">true</merge>
    </match>
  3. Restart and it should all be working.

Now to get my ThinkVantage button working again… *sigh* Update: fixed.

Fixing slide show slowdowns in OpenOffice.org Impress

My mom (who runs Ubuntu 7.10) was having trouble with old PowerPoint presentations in OpenOffice.org Impress. Her machine would grind to a halt in presentation mode and she was forced to export the presentations as PDFs in order to deliver them.

I investigated the issues and found some help in this thread. A user, Galva, had suggested making these tweaks under Tools->Options in OpenOffice.org:

MEMORY – 30 steps, 128MB, 20 objects, 20MB per object, and remove after an hour
JAVA – Do not use Java
VIEW – Open GL, optimized output, dithering, refresh during interaction and hardware acceleration all ticked.

I had already made those changes to memory and the java runtime environment, but the view settings made a huge difference. The presentations actually run now! Thanks, Galva!

Coincidently, I was checking out the new Ubuntu brainstorm and decided to submit an idea — to optimize the OpenOffice.org default settings. I find I always make these tweaks on a new install. Unless there’s a really good reason why the settings are the way they are, they ought to be changed. It’s actually third in the office category now! If these tweaks helped you, consider voting for the idea on brainstorm.

Creative Commons Attribution-ShareAlike 2.5 Canada
This work by Blaise Alleyne is licensed under a Creative Commons Attribution-ShareAlike 2.5 Canada.