Root access to filesystems mounted via gvfs

The DVD drive on my laptop no longer works so I wanted to install software by placing the disc in another machine and accessing it remotely. This could probably be done via NFS but my current Ubuntu/Gnome offers something called gvfs (Gnome virtual file system). Gvfs is usually accessed via the Places > Connect to server menu item but it can also be invoked on the command line as follows.

gvfs-mount sftp://user@my-server # to mount a remote filesystem via sftp
gvfs-mount -l # to list currently mounted filesystems
gvfs-mount -u sftp://user@my-server # to unmount a filesystem

Some of the filesystems are mounted in .gvfs in your home directory. Others are mounted elsewhere but I don’t know where this is configured. Gvfs uses FUSE to mount filesystems. FUSE can be configured a little bit in /etc/fuse.conf.

By default gvfs is very restrictive and won’t let root access files that have been mounted by a user. The software I wanted to install needed to be run as root so this was a problem. Others have noted that it prevents find or rsync from working properly because they are unable to access the files in .gvfs.

On the Ubuntu user mailing list Karl offers a temporary workaround. Edit /etc/fuse.conf and uncomment the line that reads user_allow_other. Then /bin/fusermount -zu $HOME/.gvfs and /usr/lib/gvfs/gvfs-fuse-daemon -o allow_root $HOME/.gvfs.

I’d like to know how gvfs is supposed to be configured.

EeePC bluetooth and webcam must be enabled in the BIOS

Bluetooth and webcam must be enabled in the BIOS of the EeePC otherwise you won’t be able to use them. They seem to be disabled when you restore the EeePC to it’s factory state.

Changing the baseURL in Typo3 and getting full https to work

After renewing our server certificates I tested the configuration by accessing our main webpage via https. Firefox reported that the page wasn’t encrypted. This happens when certain parts of the page, typically images, are accessed over http. In my case this was due to the <base href="http://eis.comp.lancs.ac.uk" /> in the head section of the page. This caused the header image to be accessed via http even though the link was specified as <img src="fileadmin/template/images/title.png" /> with a relative URL.

In the Typo3 backend edit the template as follows.

config.baseURL = http://myserver.net/
[globalString = _SERVER|HTTPS=on]
	config.baseURL = https://myserver.net/
[global]

Initially I just removed the http:// from the beginning of the baseURL but it seems to be ignored by the browser if the protocol isn’t specified.

Save the template. Don’t forget to clear the cache. On my version of Typo3 there’s a button showing a lightning bolt up in the top right corner for that.

More details about conditionally setting the baseURL at Typo Free.

Apache certificates for https

Our webserver provides https access to some admin webpages and services such as webmail or Subversion. The university computer services can get a key signed by a recognised certificate authority. Here are the steps I followed.
Read more…

Syncing Nokia 2730 with Evolution

I wanted to sync the calendar and contacts between my new Nokia 2730 phone and Evolution running on my Ubuntu laptop. It seems to work.

I installed the following packages: multisync-tools multisync0.90 opensync-plugin-syncml opensyncutils.
Read more…

Comparing floating point values in Matlab

Floating point values that look the same may not evaluate as equal in Matlab (or any other environment). I’m aware of this but keep getting caught out. There’s a blog post from 2006 on Matlab Central but it’s still very relevant.
Read more…

XSens MTx over Bluetooth

The XSens XBus Master (and inertial sensors) can be used with Bluetooth on Linux. The battery life of the XBus is reduced and there’s the possibility that the connection may be lost but it requires one cable less.

First set the XBus Master to Bluetooth mode: turn it off (3 presses of the power button), then hold the power button until the LED turns blue or purple.

Pair your computer with it using the GUI or some hcitool commands. The PIN is 0000 and the device will be called something like XM-B Sv3.5 #1.

Setup an rfcomm port to access the XBus Master as a serial device. Use hcitool scan to find its Bluetooth ID. Then run rfcomm connect 1 00:12:F3:XX:XX:XX to create a serial port at /dev/rfcomm1. Any other number than 1 is probably OK as well, including 0. You should see

eis@eis-eeepc:~$ rfcomm connect 1 00:12:F3:XX:XX:XX
Connected /dev/rfcomm1 to 00:12:F3:XX:XX:XX on channel 1
Press CTRL-C for hangup

Leave this running until you’ve finished your experiment/demo/work.

I use the CMT C++ classes to access the MTx data. In order for these classes to automatically detect the new serial port I made a small change to the cmtscan.cpp. Replace

if (strncmp("ttyS", entry->d_name, 4) == 0 || strncmp("ttyUSB", entry->d_name, 6) == 0)

with

if (strncmp("ttyS", entry->d_name, 4) == 0 || strncmp("ttyUSB", entry->d_name, 6) == 0 || strncmp("rfcomm", entry->d_name, 6) == 0)

and recompile. Alternatively create a symbolic link called /dev/ttyUSB0 (or whatever number is available) pointing to /dev/rfcomm1 (or whatever your Blutooth serial port is called).

Using awk to replace a value in a column of a data file

The following code replaces all zeros in the first column of a space separated data file with A and all ones with B.

for file in `ls *.log`; do
awk 'BEGIN { FS=OFS=" " } $1 == "0" { $1 = "A" } $1 == "1" { $1 = "B" } 1' $file > $file.new;
mv $file.new $file;
done

Thanks to Jean-Pierre for the awk bit.

Writing scientific magazine articles

I’ve almost finished an article for IEEE Pervasive Computing magazine. It’s been an interesting process without any major issues but here are a few notes for next time. These apply to this particular magazine article. Some tips are inappropriate for conference or journal papers and maybe even for different magazine editors.
Read more…

Backend menus broken in Typo3

Problem: I login to the Typo3 backend at https://myserver/typo3 and get redirected to https://myserver/typo3/alt_main.php. I see the navigation bar or the left with items such as Page, View, List and Admin Tools. The main part of the page, on the right, displays the Typo3 backend welcome page. When I click on any item under Web or File in the left menu nothing happens. It should display the appropriate information in the main frame.

Solution: A bit of a hack really. Change the URL to https://myserver/typo3/backend.php. You will still see the backend interface but the links will work correctly.