Archive | February 2009

Tip: using lshw to fecth hardware information

How many times have you searched in several places for information about your hardware ? This happens often when we are asking for a solution to some problem in a forum. The first thing you’re asked to do is tell what your hardware specs are. Instead of going through all the proc filesystem gathering the information, I find the ls* family of tools very useful. All of you know the "ls" command. These tools apply the ls to hardware.

  • lspci – list all hardware information related to PCI
  • lsusb – list all hardware information related to USB
  • lspcmcia – list all hardware information related to PCMCIA

And the most informative and useful when sending hardware information to someone: lshw. It lists all of the above and more. Although powerful, this tool should be used with care, because MAC and IP addresses are also listed here. So be careful when posting this information to a forum.

Installing and configuring Davfs2

One of the cool things about today Internet is how we can use several computers in different locations as if we were our single home computer. Some time ago, I reviewed a desktop wiki called zim, which I still use. It has seen a lot of improvements but I’ll leave that for another post.
Personal wikis are great for organizing all our stuff. And if we want to use that wiki often, then it should be available on every computer we log in. Of course, the most obvious solution would a be an online wiki. The problem is I really don’t like online wikis that much. They’re great for some purposes, but using them as a post-it notes application (like I do) is not very convenient. A desktop application can have a better UI, like zim has. At least I don’t know of any wiki out there as productive and easy to use as zim.
However, now I have a problem: how do I make zim files available from everywhere ?
The solution I recently found was to create a free account at hasfiles.com. They give you 100Mb for free and let you access those files via webdav. Using davfs2, I can mount it as a partition on my system. I then have zim configured to fetch the files from the mount point path.
The process is pretty simple, but I found a few problems along the way.
First, I needed to find a way to connect to a webdav server. Hasfiles.com have a nice help page that explains how you can use nautilus for that. But I didn’t want to use Nautilus, so I searched for a more independent solution.
I found fusedav and davfs2. I couldn’t get fusedav to work behind a proxy, but davfs2 worked fine.
Here’s how you can configure davfs2 to mount a webdav server.

  1. First, install davfs2 the normal way. If you use debian-like systems, do apt-get install davfs2
  2. Next, create the directory that will serve as mount point (eg: /mnt/remote)
  3. Then, as root, do mount -t davfs2 http://<youraccount&gt;.hasfiles.com/storage /mnt/remote
  4. It will probably ask you for a username and password. But if you don’t want to enter an username and password, edit the file /etc/davfs2/secrets and enter the line "/mnt/remote    <account>  <password>"
  5. You can also add a line to fstab, so that you can use only "sudo mount /mnt/remote" to mount the partition. Here’s an example:

http://account.hasfiles.com/storage &nbsp; /mnt/remote  davfs  noauto,user,rw  0  0

I had an issue with proxies, though. Everytime I tried to write some file it got truncated. A quick look into the log files revealed a strange HTTP error (409 – conflict). I found the solution in davfs2 forums, by adding the property "use_expect100  0" to the config file (/etc/davfs2/davfs2.conf).

Of course, you can now use that partition for anything you like. I just used zim as an example. I don’t know if I can trust their service in a long term. As with every other online service, one never knows if they’ll be up forever. So, you should always make a backup from time to time.