WebDav and fstab

This page has moved.  Please update your links:
http://linuxsagas.digitaleagle.net/2008/09/09/webdav-and-fstab/

We have a webdav enabled web site that I wanted to connect to on a regular basis.  I wanted it to mount on my filesystem as opposed to just using it in nautilus so that I could use meld to copy files to it.

So, I added a line to the end of /etc/fstab   (sudo gvim /etc/fstab):

https://mywebsite/~docs    /dir/to/mount/on    davfs    user,noauto,rw    0    0

Then, I added the following line to /etc/davfs2/secrets:

https://mywebsite/~docs    myusername    mypassword

Originally, I had just the unsecure http:// url.  But, it gave me this error:

/sbin/mount.davfs: Mounting failed.
401 Unauthorized

I fixed it by changing the urls to https://.

When I mounted it as root, it worked fine.  But, when I mounted it as my regular user, I got this message:

/sbin/mount.davfs: program is not setuid root

To fix it, I had to run this command:

sudo chmod u+s /sbin/mount.davfs

Then, I changed the file /etc/davfs2/davfs2.conf.  I changed the dav_group setting.  For me, I found a line that said “dav_group staff”.  I replaced staff with my username, which is my default group.  The thread I read mentioned using the users group.

Resources

Advertisements
Posted in How To. 5 Comments »

Gpsd: Fixing for Ubuntu

I have an LT-20 Delorme Earthmate GPS.  It may not be the best GPS, but it gets the job done.  Getting it to work in Ubuntu was no easy feat.

I had to fix a bug in a cypress module.  I followed the instructions from here.

To get the kernel version, I ran:

uname -r

Then, to install the kernel source, I ran:

sudo apt-get install linux-source-2.6.24

Then, I changed directories into the installation directory and unzipped the source:

cd /usr/src
sudo tar -xvf linux-source-2.6.24.tar.bz2

Then, I copied the two files:

cd linux-source-2.6.24/drivers/usb/serial/
sudo mkdir /usr/src/modules
sudo cp cypress_m8.h cypress_m8.c /usr/src/modules/

Next, I created the make file (note that I have installed gvim.  I saw a note saying that they had problems using the gedit text editor):

cd /usr/src/modules
sudo gvim Makefile

And, I pasted these lines into the Makefile:

obj-m := cypress_m8.o
KDIR := /lib/modules/

$(shell uname -r)/build
PWD := $(shell pwd)
default:
$(MAKE) -C $(KDIR) SUBDIRS=$(PWD) modules

Then, I edited cypress_m8.c and commented out line 408.  The original instructions have more detail on this.  I thought the line number might be different, but it was the same as the original instructions.

When running make (sudo make) I had trouble with “make: Nothing to be done for `default’.” message.  I just opened the file and deleted and readded the tab in front of the last line.  Then, it ran fine.

Then, I ran the command:

sudo install -m 644 cypress_m8.ko /lib/modules/`uname -r`/kernel/drivers/usb/serial/cypress_m8.ko
sudo depmod -a

Resources

Windows VPN in Linux

I had need to connect to a Windows-based VPN, and I found the instructions to do so here:

http://pptpclient.sourceforge.net/howto-ubuntu.phtml

Screenlets

From Desklets to Screenlets

I tried to install gDesklets, but I had trouble with them.  I found a post that explained how to do it in Ubuntu.  And, I found a package in the Fedora repository for yum.  But, I had the following problems:

  • I never could get the good weather applet to work.
  • I couldn’t get the shortcut key to work for bringing them to the front.
  • The icon displayed by the clock, but it didn’t seem to do anything when I clicked on it (either left or right click)

So, I decided to try screenlets instead.  Maybe I am a little impatient, but I had had trouble with them in Ubuntu too.  I thought a change of scenery might me nice.

Installing Screenlets

To save you a few steps, you might want to run the following command right now.  That will save you from the errors I got as I went through:

yum install python-devel gnome-python2-gnomekeyring

I found the installation instructions on the FAQ.  I found the latest download on the main page at launch pad. I downloaded it to my Download directory and ran the following in a terminal:

cd ~/Download
tar -xzvf screenlets-0.1.1.tar.gz
cd screenlets
sudo python setup.py install

I did get the following error:

error: invalid Python installation: unable to open /usr/lib/python2.5/config/Makefile (No such file or directory)

That was easily fixed by using yum to install python-devel (see this post).

At this point, screenlets was installed, but the next step was to configure it.  I ran:

screenlets-manager

That command gave me this error message:

ImportError: No module named gnomekeyring

This was easily fixed by using yum to install gnome-python2-gnomekeyring (see this post).

After fixing that, the Screenlets Manager opened, and that was all that I had to do.  I rebooted at that point, not that I had to, but I wanted to for another reason.  Amazingly enough, the screenlets was already running by the clock.  I didn’t need to do anything to get it to auto start.

Adding Screenlets

I chose to add the following screenlets:

  • Battery: Displays the battery status of my laptop
  • GMail: I added my email address, and it displays how many messages I have unread
  • Weather: I added my zip code, and it shows the weather for my area
  • SysMonitor: Displayed info about my computer
  • DigiClock: A simple digital clock

Displaying/Hiding

When I first added the screenlets, they were on the top all of the time.  But, I found that I could hide them by making them a widget and removing the Keep Above option:

right click > Window > Widget (checked)
right click > Window > Keep above (unchecked)

Then, I had to configure Compiz.  I opened the CompizConfig Settings Manager, and found Widget Layer under Desktop.  I checked this option, and then looked at the settings.  F9 was the shortcut key, and I added the bottom right corner as another option.

Installing More Screenlets

  • Download the screenlet you wish to install (you don’t need to unzip it)
  • Open the Screenlets Manager
  • Click the Install option on the left panel
  • Choose “Install Screenlet”
  • Browse to the location where you saved the screenlet
  • Find the new Screenlet in the list and start it

Here are the additional Screenlets I downloaded:

Gnome Do Issue

I installed Gnome Do and really like it.  Just one problem: the keyboard shortcut would not work!  Here is what I did to fix it:

Start Key (Super Key) Issue

From this thread, I found that I could create this text file —

File Name: $HOME/.xmodmaprc
Put the following two lines in the text file:

keycode 115 = Super_L
add Mod4 = Super_L

Run the following command in a terminal window:

xmodmap ~/.xmodmaprc

The Start key worked right away, but when I rebooted, it asked me if I wanted to load the file.  I put the file in the loaded column and it continued to work after the reboot.

Gnome Do Shortcut

I decided to change the command from Start + Space to Start + R (like Windows Start … Run).  Here is what I did:

I used Yum to install gconf-editor.  You may already have the tool, but I did not.

Then, I opened the Configuration Editor — Applications > System Tools > Configuration Editor.

On the left side, I opened the path: / > apps > gnome-do > preferences.

Then, I changed the key_binding on the right to <Super>r.

Resources

Umm… My Super Key Just Stopped Working…

Shortcut not launching gnome-do

Installing Firefox 3 beta3

I mostly followed Ubuntu Geek’ instructions.

I made the backup of the profile directory:

sudo cp -R ~/.mozilla ~/.mozillabackup

I checked in Synpatic package manager and found that libstdc++5 was already installed.

I followed the link they provided for downloading the new version.

I extracted it as they suggested to the /opt directory:

sudo tar -C /opt -jxvf firefox-3.0b3.tar.bz2

For the plugins, I created the link that they suggested. Make sure you see that you have the right plugins directory — it looked like there could be various locations for the plugins.

cd /opt/firefox/plugins/
ls /usr/lib/firefox/plugins/
sudo ln -s /usr/lib/firefox/plugins/* .
I found some information about controlling profiles, and so, I created a different profile for Firefox3. First, I created a copy for Firefox:

cp -r .mozilla .firefox3
/opt/firefox/firefox -P “firefox3”

The first time, it brought up the “Choose User Profile” dialog. So, I clicked on the Create Profile button and created a new profile by the name of firefox3. For the path, I chose $HOME/.firefox3/firefox/tgvjuj9r.default (the copy of my default profile).

How To: Scan a Hard Drive with Fedora 8 Live CD

I had downloaded the i386 version of the Fedora 8 Live CD. Since I already had it downloaded and burned to a CD, I decided to use this to scan a laptop’s drive for viruses. There is probably an easier way, but I thought this would be a good exercise.

Once booted, open a terminal and run the following commands:

su -
yum install gcc zlib zlib-devel make

Then, I downloaded clamav from the SourceForge website. The version I downloaded was 0.92rc2. Firefox automatically saves files to the Desktop, and so, I just let it do its thing.

Next, back in the terminal window, I compiled the program:

cd /home/fedora/Desktop
tar -xzvvf clamav*.tar.gz
cd clamav*
useradd clamav
./configure
make
make install

Then, I had to update the configuration files. You can do this from the terminal with:

freshclam
sed -e 's/^Example$/#Example/i' /usr/local/etc/freshclam.conf > freshclam.conf
mv -f freshclam.conf /usr/local/etc/freshclam.conf
sed -e 's/^Example$/#Example/i' /usr/local/etc/clamd.conf > clamd.conf
mv -f clamd.conf /usr/local/etc/clamd.conf

Next, download the most recent virus definitions.

freshclam

Finally, do your scan (You may need to mount it first).

clamscan /media/disk

Posted in How To. 1 Comment »