ubuntu

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

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

Getting Started with the Openmoko FreeRunner: Installing Om 2008.12 in Ubuntu

Heather, my girlfriend fiancée, was kind enough to buy me an OpenMoko Freerunner in January. I went out to get a new SIM card (since there were known issues with my current one) and I experimented with it for a couple weeks, but had to leave it be lately as the past couple months have been very busy.

This morning I got back into the game.

One thing I wish I’d known from the outset is that there are a bunch of different distributions available. When I went into the IRC channel for help, I got several (polite) rtfms directing me to the Getting Started guide (which I was already looking at). Except, the Getting Started guide and FAQ provided a ton of contradictory information (which I’ve since tried to correct) about which distribution ships by default, nevermind a clear explanation that there are different distributions to begin with. Even worse, the FreeRunner ships with Om 2007.2, which is old, basic and not even supported anymore. (My mom asks, “so, would you say that it’s not quite ready for the average user yet?” Considering that the first order of business is to reflash it with a new distribution…) It took me a while to figure all that out. I hope to spend some more time soon trying to improve the documentation so that new users aren’t as confused as I was in the beginning.

I’ve decided to start with Om 2008.12 Update, the latest official distribution. I may consider FAT and Dirty Openmoko (FDOM) soon, which is just Om 2008.12 “updated with many ready-to-use applications.” Qt Extended is on my radar as the just-a-working-phone distribution (but where’s the fun in that?). Though, the next major step I think will be to dual-boot with Android, as that seems like it may be the best option in the long-run (though it’s very much a work in progress now).

Installing Om 2008.12 Update in Ubuntu

Installing Om 2008.12 was actually pretty easy in Ubuntu: download the kernel and rootfs, then follow the instructions to flash the NeoFreeRunner. (I didn’t worry about a backup since I had nothing of value on there.)

I choose to use dfu-util instead of the NeoTool GUI because dfu-util is already in the Ubuntu 8.10 repositories.

sudo apt-get install dfu-util

I only encountered one problem when following the instructions. When I tried to run the dfu-util command, it detected two devices, even though I had nothing else plugged into my laptop but a power cord. The second one was named “UNDEFINED”, which wasn’t particularly helpful either.

$ sudo dfu-util --llist
dfu-util - (C) 2007 by OpenMoko Inc.
This program is Free Software and has ABSOLUTELY NO WARRANTY

Found Runtime: [0x1d50:0x5119] devnum=4, cfg=0, intf=2, alt=0, name="USB Device Firmware Upgrade"
Found Runtime: [0x0a5c:0x2110] devnum=3, cfg=0, intf=3, alt=0, name="UNDEFINED"

According to the comments on this ticket, it’s actually expected behaviour for dfu-util, and it could very well be my bluetooth interface that was showing up. Instead of disabling it, I just used the -d flag as suggested in the comments to specify which device to update. (Also, under Ubuntu, don’t forget sudo…)

sudo dfu-util -a kernel -R -d 0x1d50:0x5119 -D Om2008.12-om-gta02.uImage.bin
sudo dfu-util -a rootfs -R -d 0x1d50:0x5119 -D ./Om2008.12-om-gta02.rootfs.jffs2

… where 0x1d50:0×5119 is vendor/product ID of the FreeRunner (found via `dfu-util –list`).

The FreeRunner can boot from flash memory or a microSD card. I plan to try Om 2008.12 (or a variant) in flash and I’ll probably dual-boot with Android on the microSD card at a later date. So far, I’ve just turned it on and sent Heather a message and added her as a contact, but I hope to finally be getting some real use out of it soon!

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.

Ubuntu Christian Edition: Don’t surf the web, walk on it

I found this a while back and it’s pretty old, but I just came across it again recently and had a good laugh. There’s an unofficial Ubuntu distribution called Ubuntu Christian Edition and this blog has a ton of hilarious[ly nerdy] “facts” about it, for example…

  • In Ubuntu Christian Edition, all documents are saved by grace through faith
  • With Ubuntu Christian Edition, you don’t need to surf the web — you can walk on it
  • For 40 days before Easter, Ubuntu Christian Edition works in text mode only
  • Ubuntu Christian Edition has the confess command that deletes your logs and caches

sox soxio: Failed reading : unknown file type

I began receiving this error in Ubuntu (after upgrading to Hardy 8.04 I think) whenever I tried to use the sox or play commands. Turns out the solution is pretty simple, sox had just lost its available format libraries.

sudo apt-get install libsox-fmt-all

Getting Hydrogen to work with JACK in Ubuntu Studio

I recently stumbled upon the Ubustu Feed when I began learning Ardour. They have a great tutorial on how to sync Hydrogen with Ardour:

This tutorial will show you how to sync up the digital audio workstation, Ardour, and the advanced drum machine, Hydrogen. This will allow you to have a full featured drum machine playing in perfect time with your Ardour session. Or, one hell of a fancy click track.

I ran into one complication on my system though — getting Hydrogen to work with JACK. The output sockets just weren’t showing up when I opened Hydrogen, even though JACK was running and working fine. Thanks to a post by schivmeister in the Hydrogen Forum, I was able to get it working by changing ‘alsa_pcm’ to ‘system’ in the JACK portion of the ~/.hydrogen/hydrogen.conf file so that it reads as follows:

<jack_driver>
<jack_port_name_1>system:playback_1</jack_port_name_1>
<jack_port_name_2>system:playback_2</jack_port_name_2>
<jack_transport_mode>USE_JACK_TRANSPORT</jack_transport_mode>
<jack_connect_defaults>true</jack_connect_defaults>
<jack_track_outs>true</jack_track_outs>
</jack_driver>

Best. Metronome. Ever.

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